diff --git a/.gitignore b/.gitignore index 29a5807..c121dcb 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,9 @@ /persistence/ /helpers.* /index.* +/binary.* +/utf8.* +/varint.* /proofs.* # misc diff --git a/package-lock.json b/package-lock.json index b61f5ed..b9660e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,20 +1,20 @@ { "name": "persistenceonejs", - "version": "2.2.0", + "version": "2.3.0-rc0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "persistenceonejs", - "version": "2.2.0", + "version": "2.3.0-rc0", "license": "ASLv2", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - }, "devDependencies": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stargate": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", "@cosmology/telescope": "^0.109.4", - "@types/long": "^4.0.1", "@types/node": "^18.6.3", "cosmwasm-typescript-gen": "^0.3.9", "husky": "^8.0.1", @@ -37,9 +37,8 @@ }, "node_modules/@babel/code-frame": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/highlight": "^7.22.5" }, @@ -49,9 +48,8 @@ }, "node_modules/@babel/compat-data": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz", - "integrity": "sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -87,9 +85,8 @@ }, "node_modules/@babel/generator": { "version": "7.18.12", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz", - "integrity": "sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.18.10", "@jridgewell/gen-mapping": "^0.3.2", @@ -114,9 +111,8 @@ }, "node_modules/@babel/helper-annotate-as-pure": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -126,9 +122,8 @@ }, "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -152,9 +147,8 @@ }, "node_modules/@babel/helper-compilation-targets": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz", - "integrity": "sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.22.5", "@babel/helper-validator-option": "^7.22.5", @@ -171,9 +165,8 @@ }, "node_modules/@babel/helper-create-class-features-plugin": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", - "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-environment-visitor": "^7.22.5", @@ -225,9 +218,8 @@ }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -245,9 +237,8 @@ }, "node_modules/@babel/helper-function-name": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/template": "^7.22.5", "@babel/types": "^7.22.5" @@ -258,9 +249,8 @@ }, "node_modules/@babel/helper-function-name/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -272,9 +262,8 @@ }, "node_modules/@babel/helper-hoist-variables": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -284,9 +273,8 @@ }, "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -298,9 +286,8 @@ }, "node_modules/@babel/helper-member-expression-to-functions": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", - "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -310,9 +297,8 @@ }, "node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -324,9 +310,8 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -336,9 +321,8 @@ }, "node_modules/@babel/helper-module-imports/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -350,9 +334,8 @@ }, "node_modules/@babel/helper-module-transforms": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", - "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-environment-visitor": "^7.22.5", "@babel/helper-module-imports": "^7.22.5", @@ -369,9 +352,8 @@ }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", @@ -384,9 +366,8 @@ }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/generator": "^7.22.5", @@ -405,9 +386,8 @@ }, "node_modules/@babel/helper-module-transforms/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -419,9 +399,8 @@ }, "node_modules/@babel/helper-module-transforms/node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -433,9 +412,8 @@ }, "node_modules/@babel/helper-optimise-call-expression": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", - "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -445,9 +423,8 @@ }, "node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -459,18 +436,16 @@ }, "node_modules/@babel/helper-plugin-utils": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz", - "integrity": "sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-environment-visitor": "^7.22.5", @@ -486,9 +461,8 @@ }, "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -500,9 +474,8 @@ }, "node_modules/@babel/helper-replace-supers": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", - "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-environment-visitor": "^7.22.5", "@babel/helper-member-expression-to-functions": "^7.22.5", @@ -517,9 +490,8 @@ }, "node_modules/@babel/helper-replace-supers/node_modules/@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", @@ -532,9 +504,8 @@ }, "node_modules/@babel/helper-replace-supers/node_modules/@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/generator": "^7.22.5", @@ -553,9 +524,8 @@ }, "node_modules/@babel/helper-replace-supers/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -567,9 +537,8 @@ }, "node_modules/@babel/helper-replace-supers/node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -581,9 +550,8 @@ }, "node_modules/@babel/helper-simple-access": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -593,9 +561,8 @@ }, "node_modules/@babel/helper-simple-access/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -607,9 +574,8 @@ }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", - "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -619,9 +585,8 @@ }, "node_modules/@babel/helper-skip-transparent-expression-wrappers/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -633,9 +598,8 @@ }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", - "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -645,9 +609,8 @@ }, "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -659,36 +622,32 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz", - "integrity": "sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-function-name": "^7.22.5", "@babel/template": "^7.22.5", @@ -701,9 +660,8 @@ }, "node_modules/@babel/helper-wrap-function/node_modules/@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", @@ -716,9 +674,8 @@ }, "node_modules/@babel/helper-wrap-function/node_modules/@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/generator": "^7.22.5", @@ -737,9 +694,8 @@ }, "node_modules/@babel/helper-wrap-function/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -751,9 +707,8 @@ }, "node_modules/@babel/helper-wrap-function/node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -765,9 +720,8 @@ }, "node_modules/@babel/helpers": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.5.tgz", - "integrity": "sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==", "dev": true, + "license": "MIT", "dependencies": { "@babel/template": "^7.22.5", "@babel/traverse": "^7.22.5", @@ -779,9 +733,8 @@ }, "node_modules/@babel/helpers/node_modules/@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", @@ -794,9 +747,8 @@ }, "node_modules/@babel/helpers/node_modules/@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/generator": "^7.22.5", @@ -815,9 +767,8 @@ }, "node_modules/@babel/helpers/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -829,9 +780,8 @@ }, "node_modules/@babel/helpers/node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -843,9 +793,8 @@ }, "node_modules/@babel/highlight": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", @@ -857,9 +806,8 @@ }, "node_modules/@babel/parser": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", "dev": true, + "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -883,9 +831,8 @@ }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz", - "integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", @@ -932,9 +879,8 @@ }, "node_modules/@babel/plugin-proposal-class-static-block": { "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz", - "integrity": "sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-create-class-features-plugin": "^7.21.0", "@babel/helper-plugin-utils": "^7.20.2", @@ -964,9 +910,8 @@ }, "node_modules/@babel/plugin-proposal-export-default-from": { "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz", - "integrity": "sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.18.9", "@babel/plugin-syntax-export-default-from": "^7.18.6" @@ -1010,9 +955,8 @@ }, "node_modules/@babel/plugin-proposal-logical-assignment-operators": { "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", - "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" @@ -1056,10 +1000,8 @@ }, "node_modules/@babel/plugin-proposal-object-rest-spread": { "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz", - "integrity": "sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.", "dev": true, + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.18.8", "@babel/helper-compilation-targets": "^7.18.9", @@ -1122,9 +1064,8 @@ }, "node_modules/@babel/plugin-proposal-private-property-in-object": { "version": "7.21.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", - "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", "@babel/helper-create-class-features-plugin": "^7.21.0", @@ -1227,9 +1168,8 @@ }, "node_modules/@babel/plugin-syntax-import-assertions": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", - "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1253,9 +1193,8 @@ }, "node_modules/@babel/plugin-syntax-jsx": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", - "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1362,9 +1301,8 @@ }, "node_modules/@babel/plugin-syntax-typescript": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", - "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1377,9 +1315,8 @@ }, "node_modules/@babel/plugin-transform-arrow-functions": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", - "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1392,9 +1329,8 @@ }, "node_modules/@babel/plugin-transform-async-to-generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", - "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.22.5", "@babel/helper-plugin-utils": "^7.22.5", @@ -1423,9 +1359,8 @@ }, "node_modules/@babel/plugin-transform-block-scoping": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz", - "integrity": "sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1438,9 +1373,8 @@ }, "node_modules/@babel/plugin-transform-classes": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz", - "integrity": "sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-compilation-targets": "^7.22.5", @@ -1461,9 +1395,8 @@ }, "node_modules/@babel/plugin-transform-computed-properties": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", - "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/template": "^7.22.5" @@ -1477,9 +1410,8 @@ }, "node_modules/@babel/plugin-transform-destructuring": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz", - "integrity": "sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1536,9 +1468,8 @@ }, "node_modules/@babel/plugin-transform-for-of": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz", - "integrity": "sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1595,9 +1526,8 @@ }, "node_modules/@babel/plugin-transform-modules-amd": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", - "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-module-transforms": "^7.22.5", "@babel/helper-plugin-utils": "^7.22.5" @@ -1611,9 +1541,8 @@ }, "node_modules/@babel/plugin-transform-modules-commonjs": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", - "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-module-transforms": "^7.22.5", "@babel/helper-plugin-utils": "^7.22.5", @@ -1704,9 +1633,8 @@ }, "node_modules/@babel/plugin-transform-optional-chaining": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz", - "integrity": "sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", @@ -1721,9 +1649,8 @@ }, "node_modules/@babel/plugin-transform-parameters": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", - "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -1750,9 +1677,8 @@ }, "node_modules/@babel/plugin-transform-regenerator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", - "integrity": "sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "regenerator-transform": "^0.15.1" @@ -1780,9 +1706,8 @@ }, "node_modules/@babel/plugin-transform-runtime": { "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.10.tgz", - "integrity": "sha512-q5mMeYAdfEbpBAgzl7tBre/la3LeCxmDO1+wMXRdPWbcoMjR3GiXlCLk7JBZVVye0bqTGNMbt0yYVXX1B1jEWQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.18.6", "@babel/helper-plugin-utils": "^7.18.9", @@ -1800,9 +1725,8 @@ }, "node_modules/@babel/plugin-transform-runtime/node_modules/babel-plugin-polyfill-regenerator": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-define-polyfill-provider": "^0.3.3" }, @@ -1883,9 +1807,8 @@ }, "node_modules/@babel/plugin-transform-typescript": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.5.tgz", - "integrity": "sha512-SMubA9S7Cb5sGSFFUlqxyClTA9zWJ8qGQrppNUm05LtFuN1ELRFNndkix4zUJrC9F+YivWwa1dHMSyo0e0N9dA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-create-class-features-plugin": "^7.22.5", @@ -1930,9 +1853,8 @@ }, "node_modules/@babel/preset-env": { "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.10.tgz", - "integrity": "sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/compat-data": "^7.18.8", "@babel/helper-compilation-targets": "^7.18.9", @@ -2019,9 +1941,8 @@ }, "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-regenerator": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-define-polyfill-provider": "^0.3.3" }, @@ -2046,9 +1967,8 @@ }, "node_modules/@babel/preset-typescript": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz", - "integrity": "sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-validator-option": "^7.22.5", @@ -2065,9 +1985,8 @@ }, "node_modules/@babel/runtime": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", "dev": true, + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -2077,9 +1996,8 @@ }, "node_modules/@babel/template": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/parser": "^7.22.5", @@ -2091,9 +2009,8 @@ }, "node_modules/@babel/template/node_modules/@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.5", @@ -2105,9 +2022,8 @@ }, "node_modules/@babel/traverse": { "version": "7.18.11", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz", - "integrity": "sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.18.6", "@babel/generator": "^7.18.10", @@ -2137,11 +2053,157 @@ "node": ">=6.9.0" } }, + "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==", + "dev": true, + "dependencies": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "node_modules/@cosmjs/amino": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", + "dev": true, + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" + } + }, + "node_modules/@cosmjs/crypto": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.1.tgz", + "integrity": "sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==", + "dev": true, + "dependencies": { + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers-sumo": "^0.7.11" + } + }, + "node_modules/@cosmjs/encoding": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.1.tgz", + "integrity": "sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==", + "dev": true, + "dependencies": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "node_modules/@cosmjs/json-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz", + "integrity": "sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==", + "dev": true, + "dependencies": { + "@cosmjs/stream": "^0.31.1", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/math": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.1.tgz", + "integrity": "sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.0" + } + }, + "node_modules/@cosmjs/proto-signing": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz", + "integrity": "sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg==", + "dev": true, + "dependencies": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0" + } + }, + "node_modules/@cosmjs/socket": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.1.tgz", + "integrity": "sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==", + "dev": true, + "dependencies": { + "@cosmjs/stream": "^0.31.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stargate": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.31.1.tgz", + "integrity": "sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg==", + "dev": true, + "dependencies": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0", + "protobufjs": "~6.11.3", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/stream": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.31.1.tgz", + "integrity": "sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==", + "dev": true, + "dependencies": { + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/tendermint-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz", + "integrity": "sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA==", + "dev": true, + "dependencies": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/json-rpc": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/socket": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "node_modules/@cosmjs/utils": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==", + "dev": true + }, "node_modules/@cosmology/ast": { "version": "0.95.4", - "resolved": "https://registry.npmjs.org/@cosmology/ast/-/ast-0.95.4.tgz", - "integrity": "sha512-xhNK2zJnKQa9N7THX/zoA5NYK8909kYjR9sK83rHQuf5UaqqwtcZeeAVcgKsNRIDhosd6taz3HOm3XP3qDF4ng==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@babel/parser": "^7.21.4", "@babel/types": "7.21.4", @@ -2153,9 +2215,8 @@ }, "node_modules/@cosmology/ast/node_modules/@babel/types": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz", - "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -2167,9 +2228,8 @@ }, "node_modules/@cosmology/proto-parser": { "version": "0.51.2", - "resolved": "https://registry.npmjs.org/@cosmology/proto-parser/-/proto-parser-0.51.2.tgz", - "integrity": "sha512-Lk2lrflM5HkeRCTxFENsizVY17Oef1xtmL5wbTcGlahvFfetUYayKwUeoL3ODtb52R46B/RsgC1AKFyZLO7EiA==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@cosmology/protobufjs": "6.11.6", "@cosmology/types": "^0.42.2", @@ -2182,18 +2242,16 @@ }, "node_modules/@cosmology/proto-parser/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/@cosmology/proto-parser/node_modules/glob": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2210,9 +2268,8 @@ }, "node_modules/@cosmology/proto-parser/node_modules/minimatch": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2222,9 +2279,8 @@ }, "node_modules/@cosmology/proto-parser/node_modules/mkdirp": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.0.tgz", - "integrity": "sha512-7+JDnNsyCvZXoUJdkMR0oUE2AmAdsNXGTmRbiOjYIwQ6q+bL6NwrozGQdPcmYaNcrhH37F50HHBUzoaBV6FITQ==", "dev": true, + "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -2237,10 +2293,9 @@ }, "node_modules/@cosmology/protobufjs": { "version": "6.11.6", - "resolved": "https://registry.npmjs.org/@cosmology/protobufjs/-/protobufjs-6.11.6.tgz", - "integrity": "sha512-k1opGC9CTX5vD2447pUqLmleVv0Kb8RasBUxkZHudVOvuXs2qAAGONmMIEGRCROKTodhTY9fdTnGU2lCZqAwNw==", "dev": true, "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -2263,9 +2318,8 @@ }, "node_modules/@cosmology/telescope": { "version": "0.109.4", - "resolved": "https://registry.npmjs.org/@cosmology/telescope/-/telescope-0.109.4.tgz", - "integrity": "sha512-ZFJg2RGdsT6l+WrEvKH5pdSPKdRSann2Uk8BOoSCphgLbvSO0dwRtLH/tKoxNcLrhkIdniA0RmF5UhsrGVyKqA==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@babel/generator": "7.21.4", "@babel/parser": "^7.21.4", @@ -2298,9 +2352,8 @@ }, "node_modules/@cosmology/telescope/node_modules/@babel/generator": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz", - "integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.21.4", "@jridgewell/gen-mapping": "^0.3.2", @@ -2313,9 +2366,8 @@ }, "node_modules/@cosmology/telescope/node_modules/@babel/traverse": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz", - "integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.21.4", "@babel/generator": "^7.21.4", @@ -2334,9 +2386,8 @@ }, "node_modules/@cosmology/telescope/node_modules/@babel/types": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz", - "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.19.4", "@babel/helper-validator-identifier": "^7.19.1", @@ -2348,9 +2399,8 @@ }, "node_modules/@cosmology/telescope/node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -2362,27 +2412,24 @@ }, "node_modules/@cosmology/telescope/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/@cosmology/telescope/node_modules/deepmerge": { "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/@cosmology/telescope/node_modules/glob": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2399,15 +2446,13 @@ }, "node_modules/@cosmology/telescope/node_modules/long": { "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/@cosmology/telescope/node_modules/minimatch": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2417,18 +2462,16 @@ }, "node_modules/@cosmology/telescope/node_modules/minimist": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/@cosmology/telescope/node_modules/mkdirp": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.0.tgz", - "integrity": "sha512-7+JDnNsyCvZXoUJdkMR0oUE2AmAdsNXGTmRbiOjYIwQ6q+bL6NwrozGQdPcmYaNcrhH37F50HHBUzoaBV6FITQ==", "dev": true, + "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -2441,9 +2484,8 @@ }, "node_modules/@cosmology/telescope/node_modules/rimraf": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.0.tgz", - "integrity": "sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==", "dev": true, + "license": "ISC", "dependencies": { "glob": "^10.0.0" }, @@ -2459,9 +2501,8 @@ }, "node_modules/@cosmology/telescope/node_modules/rimraf/node_modules/glob": { "version": "10.3.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz", - "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==", "dev": true, + "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.0.3", @@ -2481,9 +2522,8 @@ }, "node_modules/@cosmology/telescope/node_modules/rimraf/node_modules/minimatch": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2496,18 +2536,16 @@ }, "node_modules/@cosmology/types": { "version": "0.42.2", - "resolved": "https://registry.npmjs.org/@cosmology/types/-/types-0.42.2.tgz", - "integrity": "sha512-ljtg/ozCPD7d3hL3r9fD/E4zUAitaJ8AbsLlR22x/r7eyUxhEP3cAvEeNsK0hgXAFbywPIn2w1cYARiWSMLSog==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "case": "1.6.3" } }, "node_modules/@cosmology/utils": { "version": "0.17.2", - "resolved": "https://registry.npmjs.org/@cosmology/utils/-/utils-0.17.2.tgz", - "integrity": "sha512-SQEOVFbhYf2+YmSgYymjEpsP5/zNAnpAYXFYN180b6XcUR0BMcIxghkZ+VHT5HbW+wynVTZezjyxkuwfftVEKA==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@cosmology/types": "^0.42.2", "dotty": "0.1.2" @@ -2515,9 +2553,8 @@ }, "node_modules/@cosmwasm/ts-codegen": { "version": "0.34.0", - "resolved": "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.34.0.tgz", - "integrity": "sha512-Mt/aYj0be9GnA51Arysqr9L8KQNWUJJHoJvtru7hkHmukPSewZDilwHCOJAaehk5gjsP7LFey2o2KEdfzkANhA==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@babel/core": "7.18.10", "@babel/generator": "7.18.12", @@ -2553,9 +2590,8 @@ }, "node_modules/@cosmwasm/ts-codegen/node_modules/@babel/parser": { "version": "7.18.11", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz", - "integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==", "dev": true, + "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -2565,18 +2601,16 @@ }, "node_modules/@cosmwasm/ts-codegen/node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/@cosmwasm/ts-codegen/node_modules/glob": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2593,15 +2627,13 @@ }, "node_modules/@cosmwasm/ts-codegen/node_modules/long": { "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "dev": true + "dev": true, + "license": "Apache-2.0" }, "node_modules/@cosmwasm/ts-codegen/node_modules/minimatch": { "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2611,9 +2643,8 @@ }, "node_modules/@cosmwasm/ts-codegen/node_modules/wasm-ast-types": { "version": "0.25.0", - "resolved": "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz", - "integrity": "sha512-ZTjXuBqRf3ntxXmskO1TyTTr8UbmAZGr72JGGctizzpdokMtuLsk5q8jHaFUv/qgQni1KuBxZnHIyaj1lnZegQ==", "dev": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@babel/runtime": "^7.18.9", "@babel/types": "7.18.10", @@ -2645,9 +2676,8 @@ }, "node_modules/@isaacs/cliui": { "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, + "license": "ISC", "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", @@ -2662,9 +2692,8 @@ }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -2674,9 +2703,8 @@ }, "node_modules/@isaacs/cliui/node_modules/ansi-styles": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -2686,15 +2714,13 @@ }, "node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, + "license": "MIT", "dependencies": { "eastasianwidth": "^0.2.0", "emoji-regex": "^9.2.2", @@ -2709,9 +2735,8 @@ }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -2724,9 +2749,8 @@ }, "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^6.1.0", "string-width": "^5.0.1", @@ -2741,9 +2765,8 @@ }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, + "license": "ISC", "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -2757,18 +2780,16 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, + "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -2779,9 +2800,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -2792,9 +2812,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, @@ -2804,9 +2823,8 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, + "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, @@ -2816,36 +2834,32 @@ }, "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@jest/schemas": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz", - "integrity": "sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==", "dev": true, + "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.24.1" }, @@ -2855,9 +2869,8 @@ }, "node_modules/@jest/transform": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-28.1.3.tgz", - "integrity": "sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA==", "dev": true, + "license": "MIT", "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^28.1.3", @@ -2881,9 +2894,8 @@ }, "node_modules/@jest/transform/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2896,9 +2908,8 @@ }, "node_modules/@jest/transform/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -2912,9 +2923,8 @@ }, "node_modules/@jest/transform/node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -2924,33 +2934,29 @@ }, "node_modules/@jest/transform/node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jest/transform/node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@jest/transform/node_modules/slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@jest/transform/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -2960,9 +2966,8 @@ }, "node_modules/@jest/types": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz", - "integrity": "sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==", "dev": true, + "license": "MIT", "dependencies": { "@jest/schemas": "^28.1.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -2977,9 +2982,8 @@ }, "node_modules/@jest/types/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2992,9 +2996,8 @@ }, "node_modules/@jest/types/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3008,9 +3011,8 @@ }, "node_modules/@jest/types/node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -3020,24 +3022,21 @@ }, "node_modules/@jest/types/node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@jest/types/node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@jest/types/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3059,9 +3058,8 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } @@ -3081,9 +3079,8 @@ }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "3.1.0", "@jridgewell/sourcemap-codec": "1.4.14" @@ -3094,11 +3091,22 @@ "dev": true, "license": "MIT" }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, + "license": "MIT", "optional": true, "engines": { "node": ">=14" @@ -3106,22 +3114,27 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", + "dev": true, "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", @@ -3130,29 +3143,33 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", + "dev": true, "license": "BSD-3-Clause" }, "node_modules/@pyramation/json-schema-ref-parser": { "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@pyramation/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz", - "integrity": "sha512-L5kToHAEc1Q87R8ZwWFaNa4tPHr8Hnm+U+DRdUVq3tUtk+EX4pCqSd34Z6EMxNi/bjTzt1syAG9J2Oo1YFlqSg==", "dev": true, + "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", "call-me-maybe": "^1.0.1", @@ -3161,18 +3178,16 @@ }, "node_modules/@pyramation/json-schema-ref-parser/node_modules/argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, + "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/@pyramation/json-schema-ref-parser/node_modules/js-yaml": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -3183,9 +3198,8 @@ }, "node_modules/@pyramation/json-schema-to-typescript": { "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@pyramation/json-schema-to-typescript/-/json-schema-to-typescript-11.0.4.tgz", - "integrity": "sha512-+aSzXDLhMHOEdV2cJ7Tjg/9YenjHU5BCmClVygzwxJZ1R16NOfEn7lTAwVzb/2jivOSnhjHzMJbnSf8b6rd1zg==", "dev": true, + "license": "MIT", "dependencies": { "@pyramation/json-schema-ref-parser": "9.0.6", "@types/json-schema": "^7.0.11", @@ -3211,9 +3225,8 @@ }, "node_modules/@sinclair/typebox": { "version": "0.24.51", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", - "integrity": "sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node10": { "version": "1.0.9", @@ -3246,33 +3259,29 @@ }, "node_modules/@types/graceful-fs": { "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", "dev": true, + "license": "MIT", "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, + "license": "MIT", "dependencies": { "@types/istanbul-lib-report": "*" } @@ -3289,6 +3298,7 @@ }, "node_modules/@types/long": { "version": "4.0.2", + "dev": true, "license": "MIT" }, "node_modules/@types/minimatch": { @@ -3298,8 +3308,8 @@ }, "node_modules/@types/node": { "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + "dev": true, + "license": "MIT" }, "node_modules/@types/parse-package-name": { "version": "0.1.0", @@ -3313,18 +3323,16 @@ }, "node_modules/@types/yargs": { "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", "dev": true, + "license": "MIT", "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/acorn": { "version": "8.7.1", @@ -3407,11 +3415,19 @@ "@babel/runtime": "^7.11.2" } }, + "node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.0" + } + }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", @@ -3464,6 +3480,38 @@ "dev": true, "license": "MIT" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true + }, + "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==", + "dev": true + }, "node_modules/brace-expansion": { "version": "1.1.11", "dev": true, @@ -3484,6 +3532,12 @@ "node": ">=8" } }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, "node_modules/browserslist": { "version": "4.21.4", "dev": true, @@ -3513,9 +3567,8 @@ }, "node_modules/bser": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "node-int64": "^0.4.0" } @@ -3527,9 +3580,8 @@ }, "node_modules/camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -3577,8 +3629,6 @@ }, "node_modules/ci-info": { "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true, "funding": [ { @@ -3586,6 +3636,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -3672,6 +3723,16 @@ "url": "https://opencollective.com/core-js" } }, + "node_modules/cosmjs-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", + "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", + "dev": true, + "dependencies": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, "node_modules/cosmwasm-typescript-gen": { "version": "0.3.9", "dev": true, @@ -4140,6 +4201,37 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/diff": { "version": "4.0.2", "dev": true, @@ -4155,15 +4247,35 @@ }, "node_modules/eastasianwidth": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/electron-to-chromium": { "version": "1.4.284", "dev": true, "license": "ISC" }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "dev": true, @@ -4291,9 +4403,8 @@ }, "node_modules/fb-watchman": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "bser": "2.1.1" } @@ -4320,11 +4431,30 @@ "node": ">=8" } }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, + "license": "ISC", "dependencies": { "cross-spawn": "^7.0.0", "signal-exit": "^4.0.1" @@ -4338,9 +4468,8 @@ }, "node_modules/foreground-child/node_modules/signal-exit": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", "dev": true, + "license": "ISC", "engines": { "node": ">=14" }, @@ -4385,11 +4514,25 @@ "node": ">=6.9.0" } }, + "node_modules/get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-package-type": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.0.0" } @@ -4450,11 +4593,37 @@ "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==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/has": { "version": "1.0.3", @@ -4494,6 +4663,63 @@ "node": ">=4" } }, + "node_modules/has-property-descriptors": { + "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" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/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, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "node_modules/husky": { "version": "8.0.1", "dev": true, @@ -4768,20 +4994,27 @@ "dev": true, "license": "ISC" }, + "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==", + "dev": true, + "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", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -4795,9 +5028,8 @@ }, "node_modules/jackspeak": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", - "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, @@ -4813,9 +5045,8 @@ }, "node_modules/jest-haste-map": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-28.1.3.tgz", - "integrity": "sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA==", "dev": true, + "license": "MIT", "dependencies": { "@jest/types": "^28.1.3", "@types/graceful-fs": "^4.1.3", @@ -4838,18 +5069,16 @@ }, "node_modules/jest-regex-util": { "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", - "integrity": "sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==", "dev": true, + "license": "MIT", "engines": { "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, "node_modules/jest-util": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz", - "integrity": "sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==", "dev": true, + "license": "MIT", "dependencies": { "@jest/types": "^28.1.3", "@types/node": "*", @@ -4864,9 +5093,8 @@ }, "node_modules/jest-util/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -4879,9 +5107,8 @@ }, "node_modules/jest-util/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4895,9 +5122,8 @@ }, "node_modules/jest-util/node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -4907,24 +5133,21 @@ }, "node_modules/jest-util/node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jest-util/node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/jest-util/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4934,9 +5157,8 @@ }, "node_modules/jest-worker": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-28.1.3.tgz", - "integrity": "sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -4948,18 +5170,16 @@ }, "node_modules/jest-worker/node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4972,9 +5192,8 @@ }, "node_modules/js-tokens": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -5036,6 +5255,21 @@ "node": ">=6" } }, + "node_modules/libsodium-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz", + "integrity": "sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==", + "dev": true + }, + "node_modules/libsodium-wrappers-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz", + "integrity": "sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==", + "dev": true, + "dependencies": { + "libsodium-sumo": "^0.7.13" + } + }, "node_modules/lodash": { "version": "4.17.21", "dev": true, @@ -5048,6 +5282,7 @@ }, "node_modules/long": { "version": "4.0.0", + "dev": true, "license": "Apache-2.0" }, "node_modules/lru-cache": { @@ -5073,9 +5308,8 @@ }, "node_modules/makeerror": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "tmpl": "1.0.5" } @@ -5097,9 +5331,8 @@ }, "node_modules/merge-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/micromatch": { "version": "4.0.5", @@ -5121,6 +5354,18 @@ "node": ">=4" } }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, "node_modules/minimatch": { "version": "3.1.2", "dev": true, @@ -5139,9 +5384,8 @@ }, "node_modules/minipass": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", - "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==", "dev": true, + "license": "ISC", "engines": { "node": ">=16 || 14 >=14.17" } @@ -5184,9 +5428,8 @@ }, "node_modules/node-int64": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/node-releases": { "version": "2.0.8", @@ -5209,6 +5452,15 @@ "node": ">=0.10.0" } }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/once": { "version": "1.4.0", "dev": true, @@ -5260,9 +5512,8 @@ }, "node_modules/parse-package-name": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-package-name/-/parse-package-name-1.0.0.tgz", - "integrity": "sha512-kBeTUtcj+SkyfaW4+KBe0HtsloBJ/mKTPoxpVdA57GZiPerREsUWJOhVj9anXweFiJkm5y8FG1sxFZkZ0SN6wg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/path-is-absolute": { "version": "1.0.1", @@ -5287,9 +5538,8 @@ }, "node_modules/path-scurry": { "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^9.1.1 || ^10.0.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -5303,9 +5553,8 @@ }, "node_modules/path-scurry/node_modules/lru-cache": { "version": "9.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", - "integrity": "sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==", "dev": true, + "license": "ISC", "engines": { "node": "14 || >=16.14" } @@ -5336,9 +5585,8 @@ }, "node_modules/prettier": { "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, @@ -5351,9 +5599,9 @@ }, "node_modules/protobufjs": { "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -5374,6 +5622,12 @@ "pbts": "bin/pbts" } }, + "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==", + "dev": true + }, "node_modules/rechoir": { "version": "0.6.2", "dev": true, @@ -5407,9 +5661,8 @@ }, "node_modules/regenerator-transform": { "version": "0.15.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", - "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/runtime": "^7.8.4" } @@ -5532,9 +5785,8 @@ }, "node_modules/semver": { "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -5599,9 +5851,8 @@ "node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -5613,9 +5864,8 @@ }, "node_modules/string-width-cjs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -5653,9 +5903,8 @@ "node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -5685,11 +5934,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/symbol-observable": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", + "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, "node_modules/test-exclude": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, + "license": "ISC", "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -5745,9 +6002,8 @@ }, "node_modules/tmpl": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true + "dev": true, + "license": "BSD-3-Clause" }, "node_modules/to-fast-properties": { "version": "2.0.0", @@ -5822,9 +6078,8 @@ }, "node_modules/typescript": { "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5914,9 +6169,8 @@ }, "node_modules/walker": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "makeerror": "1.0.12" } @@ -5961,9 +6215,8 @@ "node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -5978,9 +6231,8 @@ }, "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -5993,9 +6245,8 @@ }, "node_modules/wrap-ansi-cjs/node_modules/color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -6005,24 +6256,21 @@ }, "node_modules/wrap-ansi-cjs/node_modules/color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/wrap-ansi-cjs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/wrap-ansi-cjs/node_modules/string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -6039,9 +6287,8 @@ }, "node_modules/write-file-atomic": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, + "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -6050,6 +6297,37 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/ws": { + "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" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xstream": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", + "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", + "dev": true, + "dependencies": { + "globalthis": "^1.0.1", + "symbol-observable": "^2.0.3" + } + }, "node_modules/yallist": { "version": "3.1.1", "dev": true, @@ -6075,8 +6353,6 @@ }, "@babel/code-frame": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", - "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "requires": { "@babel/highlight": "^7.22.5" @@ -6084,8 +6360,6 @@ }, "@babel/compat-data": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.5.tgz", - "integrity": "sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==", "dev": true }, "@babel/core": { @@ -6111,8 +6385,6 @@ }, "@babel/generator": { "version": "7.18.12", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.12.tgz", - "integrity": "sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg==", "dev": true, "requires": { "@babel/types": "^7.18.10", @@ -6133,8 +6405,6 @@ }, "@babel/helper-annotate-as-pure": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", - "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6142,8 +6412,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6163,8 +6431,6 @@ }, "@babel/helper-compilation-targets": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.5.tgz", - "integrity": "sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==", "dev": true, "requires": { "@babel/compat-data": "^7.22.5", @@ -6176,8 +6442,6 @@ }, "@babel/helper-create-class-features-plugin": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", - "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.22.5", @@ -6213,8 +6477,6 @@ }, "@babel/helper-environment-visitor": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true }, "@babel/helper-explode-assignable-expression": { @@ -6226,8 +6488,6 @@ }, "@babel/helper-function-name": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "requires": { "@babel/template": "^7.22.5", @@ -6236,8 +6496,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6249,8 +6507,6 @@ }, "@babel/helper-hoist-variables": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6258,8 +6514,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6271,8 +6525,6 @@ }, "@babel/helper-member-expression-to-functions": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", - "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6280,8 +6532,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6293,8 +6543,6 @@ }, "@babel/helper-module-imports": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6302,8 +6550,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6315,8 +6561,6 @@ }, "@babel/helper-module-transforms": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", - "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.22.5", @@ -6331,8 +6575,6 @@ "dependencies": { "@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "requires": { "@babel/types": "^7.22.5", @@ -6343,8 +6585,6 @@ }, "@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, "requires": { "@babel/code-frame": "^7.22.5", @@ -6361,8 +6601,6 @@ }, "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6372,8 +6610,6 @@ }, "@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", @@ -6385,8 +6621,6 @@ }, "@babel/helper-optimise-call-expression": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", - "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6394,8 +6628,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6407,14 +6639,10 @@ }, "@babel/helper-plugin-utils": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true }, "@babel/helper-remap-async-to-generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.5.tgz", - "integrity": "sha512-cU0Sq1Rf4Z55fgz7haOakIyM7+x/uCFwXpLPaeRzfoUtAEAuUZjZvFPjL/rk5rW693dIgn2hng1W7xbT7lWT4g==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.22.5", @@ -6425,8 +6653,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6438,8 +6664,6 @@ }, "@babel/helper-replace-supers": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", - "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.22.5", @@ -6452,8 +6676,6 @@ "dependencies": { "@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "requires": { "@babel/types": "^7.22.5", @@ -6464,8 +6686,6 @@ }, "@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, "requires": { "@babel/code-frame": "^7.22.5", @@ -6482,8 +6702,6 @@ }, "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6493,8 +6711,6 @@ }, "@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", @@ -6506,8 +6722,6 @@ }, "@babel/helper-simple-access": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", - "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6515,8 +6729,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6528,8 +6740,6 @@ }, "@babel/helper-skip-transparent-expression-wrappers": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", - "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6537,8 +6747,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6550,8 +6758,6 @@ }, "@babel/helper-split-export-declaration": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", - "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", "dev": true, "requires": { "@babel/types": "^7.22.5" @@ -6559,8 +6765,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6572,26 +6776,18 @@ }, "@babel/helper-string-parser": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true }, "@babel/helper-validator-identifier": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true }, "@babel/helper-validator-option": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true }, "@babel/helper-wrap-function": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.5.tgz", - "integrity": "sha512-bYqLIBSEshYcYQyfks8ewYA8S30yaGSeRslcvKMvoUk6HHPySbxHq9YRi6ghhzEU+yhQv9bP/jXnygkStOcqZw==", "dev": true, "requires": { "@babel/helper-function-name": "^7.22.5", @@ -6602,8 +6798,6 @@ "dependencies": { "@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "requires": { "@babel/types": "^7.22.5", @@ -6614,8 +6808,6 @@ }, "@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, "requires": { "@babel/code-frame": "^7.22.5", @@ -6632,8 +6824,6 @@ }, "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6643,8 +6833,6 @@ }, "@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", @@ -6656,8 +6844,6 @@ }, "@babel/helpers": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.5.tgz", - "integrity": "sha512-pSXRmfE1vzcUIDFQcSGA5Mr+GxBV9oiRKDuDxXvWQQBCh8HoIjs/2DlDB7H8smac1IVrB9/xdXj2N3Wol9Cr+Q==", "dev": true, "requires": { "@babel/template": "^7.22.5", @@ -6667,8 +6853,6 @@ "dependencies": { "@babel/generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", - "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "requires": { "@babel/types": "^7.22.5", @@ -6679,8 +6863,6 @@ }, "@babel/traverse": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", - "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", "dev": true, "requires": { "@babel/code-frame": "^7.22.5", @@ -6697,8 +6879,6 @@ }, "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -6708,8 +6888,6 @@ }, "@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", @@ -6721,8 +6899,6 @@ }, "@babel/highlight": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", - "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.22.5", @@ -6732,8 +6908,6 @@ }, "@babel/parser": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -6745,8 +6919,6 @@ }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.5.tgz", - "integrity": "sha512-31Bb65aZaUwqCbWMnZPduIZxCBngHFlzyN6Dq6KAJjtx+lx6ohKHubc61OomYi7XwVD4Ol0XCVz4h+pYFR048g==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5", @@ -6774,8 +6946,6 @@ }, "@babel/plugin-proposal-class-static-block": { "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz", - "integrity": "sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw==", "dev": true, "requires": { "@babel/helper-create-class-features-plugin": "^7.21.0", @@ -6793,8 +6963,6 @@ }, "@babel/plugin-proposal-export-default-from": { "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz", - "integrity": "sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.18.9", @@ -6819,8 +6987,6 @@ }, "@babel/plugin-proposal-logical-assignment-operators": { "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", - "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.20.2", @@ -6845,8 +7011,6 @@ }, "@babel/plugin-proposal-object-rest-spread": { "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz", - "integrity": "sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q==", "dev": true, "requires": { "@babel/compat-data": "^7.18.8", @@ -6883,8 +7047,6 @@ }, "@babel/plugin-proposal-private-property-in-object": { "version": "7.21.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", - "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.18.6", @@ -6945,8 +7107,6 @@ }, "@babel/plugin-syntax-import-assertions": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", - "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -6961,8 +7121,6 @@ }, "@babel/plugin-syntax-jsx": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", - "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7026,8 +7184,6 @@ }, "@babel/plugin-syntax-typescript": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", - "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7035,8 +7191,6 @@ }, "@babel/plugin-transform-arrow-functions": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", - "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7044,8 +7198,6 @@ }, "@babel/plugin-transform-async-to-generator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", - "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.22.5", @@ -7062,8 +7214,6 @@ }, "@babel/plugin-transform-block-scoping": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.5.tgz", - "integrity": "sha512-EcACl1i5fSQ6bt+YGuU/XGCeZKStLmyVGytWkpyhCLeQVA0eu6Wtiw92V+I1T/hnezUv7j74dA/Ro69gWcU+hg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7071,8 +7221,6 @@ }, "@babel/plugin-transform-classes": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.5.tgz", - "integrity": "sha512-2edQhLfibpWpsVBx2n/GKOz6JdGQvLruZQfGr9l1qes2KQaWswjBzhQF7UDUZMNaMMQeYnQzxwOMPsbYF7wqPQ==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.22.5", @@ -7088,8 +7236,6 @@ }, "@babel/plugin-transform-computed-properties": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", - "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5", @@ -7098,8 +7244,6 @@ }, "@babel/plugin-transform-destructuring": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.5.tgz", - "integrity": "sha512-GfqcFuGW8vnEqTUBM7UtPd5A4q797LTvvwKxXTgRsFjoqaJiEg9deBG6kWeQYkVEL569NpnmpC0Pkr/8BLKGnQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7130,8 +7274,6 @@ }, "@babel/plugin-transform-for-of": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz", - "integrity": "sha512-3kxQjX1dU9uudwSshyLeEipvrLjBCVthCgeTp6CzE/9JYrlAIaeekVxRpCWsDDfYTfRZRoCeZatCQvwo+wvK8A==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7162,8 +7304,6 @@ }, "@babel/plugin-transform-modules-amd": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", - "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.22.5", @@ -7172,8 +7312,6 @@ }, "@babel/plugin-transform-modules-commonjs": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", - "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.22.5", @@ -7224,8 +7362,6 @@ }, "@babel/plugin-transform-optional-chaining": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.5.tgz", - "integrity": "sha512-AconbMKOMkyG+xCng2JogMCDcqW8wedQAqpVIL4cOSescZ7+iW8utC6YDZLMCSUIReEA733gzRSaOSXMAt/4WQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5", @@ -7235,8 +7371,6 @@ }, "@babel/plugin-transform-parameters": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", - "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -7251,8 +7385,6 @@ }, "@babel/plugin-transform-regenerator": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.5.tgz", - "integrity": "sha512-rR7KePOE7gfEtNTh9Qw+iO3Q/e4DEsoQ+hdvM6QUDH7JRJ5qxq5AA52ZzBWbI5i9lfNuvySgOGP8ZN7LAmaiPw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5", @@ -7268,8 +7400,6 @@ }, "@babel/plugin-transform-runtime": { "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.10.tgz", - "integrity": "sha512-q5mMeYAdfEbpBAgzl7tBre/la3LeCxmDO1+wMXRdPWbcoMjR3GiXlCLk7JBZVVye0bqTGNMbt0yYVXX1B1jEWQ==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.18.6", @@ -7282,8 +7412,6 @@ "dependencies": { "babel-plugin-polyfill-regenerator": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", "dev": true, "requires": { "@babel/helper-define-polyfill-provider": "^0.3.3" @@ -7329,8 +7457,6 @@ }, "@babel/plugin-transform-typescript": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.5.tgz", - "integrity": "sha512-SMubA9S7Cb5sGSFFUlqxyClTA9zWJ8qGQrppNUm05LtFuN1ELRFNndkix4zUJrC9F+YivWwa1dHMSyo0e0N9dA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.22.5", @@ -7356,8 +7482,6 @@ }, "@babel/preset-env": { "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.18.10.tgz", - "integrity": "sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA==", "dev": true, "requires": { "@babel/compat-data": "^7.18.8", @@ -7439,8 +7563,6 @@ "dependencies": { "babel-plugin-polyfill-regenerator": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", "dev": true, "requires": { "@babel/helper-define-polyfill-provider": "^0.3.3" @@ -7461,8 +7583,6 @@ }, "@babel/preset-typescript": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz", - "integrity": "sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5", @@ -7474,8 +7594,6 @@ }, "@babel/runtime": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", "dev": true, "requires": { "regenerator-runtime": "^0.13.11" @@ -7483,8 +7601,6 @@ }, "@babel/template": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", - "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, "requires": { "@babel/code-frame": "^7.22.5", @@ -7494,8 +7610,6 @@ "dependencies": { "@babel/types": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", - "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.22.5", @@ -7507,8 +7621,6 @@ }, "@babel/traverse": { "version": "7.18.11", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.11.tgz", - "integrity": "sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ==", "dev": true, "requires": { "@babel/code-frame": "^7.18.6", @@ -7532,10 +7644,155 @@ "to-fast-properties": "^2.0.0" } }, + "@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==", + "dev": true, + "requires": { + "@noble/hashes": "^1.0.0", + "protobufjs": "^6.8.8" + } + }, + "@cosmjs/amino": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.31.1.tgz", + "integrity": "sha512-kkB9IAkNEUFtjp/uwHv95TgM8VGJ4VWfZwrTyLNqBDD1EpSX2dsNrmUe7k8OMPzKlZUFcKmD4iA0qGvIwzjbGA==", + "dev": true, + "requires": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1" + } + }, + "@cosmjs/crypto": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.31.1.tgz", + "integrity": "sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==", + "dev": true, + "requires": { + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "@noble/hashes": "^1", + "bn.js": "^5.2.0", + "elliptic": "^6.5.4", + "libsodium-wrappers-sumo": "^0.7.11" + } + }, + "@cosmjs/encoding": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.31.1.tgz", + "integrity": "sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==", + "dev": true, + "requires": { + "base64-js": "^1.3.0", + "bech32": "^1.1.4", + "readonly-date": "^1.0.0" + } + }, + "@cosmjs/json-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.31.1.tgz", + "integrity": "sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==", + "dev": true, + "requires": { + "@cosmjs/stream": "^0.31.1", + "xstream": "^11.14.0" + } + }, + "@cosmjs/math": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/math/-/math-0.31.1.tgz", + "integrity": "sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==", + "dev": true, + "requires": { + "bn.js": "^5.2.0" + } + }, + "@cosmjs/proto-signing": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.31.1.tgz", + "integrity": "sha512-hipbBVrssPu+jnmRzQRP5hhS/mbz2nU7RvxG/B1ZcdNhr1AtZC5DN09OTUoEpMSRgyQvScXmk/NTbyf+xmCgYg==", + "dev": true, + "requires": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0" + } + }, + "@cosmjs/socket": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.31.1.tgz", + "integrity": "sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==", + "dev": true, + "requires": { + "@cosmjs/stream": "^0.31.1", + "isomorphic-ws": "^4.0.1", + "ws": "^7", + "xstream": "^11.14.0" + } + }, + "@cosmjs/stargate": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.31.1.tgz", + "integrity": "sha512-TqOJZYOH5W3sZIjR6949GfjhGXO3kSHQ3/KmE+SuKyMMmQ5fFZ45beawiRtVF0/CJg5RyPFyFGJKhb1Xxv3Lcg==", + "dev": true, + "requires": { + "@confio/ics23": "^0.6.8", + "@cosmjs/amino": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "cosmjs-types": "^0.8.0", + "long": "^4.0.0", + "protobufjs": "~6.11.3", + "xstream": "^11.14.0" + } + }, + "@cosmjs/stream": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.31.1.tgz", + "integrity": "sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==", + "dev": true, + "requires": { + "xstream": "^11.14.0" + } + }, + "@cosmjs/tendermint-rpc": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.31.1.tgz", + "integrity": "sha512-KX+wwi725sSePqIxfMPPOqg+xTETV8BHGOBhRhCZXEl5Fq48UlXXq3/yG1sn7K67ADC0kqHqcCF41Wn1GxNNPA==", + "dev": true, + "requires": { + "@cosmjs/crypto": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", + "@cosmjs/json-rpc": "^0.31.1", + "@cosmjs/math": "^0.31.1", + "@cosmjs/socket": "^0.31.1", + "@cosmjs/stream": "^0.31.1", + "@cosmjs/utils": "^0.31.1", + "axios": "^0.21.2", + "readonly-date": "^1.0.0", + "xstream": "^11.14.0" + } + }, + "@cosmjs/utils": { + "version": "0.31.1", + "resolved": "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.31.1.tgz", + "integrity": "sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==", + "dev": true + }, "@cosmology/ast": { "version": "0.95.4", - "resolved": "https://registry.npmjs.org/@cosmology/ast/-/ast-0.95.4.tgz", - "integrity": "sha512-xhNK2zJnKQa9N7THX/zoA5NYK8909kYjR9sK83rHQuf5UaqqwtcZeeAVcgKsNRIDhosd6taz3HOm3XP3qDF4ng==", "dev": true, "requires": { "@babel/parser": "^7.21.4", @@ -7548,8 +7805,6 @@ "dependencies": { "@babel/types": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz", - "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", @@ -7561,8 +7816,6 @@ }, "@cosmology/proto-parser": { "version": "0.51.2", - "resolved": "https://registry.npmjs.org/@cosmology/proto-parser/-/proto-parser-0.51.2.tgz", - "integrity": "sha512-Lk2lrflM5HkeRCTxFENsizVY17Oef1xtmL5wbTcGlahvFfetUYayKwUeoL3ODtb52R46B/RsgC1AKFyZLO7EiA==", "dev": true, "requires": { "@cosmology/protobufjs": "6.11.6", @@ -7576,8 +7829,6 @@ "dependencies": { "brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -7585,8 +7836,6 @@ }, "glob": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -7598,8 +7847,6 @@ }, "minimatch": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -7607,16 +7854,12 @@ }, "mkdirp": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.0.tgz", - "integrity": "sha512-7+JDnNsyCvZXoUJdkMR0oUE2AmAdsNXGTmRbiOjYIwQ6q+bL6NwrozGQdPcmYaNcrhH37F50HHBUzoaBV6FITQ==", "dev": true } } }, "@cosmology/protobufjs": { "version": "6.11.6", - "resolved": "https://registry.npmjs.org/@cosmology/protobufjs/-/protobufjs-6.11.6.tgz", - "integrity": "sha512-k1opGC9CTX5vD2447pUqLmleVv0Kb8RasBUxkZHudVOvuXs2qAAGONmMIEGRCROKTodhTY9fdTnGU2lCZqAwNw==", "dev": true, "requires": { "@protobufjs/aspromise": "^1.1.2", @@ -7636,8 +7879,6 @@ }, "@cosmology/telescope": { "version": "0.109.4", - "resolved": "https://registry.npmjs.org/@cosmology/telescope/-/telescope-0.109.4.tgz", - "integrity": "sha512-ZFJg2RGdsT6l+WrEvKH5pdSPKdRSann2Uk8BOoSCphgLbvSO0dwRtLH/tKoxNcLrhkIdniA0RmF5UhsrGVyKqA==", "dev": true, "requires": { "@babel/generator": "7.21.4", @@ -7668,8 +7909,6 @@ "dependencies": { "@babel/generator": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz", - "integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==", "dev": true, "requires": { "@babel/types": "^7.21.4", @@ -7680,8 +7919,6 @@ }, "@babel/traverse": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz", - "integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==", "dev": true, "requires": { "@babel/code-frame": "^7.21.4", @@ -7698,8 +7935,6 @@ }, "@babel/types": { "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz", - "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.19.4", @@ -7709,8 +7944,6 @@ }, "@jridgewell/gen-mapping": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "requires": { "@jridgewell/set-array": "^1.0.1", @@ -7720,8 +7953,6 @@ }, "brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -7729,14 +7960,10 @@ }, "deepmerge": { "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true }, "glob": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -7748,14 +7975,10 @@ }, "long": { "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", "dev": true }, "minimatch": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", - "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -7763,20 +7986,14 @@ }, "minimist": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, "mkdirp": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.0.tgz", - "integrity": "sha512-7+JDnNsyCvZXoUJdkMR0oUE2AmAdsNXGTmRbiOjYIwQ6q+bL6NwrozGQdPcmYaNcrhH37F50HHBUzoaBV6FITQ==", "dev": true }, "rimraf": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.0.tgz", - "integrity": "sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==", "dev": true, "requires": { "glob": "^10.0.0" @@ -7784,8 +8001,6 @@ "dependencies": { "glob": { "version": "10.3.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.4.tgz", - "integrity": "sha512-6LFElP3A+i/Q8XQKEvZjkEWEOTgAIALR9AO2rwT8bgPhDd1anmqDJDZ6lLddI4ehxxxR1S5RIqKe1uapMQfYaQ==", "dev": true, "requires": { "foreground-child": "^3.1.0", @@ -7797,8 +8012,6 @@ }, "minimatch": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -7810,8 +8023,6 @@ }, "@cosmology/types": { "version": "0.42.2", - "resolved": "https://registry.npmjs.org/@cosmology/types/-/types-0.42.2.tgz", - "integrity": "sha512-ljtg/ozCPD7d3hL3r9fD/E4zUAitaJ8AbsLlR22x/r7eyUxhEP3cAvEeNsK0hgXAFbywPIn2w1cYARiWSMLSog==", "dev": true, "requires": { "case": "1.6.3" @@ -7819,8 +8030,6 @@ }, "@cosmology/utils": { "version": "0.17.2", - "resolved": "https://registry.npmjs.org/@cosmology/utils/-/utils-0.17.2.tgz", - "integrity": "sha512-SQEOVFbhYf2+YmSgYymjEpsP5/zNAnpAYXFYN180b6XcUR0BMcIxghkZ+VHT5HbW+wynVTZezjyxkuwfftVEKA==", "dev": true, "requires": { "@cosmology/types": "^0.42.2", @@ -7829,8 +8038,6 @@ }, "@cosmwasm/ts-codegen": { "version": "0.34.0", - "resolved": "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.34.0.tgz", - "integrity": "sha512-Mt/aYj0be9GnA51Arysqr9L8KQNWUJJHoJvtru7hkHmukPSewZDilwHCOJAaehk5gjsP7LFey2o2KEdfzkANhA==", "dev": true, "requires": { "@babel/core": "7.18.10", @@ -7864,14 +8071,10 @@ "dependencies": { "@babel/parser": { "version": "7.18.11", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.11.tgz", - "integrity": "sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ==", "dev": true }, "brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { "balanced-match": "^1.0.0" @@ -7879,8 +8082,6 @@ }, "glob": { "version": "8.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", - "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -7892,14 +8093,10 @@ }, "long": { "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", "dev": true }, "minimatch": { "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "requires": { "brace-expansion": "^2.0.1" @@ -7907,8 +8104,6 @@ }, "wasm-ast-types": { "version": "0.25.0", - "resolved": "https://registry.npmjs.org/wasm-ast-types/-/wasm-ast-types-0.25.0.tgz", - "integrity": "sha512-ZTjXuBqRf3ntxXmskO1TyTTr8UbmAZGr72JGGctizzpdokMtuLsk5q8jHaFUv/qgQni1KuBxZnHIyaj1lnZegQ==", "dev": true, "requires": { "@babel/runtime": "^7.18.9", @@ -7940,8 +8135,6 @@ }, "@isaacs/cliui": { "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, "requires": { "string-width": "^5.1.2", @@ -7954,26 +8147,18 @@ "dependencies": { "ansi-regex": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, "ansi-styles": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, "emoji-regex": { "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "string-width": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "requires": { "eastasianwidth": "^0.2.0", @@ -7983,8 +8168,6 @@ }, "strip-ansi": { "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "requires": { "ansi-regex": "^6.0.1" @@ -7992,8 +8175,6 @@ }, "wrap-ansi": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "requires": { "ansi-styles": "^6.1.0", @@ -8005,8 +8186,6 @@ }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", @@ -8018,8 +8197,6 @@ "dependencies": { "argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -8027,8 +8204,6 @@ }, "find-up": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { "locate-path": "^5.0.0", @@ -8037,8 +8212,6 @@ }, "js-yaml": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -8047,8 +8220,6 @@ }, "locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { "p-locate": "^4.1.0" @@ -8056,8 +8227,6 @@ }, "p-locate": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { "p-limit": "^2.2.0" @@ -8065,28 +8234,20 @@ }, "path-exists": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "resolve-from": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true } } }, "@istanbuljs/schema": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true }, "@jest/schemas": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz", - "integrity": "sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==", "dev": true, "requires": { "@sinclair/typebox": "^0.24.1" @@ -8094,8 +8255,6 @@ }, "@jest/transform": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-28.1.3.tgz", - "integrity": "sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA==", "dev": true, "requires": { "@babel/core": "^7.11.6", @@ -8117,8 +8276,6 @@ "dependencies": { "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" @@ -8126,8 +8283,6 @@ }, "chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -8136,8 +8291,6 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -8145,26 +8298,18 @@ }, "color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "slash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -8174,8 +8319,6 @@ }, "@jest/types": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz", - "integrity": "sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==", "dev": true, "requires": { "@jest/schemas": "^28.1.3", @@ -8188,8 +8331,6 @@ "dependencies": { "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" @@ -8197,8 +8338,6 @@ }, "chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -8207,8 +8346,6 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -8216,20 +8353,14 @@ }, "color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -8247,8 +8378,6 @@ }, "@jridgewell/resolve-uri": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true }, "@jridgewell/set-array": { @@ -8261,8 +8390,6 @@ }, "@jridgewell/trace-mapping": { "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz", - "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==", "dev": true, "requires": { "@jridgewell/resolve-uri": "3.1.0", @@ -8273,51 +8400,63 @@ "version": "7.1.3", "dev": true }, + "@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true + }, "@pkgjs/parseargs": { "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "optional": true }, "@protobufjs/aspromise": { - "version": "1.1.2" + "version": "1.1.2", + "dev": true }, "@protobufjs/base64": { - "version": "1.1.2" + "version": "1.1.2", + "dev": true }, "@protobufjs/codegen": { - "version": "2.0.4" + "version": "2.0.4", + "dev": true }, "@protobufjs/eventemitter": { - "version": "1.1.0" + "version": "1.1.0", + "dev": true }, "@protobufjs/fetch": { "version": "1.1.0", + "dev": true, "requires": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" } }, "@protobufjs/float": { - "version": "1.0.2" + "version": "1.0.2", + "dev": true }, "@protobufjs/inquire": { - "version": "1.1.0" + "version": "1.1.0", + "dev": true }, "@protobufjs/path": { - "version": "1.1.2" + "version": "1.1.2", + "dev": true }, "@protobufjs/pool": { - "version": "1.1.0" + "version": "1.1.0", + "dev": true }, "@protobufjs/utf8": { - "version": "1.1.0" + "version": "1.1.0", + "dev": true }, "@pyramation/json-schema-ref-parser": { "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@pyramation/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz", - "integrity": "sha512-L5kToHAEc1Q87R8ZwWFaNa4tPHr8Hnm+U+DRdUVq3tUtk+EX4pCqSd34Z6EMxNi/bjTzt1syAG9J2Oo1YFlqSg==", "dev": true, "requires": { "@jsdevtools/ono": "^7.1.3", @@ -8327,8 +8466,6 @@ "dependencies": { "argparse": { "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -8336,8 +8473,6 @@ }, "js-yaml": { "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -8348,8 +8483,6 @@ }, "@pyramation/json-schema-to-typescript": { "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@pyramation/json-schema-to-typescript/-/json-schema-to-typescript-11.0.4.tgz", - "integrity": "sha512-+aSzXDLhMHOEdV2cJ7Tjg/9YenjHU5BCmClVygzwxJZ1R16NOfEn7lTAwVzb/2jivOSnhjHzMJbnSf8b6rd1zg==", "dev": true, "requires": { "@pyramation/json-schema-ref-parser": "9.0.6", @@ -8370,8 +8503,6 @@ }, "@sinclair/typebox": { "version": "0.24.51", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz", - "integrity": "sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==", "dev": true }, "@tsconfig/node10": { @@ -8400,8 +8531,6 @@ }, "@types/graceful-fs": { "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", "dev": true, "requires": { "@types/node": "*" @@ -8409,14 +8538,10 @@ }, "@types/istanbul-lib-coverage": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", "dev": true }, "@types/istanbul-lib-report": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "*" @@ -8424,8 +8549,6 @@ }, "@types/istanbul-reports": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { "@types/istanbul-lib-report": "*" @@ -8440,7 +8563,8 @@ "dev": true }, "@types/long": { - "version": "4.0.2" + "version": "4.0.2", + "dev": true }, "@types/minimatch": { "version": "3.0.5", @@ -8448,8 +8572,7 @@ }, "@types/node": { "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + "dev": true }, "@types/parse-package-name": { "version": "0.1.0", @@ -8461,8 +8584,6 @@ }, "@types/yargs": { "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -8470,8 +8591,6 @@ }, "@types/yargs-parser": { "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "acorn": { @@ -8524,10 +8643,17 @@ "@babel/runtime": "^7.11.2" } }, + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dev": true, + "requires": { + "follow-redirects": "^1.14.0" + } + }, "babel-plugin-istanbul": { "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -8565,6 +8691,24 @@ "version": "1.0.2", "dev": true }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true + }, + "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==", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "dev": true, @@ -8580,6 +8724,12 @@ "fill-range": "^7.0.1" } }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, "browserslist": { "version": "4.21.4", "dev": true, @@ -8592,8 +8742,6 @@ }, "bser": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "dev": true, "requires": { "node-int64": "^0.4.0" @@ -8605,8 +8753,6 @@ }, "camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "caniuse-lite": { @@ -8632,8 +8778,6 @@ }, "ci-info": { "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true }, "cli-color": { @@ -8697,6 +8841,16 @@ "browserslist": "^4.21.4" } }, + "cosmjs-types": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.8.0.tgz", + "integrity": "sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==", + "dev": true, + "requires": { + "long": "^4.0.0", + "protobufjs": "~6.11.2" + } + }, "cosmwasm-typescript-gen": { "version": "0.3.9", "dev": true, @@ -9037,6 +9191,28 @@ "version": "4.2.2", "dev": true }, + "define-data-property": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, "diff": { "version": "4.0.2", "dev": true @@ -9047,14 +9223,35 @@ }, "eastasianwidth": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "electron-to-chromium": { "version": "1.4.284", "dev": true }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, "emoji-regex": { "version": "8.0.0", "dev": true @@ -9147,8 +9344,6 @@ }, "fb-watchman": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "requires": { "bser": "2.1.1" @@ -9168,10 +9363,14 @@ "to-regex-range": "^5.0.1" } }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true + }, "foreground-child": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -9180,8 +9379,6 @@ "dependencies": { "signal-exit": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", "dev": true } } @@ -9207,10 +9404,20 @@ "version": "1.0.0-beta.2", "dev": true }, + "get-intrinsic": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + } + }, "get-package-type": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, "get-stdin": { @@ -9240,10 +9447,26 @@ "version": "11.12.0", "dev": true }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "has": { @@ -9270,6 +9493,48 @@ "version": "3.0.0", "dev": true }, + "has-property-descriptors": { + "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" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true + }, + "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 + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, "husky": { "version": "8.0.1", "dev": true @@ -9458,16 +9723,19 @@ "version": "2.0.0", "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==", + "dev": true, + "requires": {} + }, "istanbul-lib-coverage": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "dev": true }, "istanbul-lib-instrument": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "requires": { "@babel/core": "^7.12.3", @@ -9479,8 +9747,6 @@ }, "jackspeak": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", - "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", "dev": true, "requires": { "@isaacs/cliui": "^8.0.2", @@ -9489,8 +9755,6 @@ }, "jest-haste-map": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-28.1.3.tgz", - "integrity": "sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA==", "dev": true, "requires": { "@jest/types": "^28.1.3", @@ -9509,14 +9773,10 @@ }, "jest-regex-util": { "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", - "integrity": "sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==", "dev": true }, "jest-util": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz", - "integrity": "sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==", "dev": true, "requires": { "@jest/types": "^28.1.3", @@ -9529,8 +9789,6 @@ "dependencies": { "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" @@ -9538,8 +9796,6 @@ }, "chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -9548,8 +9804,6 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -9557,20 +9811,14 @@ }, "color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -9580,8 +9828,6 @@ }, "jest-worker": { "version": "28.1.3", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-28.1.3.tgz", - "integrity": "sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==", "dev": true, "requires": { "@types/node": "*", @@ -9591,14 +9837,10 @@ "dependencies": { "has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -9608,8 +9850,6 @@ }, "js-tokens": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { @@ -9650,6 +9890,21 @@ "version": "2.2.3", "dev": true }, + "libsodium-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz", + "integrity": "sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==", + "dev": true + }, + "libsodium-wrappers-sumo": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz", + "integrity": "sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==", + "dev": true, + "requires": { + "libsodium-sumo": "^0.7.13" + } + }, "lodash": { "version": "4.17.21", "dev": true @@ -9659,7 +9914,8 @@ "dev": true }, "long": { - "version": "4.0.0" + "version": "4.0.0", + "dev": true }, "lru-cache": { "version": "5.1.1", @@ -9681,8 +9937,6 @@ }, "makeerror": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "dev": true, "requires": { "tmpl": "1.0.5" @@ -9704,8 +9958,6 @@ }, "merge-stream": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, "micromatch": { @@ -9720,6 +9972,18 @@ "version": "1.2.0", "dev": true }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, "minimatch": { "version": "3.1.2", "dev": true, @@ -9733,8 +9997,6 @@ }, "minipass": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", - "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==", "dev": true }, "mkdirp": { @@ -9764,8 +10026,6 @@ }, "node-int64": { "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true }, "node-releases": { @@ -9780,6 +10040,12 @@ "version": "4.1.1", "dev": true }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, "once": { "version": "1.4.0", "dev": true, @@ -9811,8 +10077,6 @@ }, "parse-package-name": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-package-name/-/parse-package-name-1.0.0.tgz", - "integrity": "sha512-kBeTUtcj+SkyfaW4+KBe0HtsloBJ/mKTPoxpVdA57GZiPerREsUWJOhVj9anXweFiJkm5y8FG1sxFZkZ0SN6wg==", "dev": true }, "path-is-absolute": { @@ -9829,8 +10093,6 @@ }, "path-scurry": { "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", "dev": true, "requires": { "lru-cache": "^9.1.1 || ^10.0.0", @@ -9839,8 +10101,6 @@ "dependencies": { "lru-cache": { "version": "9.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", - "integrity": "sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==", "dev": true } } @@ -9859,14 +10119,11 @@ }, "prettier": { "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true }, "protobufjs": { "version": "6.11.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", - "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", + "dev": true, "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -9883,6 +10140,12 @@ "long": "^4.0.0" } }, + "readonly-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readonly-date/-/readonly-date-1.0.0.tgz", + "integrity": "sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ==", + "dev": true + }, "rechoir": { "version": "0.6.2", "dev": true, @@ -9907,8 +10170,6 @@ }, "regenerator-transform": { "version": "0.15.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", - "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", "dev": true, "requires": { "@babel/runtime": "^7.8.4" @@ -9995,8 +10256,6 @@ }, "semver": { "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, "shebang-command": { @@ -10050,8 +10309,6 @@ }, "string-width-cjs": { "version": "npm:string-width@4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -10061,8 +10318,6 @@ "dependencies": { "is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true } } @@ -10076,8 +10331,6 @@ }, "strip-ansi-cjs": { "version": "npm:strip-ansi@6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { "ansi-regex": "^5.0.1" @@ -10094,10 +10347,14 @@ "version": "1.0.0", "dev": true }, + "symbol-observable": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-2.0.3.tgz", + "integrity": "sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==", + "dev": true + }, "test-exclude": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2", @@ -10140,8 +10397,6 @@ }, "tmpl": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", "dev": true }, "to-fast-properties": { @@ -10184,8 +10439,6 @@ }, "typescript": { "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "unicode-canonical-property-names-ecmascript": { @@ -10235,8 +10488,6 @@ }, "walker": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "dev": true, "requires": { "makeerror": "1.0.12" @@ -10271,8 +10522,6 @@ }, "wrap-ansi-cjs": { "version": "npm:wrap-ansi@7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -10282,8 +10531,6 @@ "dependencies": { "ansi-styles": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { "color-convert": "^2.0.1" @@ -10291,8 +10538,6 @@ }, "color-convert": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -10300,20 +10545,14 @@ }, "color-name": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -10329,14 +10568,29 @@ }, "write-file-atomic": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", - "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "requires": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" } }, + "ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "dev": true, + "requires": {} + }, + "xstream": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/xstream/-/xstream-11.14.0.tgz", + "integrity": "sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==", + "dev": true, + "requires": { + "globalthis": "^1.0.1", + "symbol-observable": "^2.0.3" + } + }, "yallist": { "version": "3.1.1", "dev": true diff --git a/package.json b/package.json index 1c159c0..42fb02a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "persistenceonejs", - "version": "2.2.0", + "version": "2.3.0-rc0", "description": "Client side JS libraries for persistenceSDK transaction generation, signing and broadcasting.", "main": "main/index.js", "module": "module/index.js", @@ -33,13 +33,14 @@ "url": "https://github.com/persistenceOne/persistenceJS/issues" }, "homepage": "https://github.com/persistenceOne/persistenceJS#readme", - "dependencies": { - "long": "^4.0.0", - "protobufjs": "~6.11.2" - }, + "dependencies": {}, "devDependencies": { + "@cosmjs/amino": "^0.31.1", + "@cosmjs/stargate": "^0.31.1", + "@cosmjs/proto-signing": "^0.31.1", + "@cosmjs/tendermint-rpc": "^0.31.1", + "@cosmjs/encoding": "^0.31.1", "@types/node": "^18.6.3", - "@types/long": "^4.0.1", "@cosmology/telescope": "^0.109.4", "cosmwasm-typescript-gen": "^0.3.9", "husky": "^8.0.1", diff --git a/proto/pstake/liquidstakeibc/v1beta1/msgs.proto b/proto/pstake/liquidstakeibc/v1beta1/msgs.proto index 8f6f626..49a4aca 100644 --- a/proto/pstake/liquidstakeibc/v1beta1/msgs.proto +++ b/proto/pstake/liquidstakeibc/v1beta1/msgs.proto @@ -6,6 +6,7 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; import "pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto"; import "pstake/liquidstakeibc/v1beta1/params.proto"; @@ -39,6 +40,8 @@ service Msg { message MsgRegisterHostChain { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/MsgRegisterHostChain"; // authority is the address of the governance account string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; @@ -81,18 +84,20 @@ message MsgRegisterHostChainResponse {} message MsgUpdateHostChain { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/MsgUpdateHostChain"; // authority is the address of the governance account string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string chain_id = 2; - repeated KVUpdate updates = 3; + repeated KVUpdate updates = 3 [(amino.dont_omitempty) = true]; } message MsgUpdateHostChainResponse {} message MsgLiquidStake { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgLiquidStake"; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; @@ -102,6 +107,7 @@ message MsgLiquidStakeResponse {} message MsgLiquidStakeLSM { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgLiquidStakeLSM"; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; repeated cosmos.base.v1beta1.Coin delegations = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" @@ -112,6 +118,7 @@ message MsgLiquidStakeLSMResponse {} message MsgLiquidUnstake { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgLiquidUnstake"; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; @@ -121,6 +128,7 @@ message MsgLiquidUnstakeResponse {} message MsgRedeem { option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "pstake/MsgRedeem"; string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; @@ -133,9 +141,10 @@ message MsgUpdateParams { option (gogoproto.goproto_getters) = false; option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "pstake/MsgUpdateParams"; string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - Params params = 2 [(gogoproto.nullable) = false]; + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } message MsgUpdateParamsResponse {} diff --git a/proto/pstake/liquidstakeibc/v1beta1/params.proto b/proto/pstake/liquidstakeibc/v1beta1/params.proto index b942527..782e3aa 100644 --- a/proto/pstake/liquidstakeibc/v1beta1/params.proto +++ b/proto/pstake/liquidstakeibc/v1beta1/params.proto @@ -3,11 +3,14 @@ package pstake.liquidstakeibc.v1beta1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstakeibc/types"; // Params defines the parameters for the module. message Params { + option (amino.name) = "pstake/x/liquidstakeibc/Params"; + string admin_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // protocol admin address diff --git a/scripts/prepare-publishing.sh b/scripts/prepare-publishing.sh index acad23f..9cf6e19 100755 --- a/scripts/prepare-publishing.sh +++ b/scripts/prepare-publishing.sh @@ -1,16 +1,33 @@ #!/bin/bash + set -o errexit -o nounset -o pipefail command -v shellcheck >/dev/null && shellcheck "$0" -DIRS="amino cosmos cosmos_proto cosmwasm gogoproto google ibc tendermint pstake persistence" -FILES="helpers.d.ts helpers.js helpers.js.map index.d.ts index.js index.js.map" +DIRS=(amino cosmos cosmos_proto cosmwasm gogoproto google ibc tendermint pstake persistence) +FILES=( + helpers.d.ts + helpers.js + helpers.js.map + index.d.ts + index.js + index.js.map + binary.d.ts + binary.js + binary.js.map + utf8.d.ts + utf8.js + utf8.js.map + varint.d.ts + varint.js + varint.js.map +) -for dir in $DIRS; do +for dir in "${DIRS[@]}"; do rm -rf "$dir" cp -R "./build/$dir" ./ done -for f in $FILES; do +for f in "${FILES[@]}"; do rm -rf "$f" cp "./build/$f" ./ -done \ No newline at end of file +done diff --git a/scripts/telescope.ts b/scripts/telescope.ts index 697a536..5cfd6c2 100644 --- a/scripts/telescope.ts +++ b/scripts/telescope.ts @@ -12,7 +12,22 @@ telescope({ logLevel: 0, useSDKTypes: false, tsDisable: { - disableAll: false + patterns: ["**/tx.registry.ts", "**/msgs.registry.ts"], + files: [ + "ibc/core/types/v1/genesis.ts", + "ibc/applications/interchain_accounts/genesis/v1/genesis.ts", + "cosmos/tx/signing/v1beta1/signing.ts", + "cosmos/staking/v1beta1/tx.ts", + "cosmos/staking/v1beta1/staking.ts", + + "cosmos/authz/v1beta1/tx.amino.ts", + "cosmos/staking/v1beta1/tx.amino.ts", + "cosmos/slashing/v1beta1/tx.amino.ts", + "cosmos/upgrade/v1beta1/tx.amino.ts", + + "cosmos/consensus/v1/tx.amino.ts", + "cosmos/gov/v1/tx.amino.ts" + ] }, eslintDisable: { disableAll: true @@ -54,13 +69,25 @@ telescope({ // There are users who need those functions. CosmJS does not need them directly. // See https://github.com/cosmos/cosmjs/pull/1329 fromJSON: true, - toJSON: true + toJSON: true, + fromPartial: true + + // encode: true, + // decode: true, + // toSDK: true, + // fromSDK: true, + // toAmino: true, + // fromAmino: true, + // fromProto: true, + // toProto: true }, typingsFormat: { - useDeepPartial: true, - useExact: true, + useDeepPartial: false, + useExact: false, timestamp: "timestamp", - duration: "duration" + duration: "duration", + num64: "bigint", + setDefaultCustomTypesToUndefined: false } }, lcdClients: { @@ -79,8 +106,12 @@ telescope({ "ABCIApplication" ] }, + stargateClients: { + enabled: false, + includeCosmosDefaultTypes: false + }, aminoEncoding: { - enabled: false + enabled: true } } }).then(() => { diff --git a/src/binary.ts b/src/binary.ts new file mode 100644 index 0000000..cd588cc --- /dev/null +++ b/src/binary.ts @@ -0,0 +1,498 @@ +/* eslint-disable */ +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@0.109.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// --- + +// Code generated by the command line utilities is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +import { utf8Length, utf8Read, utf8Write } from "./utf8"; +import { + int64ToString, + readInt32, + readUInt32, + uInt64ToString, + varint32read, + varint64read, + writeVarint32, + writeVarint64, + int64FromString, + int64Length, + writeFixed32, + writeByte, + zzDecode, + zzEncode, +} from "./varint"; + +export enum WireType { + Varint = 0, + + Fixed64 = 1, + + Bytes = 2, + + Fixed32 = 5, +} + +// Reader +export interface IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + tag(): [number, WireType, number]; + skip(length?: number): this; + skipType(wireType: number): this; + uint32(): number; + int32(): number; + sint32(): number; + fixed32(): number; + sfixed32(): number; + int64(): bigint; + uint64(): bigint; + sint64(): bigint; + fixed64(): bigint; + sfixed64(): bigint; + float(): number; + double(): number; + bool(): boolean; + bytes(): Uint8Array; + string(): string; +} + +export class BinaryReader implements IBinaryReader { + buf: Uint8Array; + pos: number; + type: number; + len: number; + + assertBounds(): void { + if (this.pos > this.len) throw new RangeError("premature EOF"); + } + + constructor(buf?: ArrayLike) { + this.buf = buf ? new Uint8Array(buf) : new Uint8Array(0); + this.pos = 0; + this.type = 0; + this.len = this.buf.length; + } + + tag(): [number, WireType, number] { + const tag = this.uint32(), + fieldNo = tag >>> 3, + wireType = tag & 7; + if (fieldNo <= 0 || wireType < 0 || wireType > 5) + throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType); + return [fieldNo, wireType, tag]; + } + + skip(length?: number) { + if (typeof length === "number") { + if (this.pos + length > this.len) throw indexOutOfRange(this, length); + this.pos += length; + } else { + do { + if (this.pos >= this.len) throw indexOutOfRange(this); + } while (this.buf[this.pos++] & 128); + } + return this; + } + + skipType(wireType: number) { + switch (wireType) { + case WireType.Varint: + this.skip(); + break; + case WireType.Fixed64: + this.skip(8); + break; + case WireType.Bytes: + this.skip(this.uint32()); + break; + case 3: + while ((wireType = this.uint32() & 7) !== 4) { + this.skipType(wireType); + } + break; + case WireType.Fixed32: + this.skip(4); + break; + + /* istanbul ignore next */ + default: + throw Error("invalid wire type " + wireType + " at offset " + this.pos); + } + return this; + } + + uint32(): number { + return varint32read.bind(this)(); + } + + int32(): number { + return this.uint32() | 0; + } + + sint32(): number { + const num = this.uint32(); + return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding + } + + fixed32(): number { + const val = readUInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + sfixed32(): number { + const val = readInt32(this.buf, this.pos); + this.pos += 4; + return val; + } + + int64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(int64ToString(lo, hi)); + } + + uint64(): bigint { + const [lo, hi] = varint64read.bind(this)(); + return BigInt(uInt64ToString(lo, hi)); + } + + sint64(): bigint { + let [lo, hi] = varint64read.bind(this)(); + // zig zag + [lo, hi] = zzDecode(lo, hi); + return BigInt(int64ToString(lo, hi)); + } + + fixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(uInt64ToString(lo, hi)); + } + sfixed64(): bigint { + const lo = this.sfixed32(); + const hi = this.sfixed32(); + return BigInt(int64ToString(lo, hi)); + } + + float(): number { + throw new Error("float not supported"); + } + + double(): number { + throw new Error("double not supported"); + } + + bool(): boolean { + const [lo, hi] = varint64read.bind(this)(); + return lo !== 0 || hi !== 0; + } + + bytes(): Uint8Array { + const len = this.uint32(), + start = this.pos; + this.pos += len; + this.assertBounds(); + return this.buf.subarray(start, start + len); + } + + string(): string { + const bytes = this.bytes(); + return utf8Read(bytes, 0, bytes.length); + } +} + +// Writer +export interface IBinaryWriter { + len: number; + head: IOp; + tail: IOp; + states: State | null; + finish(): Uint8Array; + fork(): IBinaryWriter; + reset(): IBinaryWriter; + ldelim(): IBinaryWriter; + tag(fieldNo: number, type: WireType): IBinaryWriter; + uint32(value: number): IBinaryWriter; + int32(value: number): IBinaryWriter; + sint32(value: number): IBinaryWriter; + int64(value: string | number | bigint): IBinaryWriter; + uint64: (value: string | number | bigint) => IBinaryWriter; + sint64(value: string | number | bigint): IBinaryWriter; + fixed64(value: string | number | bigint): IBinaryWriter; + sfixed64: (value: string | number | bigint) => IBinaryWriter; + bool(value: boolean): IBinaryWriter; + fixed32(value: number): IBinaryWriter; + sfixed32: (value: number) => IBinaryWriter; + float(value: number): IBinaryWriter; + double(value: number): IBinaryWriter; + bytes(value: Uint8Array): IBinaryWriter; + string(value: string): IBinaryWriter; +} + +interface IOp { + len: number; + next?: IOp; + proceed(buf: Uint8Array | number[], pos: number): void; +} + +class Op implements IOp { + fn?: ((val: T, buf: Uint8Array | number[], pos: number) => void) | null; + len: number; + val: T; + next?: IOp; + + constructor( + fn: ((val: T, buf: Uint8Array | number[], pos: number) => void | undefined | null) | null, + len: number, + val: T, + ) { + this.fn = fn; + this.len = len; + this.val = val; + } + + proceed(buf: Uint8Array | number[], pos: number) { + if (this.fn) { + this.fn(this.val, buf, pos); + } + } +} + +class State { + head: IOp; + tail: IOp; + len: number; + next: State | null; + + constructor(writer: BinaryWriter) { + this.head = writer.head; + this.tail = writer.tail; + this.len = writer.len; + this.next = writer.states; + } +} + +export class BinaryWriter implements IBinaryWriter { + len = 0; + head: IOp; + tail: IOp; + states: State | null; + + constructor() { + this.head = new Op(null, 0, 0); + this.tail = this.head; + this.states = null; + } + + static create() { + return new BinaryWriter(); + } + + static alloc(size: number): Uint8Array | number[] { + if (typeof Uint8Array !== "undefined") { + return pool((size) => new Uint8Array(size), Uint8Array.prototype.subarray)(size); + } else { + return new Array(size); + } + } + + private _push(fn: (val: T, buf: Uint8Array | number[], pos: number) => void, len: number, val: T) { + this.tail = this.tail.next = new Op(fn, len, val); + this.len += len; + return this; + } + + finish(): Uint8Array { + let head = this.head.next, + pos = 0; + const buf = BinaryWriter.alloc(this.len); + while (head) { + head.proceed(buf, pos); + pos += head.len; + head = head.next; + } + return buf as Uint8Array; + } + + fork(): BinaryWriter { + this.states = new State(this); + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + return this; + } + + reset(): BinaryWriter { + if (this.states) { + this.head = this.states.head; + this.tail = this.states.tail; + this.len = this.states.len; + this.states = this.states.next; + } else { + this.head = this.tail = new Op(null, 0, 0); + this.len = 0; + } + return this; + } + + ldelim(): BinaryWriter { + const head = this.head, + tail = this.tail, + len = this.len; + this.reset().uint32(len); + if (len) { + this.tail.next = head.next; // skip noop + this.tail = tail; + this.len += len; + } + return this; + } + + tag(fieldNo: number, type: WireType): BinaryWriter { + return this.uint32(((fieldNo << 3) | type) >>> 0); + } + + uint32(value: number): BinaryWriter { + this.len += (this.tail = this.tail.next = + new Op( + writeVarint32, + (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, + value, + )).len; + return this; + } + + int32(value: number): BinaryWriter { + return value < 0 + ? this._push(writeVarint64, 10, int64FromString(value.toString())) // 10 bytes per spec + : this.uint32(value); + } + + sint32(value: number): BinaryWriter { + return this.uint32(((value << 1) ^ (value >> 31)) >>> 0); + } + + int64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + // uint64 is the same with int64 + uint64 = BinaryWriter.prototype.int64; + + sint64(value: string | number | bigint): BinaryWriter { + let { lo, hi } = int64FromString(value.toString()); + // zig zag + [lo, hi] = zzEncode(lo, hi); + return this._push(writeVarint64, int64Length(lo, hi), { lo, hi }); + } + + fixed64(value: string | number | bigint): BinaryWriter { + const { lo, hi } = int64FromString(value.toString()); + return this._push(writeFixed32, 4, lo)._push(writeFixed32, 4, hi); + } + + // sfixed64 is the same with fixed64 + sfixed64 = BinaryWriter.prototype.fixed64; + + bool(value: boolean): BinaryWriter { + return this._push(writeByte, 1, value ? 1 : 0); + } + + fixed32(value: number): BinaryWriter { + return this._push(writeFixed32, 4, value >>> 0); + } + + // sfixed32 is the same with fixed32 + sfixed32 = BinaryWriter.prototype.fixed32; + + float(value: number): BinaryWriter { + throw new Error("float not supported" + value); + } + + double(value: number): BinaryWriter { + throw new Error("double not supported" + value); + } + + bytes(value: Uint8Array): BinaryWriter { + const len = value.length >>> 0; + if (!len) return this._push(writeByte, 1, 0); + return this.uint32(len)._push(writeBytes, len, value); + } + + string(value: string): BinaryWriter { + const len = utf8Length(value); + return len ? this.uint32(len)._push(utf8Write, len, value) : this._push(writeByte, 1, 0); + } +} + +function writeBytes(val: Uint8Array | number[], buf: Uint8Array | number[], pos: number) { + if (typeof Uint8Array !== "undefined") { + (buf as Uint8Array).set(val, pos); + } else { + for (let i = 0; i < val.length; ++i) buf[pos + i] = val[i]; + } +} + +function pool( + alloc: (size: number) => Uint8Array, + slice: (begin?: number, end?: number) => Uint8Array, + size?: number, +): (size: number) => Uint8Array { + const SIZE = size || 8192; + const MAX = SIZE >>> 1; + let slab: Uint8Array | null = null; + let offset = SIZE; + return function pool_alloc(size): Uint8Array { + if (size < 1 || size > MAX) return alloc(size); + if (offset + size > SIZE) { + slab = alloc(SIZE); + offset = 0; + } + const buf: Uint8Array = slice.call(slab, offset, (offset += size)); + if (offset & 7) + // align to 32 bit + offset = (offset | 7) + 1; + return buf; + }; +} + +function indexOutOfRange(reader: BinaryReader, writeLength?: number) { + return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); +} diff --git a/src/cosmos/app/runtime/v1alpha1/module.ts b/src/cosmos/app/runtime/v1alpha1/module.ts index 9181fcb..4de0d3b 100644 --- a/src/cosmos/app/runtime/v1alpha1/module.ts +++ b/src/cosmos/app/runtime/v1alpha1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.app.runtime.v1alpha1"; /** Module is the config object for the runtime module. */ export interface Module { @@ -57,7 +57,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.appName !== "") { writer.uint32(10).string(message.appName); } @@ -78,8 +78,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -155,7 +155,7 @@ export const Module = { } return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.appName = object.appName ?? ""; message.beginBlockers = object.beginBlockers?.map((e) => e) || []; @@ -173,7 +173,7 @@ function createBaseStoreKeyConfig(): StoreKeyConfig { }; } export const StoreKeyConfig = { - encode(message: StoreKeyConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StoreKeyConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moduleName !== "") { writer.uint32(10).string(message.moduleName); } @@ -182,8 +182,8 @@ export const StoreKeyConfig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreKeyConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreKeyConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreKeyConfig(); while (reader.pos < end) { @@ -214,7 +214,7 @@ export const StoreKeyConfig = { message.kvStoreKey !== undefined && (obj.kvStoreKey = message.kvStoreKey); return obj; }, - fromPartial, I>>(object: I): StoreKeyConfig { + fromPartial(object: Partial): StoreKeyConfig { const message = createBaseStoreKeyConfig(); message.moduleName = object.moduleName ?? ""; message.kvStoreKey = object.kvStoreKey ?? ""; diff --git a/src/cosmos/app/v1alpha1/config.ts b/src/cosmos/app/v1alpha1/config.ts index 8721481..2e74bb8 100644 --- a/src/cosmos/app/v1alpha1/config.ts +++ b/src/cosmos/app/v1alpha1/config.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.app.v1alpha1"; /** * Config represents the configuration for a Cosmos SDK ABCI app. @@ -63,7 +63,7 @@ function createBaseConfig(): Config { }; } export const Config = { - encode(message: Config, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.modules) { ModuleConfig.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -72,8 +72,8 @@ export const Config = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Config { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfig(); while (reader.pos < end) { @@ -114,7 +114,7 @@ export const Config = { } return obj; }, - fromPartial, I>>(object: I): Config { + fromPartial(object: Partial): Config { const message = createBaseConfig(); message.modules = object.modules?.map((e) => ModuleConfig.fromPartial(e)) || []; message.golangBindings = object.golangBindings?.map((e) => GolangBinding.fromPartial(e)) || []; @@ -129,7 +129,7 @@ function createBaseModuleConfig(): ModuleConfig { }; } export const ModuleConfig = { - encode(message: ModuleConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -141,8 +141,8 @@ export const ModuleConfig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleConfig(); while (reader.pos < end) { @@ -183,7 +183,7 @@ export const ModuleConfig = { } return obj; }, - fromPartial, I>>(object: I): ModuleConfig { + fromPartial(object: Partial): ModuleConfig { const message = createBaseModuleConfig(); message.name = object.name ?? ""; if (object.config !== undefined && object.config !== null) { @@ -200,7 +200,7 @@ function createBaseGolangBinding(): GolangBinding { }; } export const GolangBinding = { - encode(message: GolangBinding, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GolangBinding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.interfaceType !== "") { writer.uint32(10).string(message.interfaceType); } @@ -209,8 +209,8 @@ export const GolangBinding = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GolangBinding { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GolangBinding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGolangBinding(); while (reader.pos < end) { @@ -241,7 +241,7 @@ export const GolangBinding = { message.implementation !== undefined && (obj.implementation = message.implementation); return obj; }, - fromPartial, I>>(object: I): GolangBinding { + fromPartial(object: Partial): GolangBinding { const message = createBaseGolangBinding(); message.interfaceType = object.interfaceType ?? ""; message.implementation = object.implementation ?? ""; diff --git a/src/cosmos/app/v1alpha1/module.ts b/src/cosmos/app/v1alpha1/module.ts index c1ce2d6..77107b9 100644 --- a/src/cosmos/app/v1alpha1/module.ts +++ b/src/cosmos/app/v1alpha1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.app.v1alpha1"; /** ModuleDescriptor describes an app module. */ export interface ModuleDescriptor { @@ -90,7 +90,7 @@ function createBaseModuleDescriptor(): ModuleDescriptor { }; } export const ModuleDescriptor = { - encode(message: ModuleDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.goImport !== "") { writer.uint32(10).string(message.goImport); } @@ -102,8 +102,8 @@ export const ModuleDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleDescriptor(); while (reader.pos < end) { @@ -149,7 +149,7 @@ export const ModuleDescriptor = { } return obj; }, - fromPartial, I>>(object: I): ModuleDescriptor { + fromPartial(object: Partial): ModuleDescriptor { const message = createBaseModuleDescriptor(); message.goImport = object.goImport ?? ""; message.usePackage = object.usePackage?.map((e) => PackageReference.fromPartial(e)) || []; @@ -164,7 +164,7 @@ function createBasePackageReference(): PackageReference { }; } export const PackageReference = { - encode(message: PackageReference, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PackageReference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -173,8 +173,8 @@ export const PackageReference = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PackageReference { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePackageReference(); while (reader.pos < end) { @@ -205,7 +205,7 @@ export const PackageReference = { message.revision !== undefined && (obj.revision = Math.round(message.revision)); return obj; }, - fromPartial, I>>(object: I): PackageReference { + fromPartial(object: Partial): PackageReference { const message = createBasePackageReference(); message.name = object.name ?? ""; message.revision = object.revision ?? 0; @@ -218,14 +218,14 @@ function createBaseMigrateFromInfo(): MigrateFromInfo { }; } export const MigrateFromInfo = { - encode(message: MigrateFromInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MigrateFromInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.module !== "") { writer.uint32(10).string(message.module); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MigrateFromInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMigrateFromInfo(); while (reader.pos < end) { @@ -251,7 +251,7 @@ export const MigrateFromInfo = { message.module !== undefined && (obj.module = message.module); return obj; }, - fromPartial, I>>(object: I): MigrateFromInfo { + fromPartial(object: Partial): MigrateFromInfo { const message = createBaseMigrateFromInfo(); message.module = object.module ?? ""; return message; diff --git a/src/cosmos/app/v1alpha1/query.ts b/src/cosmos/app/v1alpha1/query.ts index 3d4c5cc..e78e879 100644 --- a/src/cosmos/app/v1alpha1/query.ts +++ b/src/cosmos/app/v1alpha1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Config } from "./config"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.app.v1alpha1"; /** QueryConfigRequest is the Query/Config request type. */ export interface QueryConfigRequest {} @@ -14,11 +14,11 @@ function createBaseQueryConfigRequest(): QueryConfigRequest { return {}; } export const QueryConfigRequest = { - encode(_: QueryConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConfigRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConfigRequest(); while (reader.pos < end) { @@ -39,7 +39,7 @@ export const QueryConfigRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryConfigRequest { + fromPartial(_: Partial): QueryConfigRequest { const message = createBaseQueryConfigRequest(); return message; }, @@ -50,14 +50,14 @@ function createBaseQueryConfigResponse(): QueryConfigResponse { }; } export const QueryConfigResponse = { - encode(message: QueryConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.config !== undefined) { Config.encode(message.config, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConfigResponse(); while (reader.pos < end) { @@ -83,7 +83,7 @@ export const QueryConfigResponse = { message.config !== undefined && (obj.config = message.config ? Config.toJSON(message.config) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryConfigResponse { + fromPartial(object: Partial): QueryConfigResponse { const message = createBaseQueryConfigResponse(); if (object.config !== undefined && object.config !== null) { message.config = Config.fromPartial(object.config); @@ -105,6 +105,6 @@ export class QueryClientImpl implements Query { Config(request: QueryConfigRequest = {}): Promise { const data = QueryConfigRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.app.v1alpha1.Query", "Config", data); - return promise.then((data) => QueryConfigResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConfigResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/auth/module/v1/module.ts b/src/cosmos/auth/module/v1/module.ts index 57adfb7..c274826 100644 --- a/src/cosmos/auth/module/v1/module.ts +++ b/src/cosmos/auth/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.auth.module.v1"; /** Module is the config object for the auth module. */ export interface Module { @@ -29,7 +29,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bech32Prefix !== "") { writer.uint32(10).string(message.bech32Prefix); } @@ -41,8 +41,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -87,7 +87,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.bech32Prefix = object.bech32Prefix ?? ""; message.moduleAccountPermissions = @@ -103,7 +103,7 @@ function createBaseModuleAccountPermission(): ModuleAccountPermission { }; } export const ModuleAccountPermission = { - encode(message: ModuleAccountPermission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleAccountPermission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== "") { writer.uint32(10).string(message.account); } @@ -112,8 +112,8 @@ export const ModuleAccountPermission = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccountPermission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccountPermission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleAccountPermission(); while (reader.pos < end) { @@ -148,7 +148,7 @@ export const ModuleAccountPermission = { } return obj; }, - fromPartial, I>>(object: I): ModuleAccountPermission { + fromPartial(object: Partial): ModuleAccountPermission { const message = createBaseModuleAccountPermission(); message.account = object.account ?? ""; message.permissions = object.permissions?.map((e) => e) || []; diff --git a/src/cosmos/auth/v1beta1/auth.ts b/src/cosmos/auth/v1beta1/auth.ts index 7e59831..8a80604 100644 --- a/src/cosmos/auth/v1beta1/auth.ts +++ b/src/cosmos/auth/v1beta1/auth.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.auth.v1beta1"; /** * BaseAccount defines a base account type. It contains all the necessary fields @@ -11,8 +11,8 @@ export const protobufPackage = "cosmos.auth.v1beta1"; export interface BaseAccount { address: string; pubKey: Any; - accountNumber: Long; - sequence: Long; + accountNumber: bigint; + sequence: bigint; } /** ModuleAccount defines an account for modules that holds coins on a pool. */ export interface ModuleAccount { @@ -36,38 +36,38 @@ export interface ModuleCredential { } /** Params defines the parameters for the auth module. */ export interface Params { - maxMemoCharacters: Long; - txSigLimit: Long; - txSizeCostPerByte: Long; - sigVerifyCostEd25519: Long; - sigVerifyCostSecp256k1: Long; + maxMemoCharacters: bigint; + txSigLimit: bigint; + txSizeCostPerByte: bigint; + sigVerifyCostEd25519: bigint; + sigVerifyCostSecp256k1: bigint; } function createBaseBaseAccount(): BaseAccount { return { address: "", pubKey: Any.fromPartial({}), - accountNumber: Long.UZERO, - sequence: Long.UZERO, + accountNumber: BigInt(0), + sequence: BigInt(0), }; } export const BaseAccount = { - encode(message: BaseAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BaseAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pubKey !== undefined) { Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (!message.accountNumber.isZero()) { + if (message.accountNumber !== BigInt(0)) { writer.uint32(24).uint64(message.accountNumber); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(32).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BaseAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BaseAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBaseAccount(); while (reader.pos < end) { @@ -80,10 +80,10 @@ export const BaseAccount = { message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.accountNumber = reader.uint64() as Long; + message.accountNumber = reader.uint64(); break; case 4: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -96,8 +96,8 @@ export const BaseAccount = { const obj = createBaseBaseAccount(); if (isSet(object.address)) obj.address = String(object.address); if (isSet(object.pubKey)) obj.pubKey = Any.fromJSON(object.pubKey); - if (isSet(object.accountNumber)) obj.accountNumber = Long.fromValue(object.accountNumber); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.accountNumber)) obj.accountNumber = BigInt(object.accountNumber.toString()); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: BaseAccount): unknown { @@ -105,21 +105,21 @@ export const BaseAccount = { message.address !== undefined && (obj.address = message.address); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); message.accountNumber !== undefined && - (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): BaseAccount { + fromPartial(object: Partial): BaseAccount { const message = createBaseBaseAccount(); message.address = object.address ?? ""; if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = Any.fromPartial(object.pubKey); } if (object.accountNumber !== undefined && object.accountNumber !== null) { - message.accountNumber = Long.fromValue(object.accountNumber); + message.accountNumber = BigInt(object.accountNumber.toString()); } if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -132,7 +132,7 @@ function createBaseModuleAccount(): ModuleAccount { }; } export const ModuleAccount = { - encode(message: ModuleAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } @@ -144,8 +144,8 @@ export const ModuleAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleAccount(); while (reader.pos < end) { @@ -186,7 +186,7 @@ export const ModuleAccount = { } return obj; }, - fromPartial, I>>(object: I): ModuleAccount { + fromPartial(object: Partial): ModuleAccount { const message = createBaseModuleAccount(); if (object.baseAccount !== undefined && object.baseAccount !== null) { message.baseAccount = BaseAccount.fromPartial(object.baseAccount); @@ -203,7 +203,7 @@ function createBaseModuleCredential(): ModuleCredential { }; } export const ModuleCredential = { - encode(message: ModuleCredential, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleCredential, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moduleName !== "") { writer.uint32(10).string(message.moduleName); } @@ -212,8 +212,8 @@ export const ModuleCredential = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleCredential { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleCredential { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleCredential(); while (reader.pos < end) { @@ -251,7 +251,7 @@ export const ModuleCredential = { } return obj; }, - fromPartial, I>>(object: I): ModuleCredential { + fromPartial(object: Partial): ModuleCredential { const message = createBaseModuleCredential(); message.moduleName = object.moduleName ?? ""; message.derivationKeys = object.derivationKeys?.map((e) => e) || []; @@ -260,53 +260,53 @@ export const ModuleCredential = { }; function createBaseParams(): Params { return { - maxMemoCharacters: Long.UZERO, - txSigLimit: Long.UZERO, - txSizeCostPerByte: Long.UZERO, - sigVerifyCostEd25519: Long.UZERO, - sigVerifyCostSecp256k1: Long.UZERO, + maxMemoCharacters: BigInt(0), + txSigLimit: BigInt(0), + txSizeCostPerByte: BigInt(0), + sigVerifyCostEd25519: BigInt(0), + sigVerifyCostSecp256k1: BigInt(0), }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxMemoCharacters.isZero()) { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxMemoCharacters !== BigInt(0)) { writer.uint32(8).uint64(message.maxMemoCharacters); } - if (!message.txSigLimit.isZero()) { + if (message.txSigLimit !== BigInt(0)) { writer.uint32(16).uint64(message.txSigLimit); } - if (!message.txSizeCostPerByte.isZero()) { + if (message.txSizeCostPerByte !== BigInt(0)) { writer.uint32(24).uint64(message.txSizeCostPerByte); } - if (!message.sigVerifyCostEd25519.isZero()) { + if (message.sigVerifyCostEd25519 !== BigInt(0)) { writer.uint32(32).uint64(message.sigVerifyCostEd25519); } - if (!message.sigVerifyCostSecp256k1.isZero()) { + if (message.sigVerifyCostSecp256k1 !== BigInt(0)) { writer.uint32(40).uint64(message.sigVerifyCostSecp256k1); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxMemoCharacters = reader.uint64() as Long; + message.maxMemoCharacters = reader.uint64(); break; case 2: - message.txSigLimit = reader.uint64() as Long; + message.txSigLimit = reader.uint64(); break; case 3: - message.txSizeCostPerByte = reader.uint64() as Long; + message.txSizeCostPerByte = reader.uint64(); break; case 4: - message.sigVerifyCostEd25519 = reader.uint64() as Long; + message.sigVerifyCostEd25519 = reader.uint64(); break; case 5: - message.sigVerifyCostSecp256k1 = reader.uint64() as Long; + message.sigVerifyCostSecp256k1 = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -317,44 +317,44 @@ export const Params = { }, fromJSON(object: any): Params { const obj = createBaseParams(); - if (isSet(object.maxMemoCharacters)) obj.maxMemoCharacters = Long.fromValue(object.maxMemoCharacters); - if (isSet(object.txSigLimit)) obj.txSigLimit = Long.fromValue(object.txSigLimit); - if (isSet(object.txSizeCostPerByte)) obj.txSizeCostPerByte = Long.fromValue(object.txSizeCostPerByte); + if (isSet(object.maxMemoCharacters)) obj.maxMemoCharacters = BigInt(object.maxMemoCharacters.toString()); + if (isSet(object.txSigLimit)) obj.txSigLimit = BigInt(object.txSigLimit.toString()); + if (isSet(object.txSizeCostPerByte)) obj.txSizeCostPerByte = BigInt(object.txSizeCostPerByte.toString()); if (isSet(object.sigVerifyCostEd25519)) - obj.sigVerifyCostEd25519 = Long.fromValue(object.sigVerifyCostEd25519); + obj.sigVerifyCostEd25519 = BigInt(object.sigVerifyCostEd25519.toString()); if (isSet(object.sigVerifyCostSecp256k1)) - obj.sigVerifyCostSecp256k1 = Long.fromValue(object.sigVerifyCostSecp256k1); + obj.sigVerifyCostSecp256k1 = BigInt(object.sigVerifyCostSecp256k1.toString()); return obj; }, toJSON(message: Params): unknown { const obj: any = {}; message.maxMemoCharacters !== undefined && - (obj.maxMemoCharacters = (message.maxMemoCharacters || Long.UZERO).toString()); - message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || Long.UZERO).toString()); + (obj.maxMemoCharacters = (message.maxMemoCharacters || BigInt(0)).toString()); + message.txSigLimit !== undefined && (obj.txSigLimit = (message.txSigLimit || BigInt(0)).toString()); message.txSizeCostPerByte !== undefined && - (obj.txSizeCostPerByte = (message.txSizeCostPerByte || Long.UZERO).toString()); + (obj.txSizeCostPerByte = (message.txSizeCostPerByte || BigInt(0)).toString()); message.sigVerifyCostEd25519 !== undefined && - (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || Long.UZERO).toString()); + (obj.sigVerifyCostEd25519 = (message.sigVerifyCostEd25519 || BigInt(0)).toString()); message.sigVerifyCostSecp256k1 !== undefined && - (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || Long.UZERO).toString()); + (obj.sigVerifyCostSecp256k1 = (message.sigVerifyCostSecp256k1 || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); if (object.maxMemoCharacters !== undefined && object.maxMemoCharacters !== null) { - message.maxMemoCharacters = Long.fromValue(object.maxMemoCharacters); + message.maxMemoCharacters = BigInt(object.maxMemoCharacters.toString()); } if (object.txSigLimit !== undefined && object.txSigLimit !== null) { - message.txSigLimit = Long.fromValue(object.txSigLimit); + message.txSigLimit = BigInt(object.txSigLimit.toString()); } if (object.txSizeCostPerByte !== undefined && object.txSizeCostPerByte !== null) { - message.txSizeCostPerByte = Long.fromValue(object.txSizeCostPerByte); + message.txSizeCostPerByte = BigInt(object.txSizeCostPerByte.toString()); } if (object.sigVerifyCostEd25519 !== undefined && object.sigVerifyCostEd25519 !== null) { - message.sigVerifyCostEd25519 = Long.fromValue(object.sigVerifyCostEd25519); + message.sigVerifyCostEd25519 = BigInt(object.sigVerifyCostEd25519.toString()); } if (object.sigVerifyCostSecp256k1 !== undefined && object.sigVerifyCostSecp256k1 !== null) { - message.sigVerifyCostSecp256k1 = Long.fromValue(object.sigVerifyCostSecp256k1); + message.sigVerifyCostSecp256k1 = BigInt(object.sigVerifyCostSecp256k1.toString()); } return message; }, diff --git a/src/cosmos/auth/v1beta1/genesis.ts b/src/cosmos/auth/v1beta1/genesis.ts index 81a6a5f..c089522 100644 --- a/src/cosmos/auth/v1beta1/genesis.ts +++ b/src/cosmos/auth/v1beta1/genesis.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Params } from "./auth"; import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.auth.v1beta1"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { @@ -18,7 +18,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -27,8 +27,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -63,7 +63,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); diff --git a/src/cosmos/auth/v1beta1/query.ts b/src/cosmos/auth/v1beta1/query.ts index 7496220..aec2a79 100644 --- a/src/cosmos/auth/v1beta1/query.ts +++ b/src/cosmos/auth/v1beta1/query.ts @@ -2,8 +2,8 @@ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { Any } from "../../../google/protobuf/any"; import { Params, BaseAccount } from "./auth"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.auth.v1beta1"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. @@ -124,13 +124,13 @@ export interface QueryAccountAddressByIDRequest { * updated to uint64 in a future version of the auth query. */ /** @deprecated */ - id: Long; + id: bigint; /** * account_id is the account number of the address to be queried. * * Since: cosmos-sdk 0.47 */ - accountId: Long; + accountId: bigint; } /** * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method @@ -164,14 +164,14 @@ function createBaseQueryAccountsRequest(): QueryAccountsRequest { }; } export const QueryAccountsRequest = { - encode(message: QueryAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountsRequest(); while (reader.pos < end) { @@ -198,7 +198,7 @@ export const QueryAccountsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAccountsRequest { + fromPartial(object: Partial): QueryAccountsRequest { const message = createBaseQueryAccountsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -213,7 +213,7 @@ function createBaseQueryAccountsResponse(): QueryAccountsResponse { }; } export const QueryAccountsResponse = { - encode(message: QueryAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -222,8 +222,8 @@ export const QueryAccountsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountsResponse(); while (reader.pos < end) { @@ -259,7 +259,7 @@ export const QueryAccountsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAccountsResponse { + fromPartial(object: Partial): QueryAccountsResponse { const message = createBaseQueryAccountsResponse(); message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -274,14 +274,14 @@ function createBaseQueryAccountRequest(): QueryAccountRequest { }; } export const QueryAccountRequest = { - encode(message: QueryAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountRequest(); while (reader.pos < end) { @@ -307,7 +307,7 @@ export const QueryAccountRequest = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): QueryAccountRequest { + fromPartial(object: Partial): QueryAccountRequest { const message = createBaseQueryAccountRequest(); message.address = object.address ?? ""; return message; @@ -319,14 +319,14 @@ function createBaseQueryAccountResponse(): QueryAccountResponse { }; } export const QueryAccountResponse = { - encode(message: QueryAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.account !== undefined) { Any.encode(message.account, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountResponse(); while (reader.pos < end) { @@ -353,7 +353,7 @@ export const QueryAccountResponse = { (obj.account = message.account ? Any.toJSON(message.account) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAccountResponse { + fromPartial(object: Partial): QueryAccountResponse { const message = createBaseQueryAccountResponse(); if (object.account !== undefined && object.account !== null) { message.account = Any.fromPartial(object.account); @@ -365,11 +365,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -390,7 +390,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -401,14 +401,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -434,7 +434,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -446,11 +446,11 @@ function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { return {}; } export const QueryModuleAccountsRequest = { - encode(_: QueryModuleAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountsRequest(); while (reader.pos < end) { @@ -471,7 +471,7 @@ export const QueryModuleAccountsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryModuleAccountsRequest { + fromPartial(_: Partial): QueryModuleAccountsRequest { const message = createBaseQueryModuleAccountsRequest(); return message; }, @@ -482,14 +482,14 @@ function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { }; } export const QueryModuleAccountsResponse = { - encode(message: QueryModuleAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.accounts) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountsResponse(); while (reader.pos < end) { @@ -519,9 +519,7 @@ export const QueryModuleAccountsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryModuleAccountsResponse { + fromPartial(object: Partial): QueryModuleAccountsResponse { const message = createBaseQueryModuleAccountsResponse(); message.accounts = object.accounts?.map((e) => Any.fromPartial(e)) || []; return message; @@ -533,14 +531,17 @@ function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRe }; } export const QueryModuleAccountByNameRequest = { - encode(message: QueryModuleAccountByNameRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleAccountByNameRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountByNameRequest(); while (reader.pos < end) { @@ -566,9 +567,7 @@ export const QueryModuleAccountByNameRequest = { message.name !== undefined && (obj.name = message.name); return obj; }, - fromPartial, I>>( - object: I, - ): QueryModuleAccountByNameRequest { + fromPartial(object: Partial): QueryModuleAccountByNameRequest { const message = createBaseQueryModuleAccountByNameRequest(); message.name = object.name ?? ""; return message; @@ -580,14 +579,17 @@ function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameR }; } export const QueryModuleAccountByNameResponse = { - encode(message: QueryModuleAccountByNameResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryModuleAccountByNameResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.account !== undefined) { Any.encode(message.account, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleAccountByNameResponse(); while (reader.pos < end) { @@ -614,9 +616,7 @@ export const QueryModuleAccountByNameResponse = { (obj.account = message.account ? Any.toJSON(message.account) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryModuleAccountByNameResponse { + fromPartial(object: Partial): QueryModuleAccountByNameResponse { const message = createBaseQueryModuleAccountByNameResponse(); if (object.account !== undefined && object.account !== null) { message.account = Any.fromPartial(object.account); @@ -628,11 +628,11 @@ function createBaseBech32PrefixRequest(): Bech32PrefixRequest { return {}; } export const Bech32PrefixRequest = { - encode(_: Bech32PrefixRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Bech32PrefixRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Bech32PrefixRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBech32PrefixRequest(); while (reader.pos < end) { @@ -653,7 +653,7 @@ export const Bech32PrefixRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Bech32PrefixRequest { + fromPartial(_: Partial): Bech32PrefixRequest { const message = createBaseBech32PrefixRequest(); return message; }, @@ -664,14 +664,14 @@ function createBaseBech32PrefixResponse(): Bech32PrefixResponse { }; } export const Bech32PrefixResponse = { - encode(message: Bech32PrefixResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Bech32PrefixResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bech32Prefix !== "") { writer.uint32(10).string(message.bech32Prefix); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Bech32PrefixResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBech32PrefixResponse(); while (reader.pos < end) { @@ -697,7 +697,7 @@ export const Bech32PrefixResponse = { message.bech32Prefix !== undefined && (obj.bech32Prefix = message.bech32Prefix); return obj; }, - fromPartial, I>>(object: I): Bech32PrefixResponse { + fromPartial(object: Partial): Bech32PrefixResponse { const message = createBaseBech32PrefixResponse(); message.bech32Prefix = object.bech32Prefix ?? ""; return message; @@ -709,14 +709,14 @@ function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { }; } export const AddressBytesToStringRequest = { - encode(message: AddressBytesToStringRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AddressBytesToStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressBytes.length !== 0) { writer.uint32(10).bytes(message.addressBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressBytesToStringRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressBytesToStringRequest(); while (reader.pos < end) { @@ -745,9 +745,7 @@ export const AddressBytesToStringRequest = { )); return obj; }, - fromPartial, I>>( - object: I, - ): AddressBytesToStringRequest { + fromPartial(object: Partial): AddressBytesToStringRequest { const message = createBaseAddressBytesToStringRequest(); message.addressBytes = object.addressBytes ?? new Uint8Array(); return message; @@ -759,14 +757,14 @@ function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse }; } export const AddressBytesToStringResponse = { - encode(message: AddressBytesToStringResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AddressBytesToStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressString !== "") { writer.uint32(10).string(message.addressString); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressBytesToStringResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressBytesToStringResponse(); while (reader.pos < end) { @@ -792,9 +790,7 @@ export const AddressBytesToStringResponse = { message.addressString !== undefined && (obj.addressString = message.addressString); return obj; }, - fromPartial, I>>( - object: I, - ): AddressBytesToStringResponse { + fromPartial(object: Partial): AddressBytesToStringResponse { const message = createBaseAddressBytesToStringResponse(); message.addressString = object.addressString ?? ""; return message; @@ -806,14 +802,14 @@ function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { }; } export const AddressStringToBytesRequest = { - encode(message: AddressStringToBytesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AddressStringToBytesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressString !== "") { writer.uint32(10).string(message.addressString); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressStringToBytesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressStringToBytesRequest(); while (reader.pos < end) { @@ -839,9 +835,7 @@ export const AddressStringToBytesRequest = { message.addressString !== undefined && (obj.addressString = message.addressString); return obj; }, - fromPartial, I>>( - object: I, - ): AddressStringToBytesRequest { + fromPartial(object: Partial): AddressStringToBytesRequest { const message = createBaseAddressStringToBytesRequest(); message.addressString = object.addressString ?? ""; return message; @@ -853,14 +847,14 @@ function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse }; } export const AddressStringToBytesResponse = { - encode(message: AddressStringToBytesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AddressStringToBytesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.addressBytes.length !== 0) { writer.uint32(10).bytes(message.addressBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AddressStringToBytesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAddressStringToBytesResponse(); while (reader.pos < end) { @@ -889,9 +883,7 @@ export const AddressStringToBytesResponse = { )); return obj; }, - fromPartial, I>>( - object: I, - ): AddressStringToBytesResponse { + fromPartial(object: Partial): AddressStringToBytesResponse { const message = createBaseAddressStringToBytesResponse(); message.addressBytes = object.addressBytes ?? new Uint8Array(); return message; @@ -899,32 +891,35 @@ export const AddressStringToBytesResponse = { }; function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { return { - id: Long.ZERO, - accountId: Long.UZERO, + id: BigInt(0), + accountId: BigInt(0), }; } export const QueryAccountAddressByIDRequest = { - encode(message: QueryAccountAddressByIDRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + encode( + message: QueryAccountAddressByIDRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).int64(message.id); } - if (!message.accountId.isZero()) { + if (message.accountId !== BigInt(0)) { writer.uint32(16).uint64(message.accountId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountAddressByIDRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.int64() as Long; + message.id = reader.int64(); break; case 2: - message.accountId = reader.uint64() as Long; + message.accountId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -935,25 +930,23 @@ export const QueryAccountAddressByIDRequest = { }, fromJSON(object: any): QueryAccountAddressByIDRequest { const obj = createBaseQueryAccountAddressByIDRequest(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); - if (isSet(object.accountId)) obj.accountId = Long.fromValue(object.accountId); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); + if (isSet(object.accountId)) obj.accountId = BigInt(object.accountId.toString()); return obj; }, toJSON(message: QueryAccountAddressByIDRequest): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.ZERO).toString()); - message.accountId !== undefined && (obj.accountId = (message.accountId || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); + message.accountId !== undefined && (obj.accountId = (message.accountId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAccountAddressByIDRequest { + fromPartial(object: Partial): QueryAccountAddressByIDRequest { const message = createBaseQueryAccountAddressByIDRequest(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } if (object.accountId !== undefined && object.accountId !== null) { - message.accountId = Long.fromValue(object.accountId); + message.accountId = BigInt(object.accountId.toString()); } return message; }, @@ -964,14 +957,17 @@ function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDRes }; } export const QueryAccountAddressByIDResponse = { - encode(message: QueryAccountAddressByIDResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAccountAddressByIDResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.accountAddress !== "") { writer.uint32(10).string(message.accountAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountAddressByIDResponse(); while (reader.pos < end) { @@ -997,9 +993,7 @@ export const QueryAccountAddressByIDResponse = { message.accountAddress !== undefined && (obj.accountAddress = message.accountAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAccountAddressByIDResponse { + fromPartial(object: Partial): QueryAccountAddressByIDResponse { const message = createBaseQueryAccountAddressByIDResponse(); message.accountAddress = object.accountAddress ?? ""; return message; @@ -1011,14 +1005,14 @@ function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { }; } export const QueryAccountInfoRequest = { - encode(message: QueryAccountInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAccountInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountInfoRequest(); while (reader.pos < end) { @@ -1044,7 +1038,7 @@ export const QueryAccountInfoRequest = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): QueryAccountInfoRequest { + fromPartial(object: Partial): QueryAccountInfoRequest { const message = createBaseQueryAccountInfoRequest(); message.address = object.address ?? ""; return message; @@ -1056,14 +1050,14 @@ function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { }; } export const QueryAccountInfoResponse = { - encode(message: QueryAccountInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAccountInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { BaseAccount.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAccountInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAccountInfoResponse(); while (reader.pos < end) { @@ -1089,9 +1083,7 @@ export const QueryAccountInfoResponse = { message.info !== undefined && (obj.info = message.info ? BaseAccount.toJSON(message.info) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAccountInfoResponse { + fromPartial(object: Partial): QueryAccountInfoResponse { const message = createBaseQueryAccountInfoResponse(); if (object.info !== undefined && object.info !== null) { message.info = BaseAccount.fromPartial(object.info); @@ -1175,51 +1167,51 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryAccountsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Accounts", data); - return promise.then((data) => QueryAccountsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAccountsResponse.decode(new BinaryReader(data))); } Account(request: QueryAccountRequest): Promise { const data = QueryAccountRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); - return promise.then((data) => QueryAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAccountResponse.decode(new BinaryReader(data))); } AccountAddressByID(request: QueryAccountAddressByIDRequest): Promise { const data = QueryAccountAddressByIDRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountAddressByID", data); - return promise.then((data) => QueryAccountAddressByIDResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAccountAddressByIDResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } ModuleAccounts(request: QueryModuleAccountsRequest = {}): Promise { const data = QueryModuleAccountsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); - return promise.then((data) => QueryModuleAccountsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryModuleAccountsResponse.decode(new BinaryReader(data))); } ModuleAccountByName(request: QueryModuleAccountByNameRequest): Promise { const data = QueryModuleAccountByNameRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccountByName", data); - return promise.then((data) => QueryModuleAccountByNameResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryModuleAccountByNameResponse.decode(new BinaryReader(data))); } Bech32Prefix(request: Bech32PrefixRequest = {}): Promise { const data = Bech32PrefixRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); - return promise.then((data) => Bech32PrefixResponse.decode(new _m0.Reader(data))); + return promise.then((data) => Bech32PrefixResponse.decode(new BinaryReader(data))); } AddressBytesToString(request: AddressBytesToStringRequest): Promise { const data = AddressBytesToStringRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); - return promise.then((data) => AddressBytesToStringResponse.decode(new _m0.Reader(data))); + return promise.then((data) => AddressBytesToStringResponse.decode(new BinaryReader(data))); } AddressStringToBytes(request: AddressStringToBytesRequest): Promise { const data = AddressStringToBytesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); - return promise.then((data) => AddressStringToBytesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => AddressStringToBytesResponse.decode(new BinaryReader(data))); } AccountInfo(request: QueryAccountInfoRequest): Promise { const data = QueryAccountInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountInfo", data); - return promise.then((data) => QueryAccountInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAccountInfoResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/auth/v1beta1/tx.amino.ts b/src/cosmos/auth/v1beta1/tx.amino.ts new file mode 100644 index 0000000..0cf258f --- /dev/null +++ b/src/cosmos/auth/v1beta1/tx.amino.ts @@ -0,0 +1,45 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgUpdateParams } from "./tx"; +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/auth/MsgUpdateParams"; + value: { + authority: string; + params: { + max_memo_characters: string; + tx_sig_limit: string; + tx_size_cost_per_byte: string; + sig_verify_cost_ed25519: string; + sig_verify_cost_secp256k1: string; + }; + }; +} +export const AminoConverter = { + "/cosmos.auth.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/auth/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + max_memo_characters: params.maxMemoCharacters.toString(), + tx_sig_limit: params.txSigLimit.toString(), + tx_size_cost_per_byte: params.txSizeCostPerByte.toString(), + sig_verify_cost_ed25519: params.sigVerifyCostEd25519.toString(), + sig_verify_cost_secp256k1: params.sigVerifyCostSecp256k1.toString(), + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + maxMemoCharacters: BigInt(params.max_memo_characters), + txSigLimit: BigInt(params.tx_sig_limit), + txSizeCostPerByte: BigInt(params.tx_size_cost_per_byte), + sigVerifyCostEd25519: BigInt(params.sig_verify_cost_ed25519), + sigVerifyCostSecp256k1: BigInt(params.sig_verify_cost_secp256k1), + }, + }; + }, + }, +}; diff --git a/src/cosmos/auth/v1beta1/tx.registry.ts b/src/cosmos/auth/v1beta1/tx.registry.ts new file mode 100644 index 0000000..c00a676 --- /dev/null +++ b/src/cosmos/auth/v1beta1/tx.registry.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.auth.v1beta1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/auth/v1beta1/tx.ts b/src/cosmos/auth/v1beta1/tx.ts index 90ad127..7e269f6 100644 --- a/src/cosmos/auth/v1beta1/tx.ts +++ b/src/cosmos/auth/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./auth"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.auth.v1beta1"; /** * MsgUpdateParams is the Msg/UpdateParams request type. @@ -32,7 +32,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -41,8 +41,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -73,7 +73,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -86,11 +86,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -111,7 +111,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -135,6 +135,6 @@ export class MsgClientImpl implements Msg { UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/authz/module/v1/module.ts b/src/cosmos/authz/module/v1/module.ts index a11dd46..bdb08bf 100644 --- a/src/cosmos/authz/module/v1/module.ts +++ b/src/cosmos/authz/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.authz.module.v1"; /** Module is the config object of the authz module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/authz/v1beta1/authz.ts b/src/cosmos/authz/v1beta1/authz.ts index a9da0ee..79892f1 100644 --- a/src/cosmos/authz/v1beta1/authz.ts +++ b/src/cosmos/authz/v1beta1/authz.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.authz.v1beta1"; /** * GenericAuthorization gives the grantee unrestricted permissions to execute @@ -46,14 +46,14 @@ function createBaseGenericAuthorization(): GenericAuthorization { }; } export const GenericAuthorization = { - encode(message: GenericAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenericAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msg !== "") { writer.uint32(10).string(message.msg); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenericAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenericAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenericAuthorization(); while (reader.pos < end) { @@ -79,7 +79,7 @@ export const GenericAuthorization = { message.msg !== undefined && (obj.msg = message.msg); return obj; }, - fromPartial, I>>(object: I): GenericAuthorization { + fromPartial(object: Partial): GenericAuthorization { const message = createBaseGenericAuthorization(); message.msg = object.msg ?? ""; return message; @@ -92,7 +92,7 @@ function createBaseGrant(): Grant { }; } export const Grant = { - encode(message: Grant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authorization !== undefined) { Any.encode(message.authorization, writer.uint32(10).fork()).ldelim(); } @@ -101,8 +101,8 @@ export const Grant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGrant(); while (reader.pos < end) { @@ -134,7 +134,7 @@ export const Grant = { message.expiration !== undefined && (obj.expiration = fromTimestamp(message.expiration).toISOString()); return obj; }, - fromPartial, I>>(object: I): Grant { + fromPartial(object: Partial): Grant { const message = createBaseGrant(); if (object.authorization !== undefined && object.authorization !== null) { message.authorization = Any.fromPartial(object.authorization); @@ -154,7 +154,7 @@ function createBaseGrantAuthorization(): GrantAuthorization { }; } export const GrantAuthorization = { - encode(message: GrantAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GrantAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -169,8 +169,8 @@ export const GrantAuthorization = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GrantAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GrantAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGrantAuthorization(); while (reader.pos < end) { @@ -212,7 +212,7 @@ export const GrantAuthorization = { message.expiration !== undefined && (obj.expiration = fromTimestamp(message.expiration).toISOString()); return obj; }, - fromPartial, I>>(object: I): GrantAuthorization { + fromPartial(object: Partial): GrantAuthorization { const message = createBaseGrantAuthorization(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -231,14 +231,14 @@ function createBaseGrantQueueItem(): GrantQueueItem { }; } export const GrantQueueItem = { - encode(message: GrantQueueItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GrantQueueItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.msgTypeUrls) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GrantQueueItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GrantQueueItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGrantQueueItem(); while (reader.pos < end) { @@ -268,7 +268,7 @@ export const GrantQueueItem = { } return obj; }, - fromPartial, I>>(object: I): GrantQueueItem { + fromPartial(object: Partial): GrantQueueItem { const message = createBaseGrantQueueItem(); message.msgTypeUrls = object.msgTypeUrls?.map((e) => e) || []; return message; diff --git a/src/cosmos/authz/v1beta1/genesis.ts b/src/cosmos/authz/v1beta1/genesis.ts index 7686726..4d18a60 100644 --- a/src/cosmos/authz/v1beta1/genesis.ts +++ b/src/cosmos/authz/v1beta1/genesis.ts @@ -1,7 +1,6 @@ /* eslint-disable */ import { GrantAuthorization } from "./authz"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; export const protobufPackage = "cosmos.authz.v1beta1"; /** GenesisState defines the authz module's genesis state. */ export interface GenesisState { @@ -13,14 +12,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.authorization) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -51,7 +50,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.authorization = object.authorization?.map((e) => GrantAuthorization.fromPartial(e)) || []; return message; diff --git a/src/cosmos/authz/v1beta1/query.ts b/src/cosmos/authz/v1beta1/query.ts index ac181c4..35b66f6 100644 --- a/src/cosmos/authz/v1beta1/query.ts +++ b/src/cosmos/authz/v1beta1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { Grant, GrantAuthorization } from "./authz"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.authz.v1beta1"; /** QueryGrantsRequest is the request type for the Query/Grants RPC method. */ export interface QueryGrantsRequest { @@ -55,7 +55,7 @@ function createBaseQueryGrantsRequest(): QueryGrantsRequest { }; } export const QueryGrantsRequest = { - encode(message: QueryGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -70,8 +70,8 @@ export const QueryGrantsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGrantsRequest(); while (reader.pos < end) { @@ -113,7 +113,7 @@ export const QueryGrantsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryGrantsRequest { + fromPartial(object: Partial): QueryGrantsRequest { const message = createBaseQueryGrantsRequest(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -131,7 +131,7 @@ function createBaseQueryGrantsResponse(): QueryGrantsResponse { }; } export const QueryGrantsResponse = { - encode(message: QueryGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -140,8 +140,8 @@ export const QueryGrantsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGrantsResponse(); while (reader.pos < end) { @@ -177,7 +177,7 @@ export const QueryGrantsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryGrantsResponse { + fromPartial(object: Partial): QueryGrantsResponse { const message = createBaseQueryGrantsResponse(); message.grants = object.grants?.map((e) => Grant.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -193,7 +193,7 @@ function createBaseQueryGranterGrantsRequest(): QueryGranterGrantsRequest { }; } export const QueryGranterGrantsRequest = { - encode(message: QueryGranterGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGranterGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -202,8 +202,8 @@ export const QueryGranterGrantsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranterGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranterGrantsRequest(); while (reader.pos < end) { @@ -235,9 +235,7 @@ export const QueryGranterGrantsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGranterGrantsRequest { + fromPartial(object: Partial): QueryGranterGrantsRequest { const message = createBaseQueryGranterGrantsRequest(); message.granter = object.granter ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -253,7 +251,7 @@ function createBaseQueryGranterGrantsResponse(): QueryGranterGrantsResponse { }; } export const QueryGranterGrantsResponse = { - encode(message: QueryGranterGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGranterGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -262,8 +260,8 @@ export const QueryGranterGrantsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranterGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranterGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranterGrantsResponse(); while (reader.pos < end) { @@ -300,9 +298,7 @@ export const QueryGranterGrantsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGranterGrantsResponse { + fromPartial(object: Partial): QueryGranterGrantsResponse { const message = createBaseQueryGranterGrantsResponse(); message.grants = object.grants?.map((e) => GrantAuthorization.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -318,7 +314,7 @@ function createBaseQueryGranteeGrantsRequest(): QueryGranteeGrantsRequest { }; } export const QueryGranteeGrantsRequest = { - encode(message: QueryGranteeGrantsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGranteeGrantsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -327,8 +323,8 @@ export const QueryGranteeGrantsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranteeGrantsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranteeGrantsRequest(); while (reader.pos < end) { @@ -360,9 +356,7 @@ export const QueryGranteeGrantsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGranteeGrantsRequest { + fromPartial(object: Partial): QueryGranteeGrantsRequest { const message = createBaseQueryGranteeGrantsRequest(); message.grantee = object.grantee ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -378,7 +372,7 @@ function createBaseQueryGranteeGrantsResponse(): QueryGranteeGrantsResponse { }; } export const QueryGranteeGrantsResponse = { - encode(message: QueryGranteeGrantsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGranteeGrantsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.grants) { GrantAuthorization.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -387,8 +381,8 @@ export const QueryGranteeGrantsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGranteeGrantsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGranteeGrantsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGranteeGrantsResponse(); while (reader.pos < end) { @@ -425,9 +419,7 @@ export const QueryGranteeGrantsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGranteeGrantsResponse { + fromPartial(object: Partial): QueryGranteeGrantsResponse { const message = createBaseQueryGranteeGrantsResponse(); message.grants = object.grants?.map((e) => GrantAuthorization.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -464,16 +456,16 @@ export class QueryClientImpl implements Query { Grants(request: QueryGrantsRequest): Promise { const data = QueryGrantsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "Grants", data); - return promise.then((data) => QueryGrantsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGrantsResponse.decode(new BinaryReader(data))); } GranterGrants(request: QueryGranterGrantsRequest): Promise { const data = QueryGranterGrantsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranterGrants", data); - return promise.then((data) => QueryGranterGrantsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGranterGrantsResponse.decode(new BinaryReader(data))); } GranteeGrants(request: QueryGranteeGrantsRequest): Promise { const data = QueryGranteeGrantsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Query", "GranteeGrants", data); - return promise.then((data) => QueryGranteeGrantsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGranteeGrantsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/authz/v1beta1/tx.amino.ts b/src/cosmos/authz/v1beta1/tx.amino.ts new file mode 100644 index 0000000..898e355 --- /dev/null +++ b/src/cosmos/authz/v1beta1/tx.amino.ts @@ -0,0 +1,108 @@ +//@ts-nocheck +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export interface MsgGrantAminoType extends AminoMsg { + type: "cosmos-sdk/MsgGrant"; + value: { + granter: string; + grantee: string; + grant: { + authorization: { + type_url: string; + value: Uint8Array; + }; + expiration: { + seconds: string; + nanos: number; + }; + }; + }; +} +export interface MsgExecAminoType extends AminoMsg { + type: "cosmos-sdk/MsgExec"; + value: { + grantee: string; + msgs: { + type_url: string; + value: Uint8Array; + }[]; + }; +} +export interface MsgRevokeAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRevoke"; + value: { + granter: string; + grantee: string; + msg_type_url: string; + }; +} +export const AminoConverter = { + "/cosmos.authz.v1beta1.MsgGrant": { + aminoType: "cosmos-sdk/MsgGrant", + toAmino: ({ granter, grantee, grant }: MsgGrant): MsgGrantAminoType["value"] => { + return { + granter, + grantee, + grant: { + authorization: { + type_url: grant.authorization.typeUrl, + value: grant.authorization.value, + }, + expiration: grant.expiration, + }, + }; + }, + fromAmino: ({ granter, grantee, grant }: MsgGrantAminoType["value"]): MsgGrant => { + return { + granter, + grantee, + grant: { + authorization: { + typeUrl: grant.authorization.type_url, + value: grant.authorization.value, + }, + expiration: grant.expiration, + }, + }; + }, + }, + "/cosmos.authz.v1beta1.MsgExec": { + aminoType: "cosmos-sdk/MsgExec", + toAmino: ({ grantee, msgs }: MsgExec): MsgExecAminoType["value"] => { + return { + grantee, + msgs: msgs.map((el0) => ({ + type_url: el0.typeUrl, + value: el0.value, + })), + }; + }, + fromAmino: ({ grantee, msgs }: MsgExecAminoType["value"]): MsgExec => { + return { + grantee, + msgs: msgs.map((el0) => ({ + typeUrl: el0.type_url, + value: el0.value, + })), + }; + }, + }, + "/cosmos.authz.v1beta1.MsgRevoke": { + aminoType: "cosmos-sdk/MsgRevoke", + toAmino: ({ granter, grantee, msgTypeUrl }: MsgRevoke): MsgRevokeAminoType["value"] => { + return { + granter, + grantee, + msg_type_url: msgTypeUrl, + }; + }, + fromAmino: ({ granter, grantee, msg_type_url }: MsgRevokeAminoType["value"]): MsgRevoke => { + return { + granter, + grantee, + msgTypeUrl: msg_type_url, + }; + }, + }, +}; diff --git a/src/cosmos/authz/v1beta1/tx.registry.ts b/src/cosmos/authz/v1beta1/tx.registry.ts new file mode 100644 index 0000000..e4dbe0b --- /dev/null +++ b/src/cosmos/authz/v1beta1/tx.registry.ts @@ -0,0 +1,116 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgGrant, MsgExec, MsgRevoke } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.authz.v1beta1.MsgGrant", MsgGrant], + ["/cosmos.authz.v1beta1.MsgExec", MsgExec], + ["/cosmos.authz.v1beta1.MsgRevoke", MsgRevoke], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.encode(value).finish(), + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.encode(value).finish(), + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value, + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value, + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value, + }; + }, + }, + toJSON: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.toJSON(value), + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.toJSON(value), + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.toJSON(value), + }; + }, + }, + fromJSON: { + grant(value: any) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.fromJSON(value), + }; + }, + exec(value: any) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.fromJSON(value), + }; + }, + revoke(value: any) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.fromJSON(value), + }; + }, + }, + fromPartial: { + grant(value: MsgGrant) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgGrant", + value: MsgGrant.fromPartial(value), + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgExec", + value: MsgExec.fromPartial(value), + }; + }, + revoke(value: MsgRevoke) { + return { + typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", + value: MsgRevoke.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/authz/v1beta1/tx.ts b/src/cosmos/authz/v1beta1/tx.ts index d8cda81..8167956 100644 --- a/src/cosmos/authz/v1beta1/tx.ts +++ b/src/cosmos/authz/v1beta1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Grant } from "./authz"; import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.authz.v1beta1"; /** * MsgGrant is a request type for Grant method. It declares authorization to the grantee @@ -52,7 +52,7 @@ function createBaseMsgGrant(): MsgGrant { }; } export const MsgGrant = { - encode(message: MsgGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -64,8 +64,8 @@ export const MsgGrant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrant(); while (reader.pos < end) { @@ -101,7 +101,7 @@ export const MsgGrant = { message.grant !== undefined && (obj.grant = message.grant ? Grant.toJSON(message.grant) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgGrant { + fromPartial(object: Partial): MsgGrant { const message = createBaseMsgGrant(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -117,14 +117,14 @@ function createBaseMsgExecResponse(): MsgExecResponse { }; } export const MsgExecResponse = { - encode(message: MsgExecResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.results) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecResponse(); while (reader.pos < end) { @@ -154,7 +154,7 @@ export const MsgExecResponse = { } return obj; }, - fromPartial, I>>(object: I): MsgExecResponse { + fromPartial(object: Partial): MsgExecResponse { const message = createBaseMsgExecResponse(); message.results = object.results?.map((e) => e) || []; return message; @@ -167,7 +167,7 @@ function createBaseMsgExec(): MsgExec { }; } export const MsgExec = { - encode(message: MsgExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -176,8 +176,8 @@ export const MsgExec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExec(); while (reader.pos < end) { @@ -212,7 +212,7 @@ export const MsgExec = { } return obj; }, - fromPartial, I>>(object: I): MsgExec { + fromPartial(object: Partial): MsgExec { const message = createBaseMsgExec(); message.grantee = object.grantee ?? ""; message.msgs = object.msgs?.map((e) => Any.fromPartial(e)) || []; @@ -223,11 +223,11 @@ function createBaseMsgGrantResponse(): MsgGrantResponse { return {}; } export const MsgGrantResponse = { - encode(_: MsgGrantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrantResponse(); while (reader.pos < end) { @@ -248,7 +248,7 @@ export const MsgGrantResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgGrantResponse { + fromPartial(_: Partial): MsgGrantResponse { const message = createBaseMsgGrantResponse(); return message; }, @@ -261,7 +261,7 @@ function createBaseMsgRevoke(): MsgRevoke { }; } export const MsgRevoke = { - encode(message: MsgRevoke, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRevoke, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -273,8 +273,8 @@ export const MsgRevoke = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevoke { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevoke { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevoke(); while (reader.pos < end) { @@ -310,7 +310,7 @@ export const MsgRevoke = { message.msgTypeUrl !== undefined && (obj.msgTypeUrl = message.msgTypeUrl); return obj; }, - fromPartial, I>>(object: I): MsgRevoke { + fromPartial(object: Partial): MsgRevoke { const message = createBaseMsgRevoke(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -322,11 +322,11 @@ function createBaseMsgRevokeResponse(): MsgRevokeResponse { return {}; } export const MsgRevokeResponse = { - encode(_: MsgRevokeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRevokeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevokeResponse(); while (reader.pos < end) { @@ -347,7 +347,7 @@ export const MsgRevokeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgRevokeResponse { + fromPartial(_: Partial): MsgRevokeResponse { const message = createBaseMsgRevokeResponse(); return message; }, @@ -384,16 +384,16 @@ export class MsgClientImpl implements Msg { Grant(request: MsgGrant): Promise { const data = MsgGrant.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Grant", data); - return promise.then((data) => MsgGrantResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgGrantResponse.decode(new BinaryReader(data))); } Exec(request: MsgExec): Promise { const data = MsgExec.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Exec", data); - return promise.then((data) => MsgExecResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgExecResponse.decode(new BinaryReader(data))); } Revoke(request: MsgRevoke): Promise { const data = MsgRevoke.encode(request).finish(); const promise = this.rpc.request("cosmos.authz.v1beta1.Msg", "Revoke", data); - return promise.then((data) => MsgRevokeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRevokeResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/bank/module/v1/module.ts b/src/cosmos/bank/module/v1/module.ts index d6d3fc2..9cb641a 100644 --- a/src/cosmos/bank/module/v1/module.ts +++ b/src/cosmos/bank/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.bank.module.v1"; /** Module is the config object of the bank module. */ export interface Module { @@ -20,7 +20,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.blockedModuleAccountsOverride) { writer.uint32(10).string(v!); } @@ -29,8 +29,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -66,7 +66,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.blockedModuleAccountsOverride = object.blockedModuleAccountsOverride?.map((e) => e) || []; message.authority = object.authority ?? ""; diff --git a/src/cosmos/bank/v1beta1/authz.ts b/src/cosmos/bank/v1beta1/authz.ts index 931258e..8ef4512 100644 --- a/src/cosmos/bank/v1beta1/authz.ts +++ b/src/cosmos/bank/v1beta1/authz.ts @@ -1,7 +1,6 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; export const protobufPackage = "cosmos.bank.v1beta1"; /** * SendAuthorization allows the grantee to spend up to spend_limit coins from @@ -26,7 +25,7 @@ function createBaseSendAuthorization(): SendAuthorization { }; } export const SendAuthorization = { - encode(message: SendAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SendAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -35,8 +34,8 @@ export const SendAuthorization = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SendAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSendAuthorization(); while (reader.pos < end) { @@ -76,7 +75,7 @@ export const SendAuthorization = { } return obj; }, - fromPartial, I>>(object: I): SendAuthorization { + fromPartial(object: Partial): SendAuthorization { const message = createBaseSendAuthorization(); message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; message.allowList = object.allowList?.map((e) => e) || []; diff --git a/src/cosmos/bank/v1beta1/bank.ts b/src/cosmos/bank/v1beta1/bank.ts index b938321..06e8514 100644 --- a/src/cosmos/bank/v1beta1/bank.ts +++ b/src/cosmos/bank/v1beta1/bank.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.bank.v1beta1"; /** Params defines the parameters for the bank module. */ export interface Params { @@ -110,7 +110,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sendEnabled) { SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -119,8 +119,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -156,7 +156,7 @@ export const Params = { message.defaultSendEnabled !== undefined && (obj.defaultSendEnabled = message.defaultSendEnabled); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; message.defaultSendEnabled = object.defaultSendEnabled ?? false; @@ -170,7 +170,7 @@ function createBaseSendEnabled(): SendEnabled { }; } export const SendEnabled = { - encode(message: SendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -179,8 +179,8 @@ export const SendEnabled = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SendEnabled { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSendEnabled(); while (reader.pos < end) { @@ -211,7 +211,7 @@ export const SendEnabled = { message.enabled !== undefined && (obj.enabled = message.enabled); return obj; }, - fromPartial, I>>(object: I): SendEnabled { + fromPartial(object: Partial): SendEnabled { const message = createBaseSendEnabled(); message.denom = object.denom ?? ""; message.enabled = object.enabled ?? false; @@ -225,7 +225,7 @@ function createBaseInput(): Input { }; } export const Input = { - encode(message: Input, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Input, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -234,8 +234,8 @@ export const Input = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Input { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Input { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInput(); while (reader.pos < end) { @@ -270,7 +270,7 @@ export const Input = { } return obj; }, - fromPartial, I>>(object: I): Input { + fromPartial(object: Partial): Input { const message = createBaseInput(); message.address = object.address ?? ""; message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; @@ -284,7 +284,7 @@ function createBaseOutput(): Output { }; } export const Output = { - encode(message: Output, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Output, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -293,8 +293,8 @@ export const Output = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Output { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Output { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOutput(); while (reader.pos < end) { @@ -329,7 +329,7 @@ export const Output = { } return obj; }, - fromPartial, I>>(object: I): Output { + fromPartial(object: Partial): Output { const message = createBaseOutput(); message.address = object.address ?? ""; message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; @@ -342,14 +342,14 @@ function createBaseSupply(): Supply { }; } export const Supply = { - encode(message: Supply, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Supply, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.total) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Supply { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Supply { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSupply(); while (reader.pos < end) { @@ -379,7 +379,7 @@ export const Supply = { } return obj; }, - fromPartial, I>>(object: I): Supply { + fromPartial(object: Partial): Supply { const message = createBaseSupply(); message.total = object.total?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -393,7 +393,7 @@ function createBaseDenomUnit(): DenomUnit { }; } export const DenomUnit = { - encode(message: DenomUnit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DenomUnit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -405,8 +405,8 @@ export const DenomUnit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DenomUnit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DenomUnit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDenomUnit(); while (reader.pos < end) { @@ -446,7 +446,7 @@ export const DenomUnit = { } return obj; }, - fromPartial, I>>(object: I): DenomUnit { + fromPartial(object: Partial): DenomUnit { const message = createBaseDenomUnit(); message.denom = object.denom ?? ""; message.exponent = object.exponent ?? 0; @@ -467,7 +467,7 @@ function createBaseMetadata(): Metadata { }; } export const Metadata = { - encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== "") { writer.uint32(10).string(message.description); } @@ -494,8 +494,8 @@ export const Metadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMetadata(); while (reader.pos < end) { @@ -561,7 +561,7 @@ export const Metadata = { message.uriHash !== undefined && (obj.uriHash = message.uriHash); return obj; }, - fromPartial, I>>(object: I): Metadata { + fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.description = object.description ?? ""; message.denomUnits = object.denomUnits?.map((e) => DenomUnit.fromPartial(e)) || []; diff --git a/src/cosmos/bank/v1beta1/genesis.ts b/src/cosmos/bank/v1beta1/genesis.ts index 256ede5..b969fcc 100644 --- a/src/cosmos/bank/v1beta1/genesis.ts +++ b/src/cosmos/bank/v1beta1/genesis.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Params, Metadata, SendEnabled } from "./bank"; import { Coin } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.bank.v1beta1"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { @@ -44,7 +44,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -62,8 +62,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -127,7 +127,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -146,7 +146,7 @@ function createBaseBalance(): Balance { }; } export const Balance = { - encode(message: Balance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Balance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -155,8 +155,8 @@ export const Balance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Balance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Balance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBalance(); while (reader.pos < end) { @@ -191,7 +191,7 @@ export const Balance = { } return obj; }, - fromPartial, I>>(object: I): Balance { + fromPartial(object: Partial): Balance { const message = createBaseBalance(); message.address = object.address ?? ""; message.coins = object.coins?.map((e) => Coin.fromPartial(e)) || []; diff --git a/src/cosmos/bank/v1beta1/query.ts b/src/cosmos/bank/v1beta1/query.ts index dcf8ecc..5f8534d 100644 --- a/src/cosmos/bank/v1beta1/query.ts +++ b/src/cosmos/bank/v1beta1/query.ts @@ -2,8 +2,8 @@ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { Coin } from "../../base/v1beta1/coin"; import { Params, Metadata, SendEnabled } from "./bank"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.bank.v1beta1"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { @@ -218,7 +218,7 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { }; } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -227,8 +227,8 @@ export const QueryBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { @@ -259,7 +259,7 @@ export const QueryBalanceRequest = { message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromPartial, I>>(object: I): QueryBalanceRequest { + fromPartial(object: Partial): QueryBalanceRequest { const message = createBaseQueryBalanceRequest(); message.address = object.address ?? ""; message.denom = object.denom ?? ""; @@ -272,14 +272,14 @@ function createBaseQueryBalanceResponse(): QueryBalanceResponse { }; } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { @@ -306,7 +306,7 @@ export const QueryBalanceResponse = { (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryBalanceResponse { + fromPartial(object: Partial): QueryBalanceResponse { const message = createBaseQueryBalanceResponse(); if (object.balance !== undefined && object.balance !== null) { message.balance = Coin.fromPartial(object.balance); @@ -321,7 +321,7 @@ function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { }; } export const QueryAllBalancesRequest = { - encode(message: QueryAllBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -330,8 +330,8 @@ export const QueryAllBalancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllBalancesRequest(); while (reader.pos < end) { @@ -363,7 +363,7 @@ export const QueryAllBalancesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAllBalancesRequest { + fromPartial(object: Partial): QueryAllBalancesRequest { const message = createBaseQueryAllBalancesRequest(); message.address = object.address ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -379,7 +379,7 @@ function createBaseQueryAllBalancesResponse(): QueryAllBalancesResponse { }; } export const QueryAllBalancesResponse = { - encode(message: QueryAllBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllBalancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -388,8 +388,8 @@ export const QueryAllBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllBalancesResponse(); while (reader.pos < end) { @@ -425,9 +425,7 @@ export const QueryAllBalancesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllBalancesResponse { + fromPartial(object: Partial): QueryAllBalancesResponse { const message = createBaseQueryAllBalancesResponse(); message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -443,7 +441,7 @@ function createBaseQuerySpendableBalancesRequest(): QuerySpendableBalancesReques }; } export const QuerySpendableBalancesRequest = { - encode(message: QuerySpendableBalancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySpendableBalancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -452,8 +450,8 @@ export const QuerySpendableBalancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySpendableBalancesRequest(); while (reader.pos < end) { @@ -485,9 +483,7 @@ export const QuerySpendableBalancesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySpendableBalancesRequest { + fromPartial(object: Partial): QuerySpendableBalancesRequest { const message = createBaseQuerySpendableBalancesRequest(); message.address = object.address ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -503,7 +499,10 @@ function createBaseQuerySpendableBalancesResponse(): QuerySpendableBalancesRespo }; } export const QuerySpendableBalancesResponse = { - encode(message: QuerySpendableBalancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySpendableBalancesResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.balances) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -512,8 +511,8 @@ export const QuerySpendableBalancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySpendableBalancesResponse(); while (reader.pos < end) { @@ -549,9 +548,7 @@ export const QuerySpendableBalancesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySpendableBalancesResponse { + fromPartial(object: Partial): QuerySpendableBalancesResponse { const message = createBaseQuerySpendableBalancesResponse(); message.balances = object.balances?.map((e) => Coin.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -567,7 +564,10 @@ function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceB }; } export const QuerySpendableBalanceByDenomRequest = { - encode(message: QuerySpendableBalanceByDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySpendableBalanceByDenomRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -576,8 +576,8 @@ export const QuerySpendableBalanceByDenomRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalanceByDenomRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySpendableBalanceByDenomRequest(); while (reader.pos < end) { @@ -608,9 +608,7 @@ export const QuerySpendableBalanceByDenomRequest = { message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySpendableBalanceByDenomRequest { + fromPartial(object: Partial): QuerySpendableBalanceByDenomRequest { const message = createBaseQuerySpendableBalanceByDenomRequest(); message.address = object.address ?? ""; message.denom = object.denom ?? ""; @@ -625,15 +623,15 @@ function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalance export const QuerySpendableBalanceByDenomResponse = { encode( message: QuerySpendableBalanceByDenomResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpendableBalanceByDenomResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySpendableBalanceByDenomResponse(); while (reader.pos < end) { @@ -660,9 +658,7 @@ export const QuerySpendableBalanceByDenomResponse = { (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySpendableBalanceByDenomResponse { + fromPartial(object: Partial): QuerySpendableBalanceByDenomResponse { const message = createBaseQuerySpendableBalanceByDenomResponse(); if (object.balance !== undefined && object.balance !== null) { message.balance = Coin.fromPartial(object.balance); @@ -676,14 +672,14 @@ function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { }; } export const QueryTotalSupplyRequest = { - encode(message: QueryTotalSupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalSupplyRequest(); while (reader.pos < end) { @@ -710,7 +706,7 @@ export const QueryTotalSupplyRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryTotalSupplyRequest { + fromPartial(object: Partial): QueryTotalSupplyRequest { const message = createBaseQueryTotalSupplyRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -725,7 +721,7 @@ function createBaseQueryTotalSupplyResponse(): QueryTotalSupplyResponse { }; } export const QueryTotalSupplyResponse = { - encode(message: QueryTotalSupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalSupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.supply) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -734,8 +730,8 @@ export const QueryTotalSupplyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalSupplyResponse(); while (reader.pos < end) { @@ -771,9 +767,7 @@ export const QueryTotalSupplyResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalSupplyResponse { + fromPartial(object: Partial): QueryTotalSupplyResponse { const message = createBaseQueryTotalSupplyResponse(); message.supply = object.supply?.map((e) => Coin.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -788,14 +782,14 @@ function createBaseQuerySupplyOfRequest(): QuerySupplyOfRequest { }; } export const QuerySupplyOfRequest = { - encode(message: QuerySupplyOfRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySupplyOfRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyOfRequest(); while (reader.pos < end) { @@ -821,7 +815,7 @@ export const QuerySupplyOfRequest = { message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromPartial, I>>(object: I): QuerySupplyOfRequest { + fromPartial(object: Partial): QuerySupplyOfRequest { const message = createBaseQuerySupplyOfRequest(); message.denom = object.denom ?? ""; return message; @@ -833,14 +827,14 @@ function createBaseQuerySupplyOfResponse(): QuerySupplyOfResponse { }; } export const QuerySupplyOfResponse = { - encode(message: QuerySupplyOfResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySupplyOfResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyOfResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyOfResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyOfResponse(); while (reader.pos < end) { @@ -866,7 +860,7 @@ export const QuerySupplyOfResponse = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): QuerySupplyOfResponse { + fromPartial(object: Partial): QuerySupplyOfResponse { const message = createBaseQuerySupplyOfResponse(); if (object.amount !== undefined && object.amount !== null) { message.amount = Coin.fromPartial(object.amount); @@ -878,11 +872,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -903,7 +897,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -914,14 +908,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -947,7 +941,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -961,14 +955,14 @@ function createBaseQueryDenomsMetadataRequest(): QueryDenomsMetadataRequest { }; } export const QueryDenomsMetadataRequest = { - encode(message: QueryDenomsMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomsMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomsMetadataRequest(); while (reader.pos < end) { @@ -995,9 +989,7 @@ export const QueryDenomsMetadataRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDenomsMetadataRequest { + fromPartial(object: Partial): QueryDenomsMetadataRequest { const message = createBaseQueryDenomsMetadataRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -1012,7 +1004,7 @@ function createBaseQueryDenomsMetadataResponse(): QueryDenomsMetadataResponse { }; } export const QueryDenomsMetadataResponse = { - encode(message: QueryDenomsMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomsMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.metadatas) { Metadata.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1021,8 +1013,8 @@ export const QueryDenomsMetadataResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomsMetadataResponse(); while (reader.pos < end) { @@ -1059,9 +1051,7 @@ export const QueryDenomsMetadataResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDenomsMetadataResponse { + fromPartial(object: Partial): QueryDenomsMetadataResponse { const message = createBaseQueryDenomsMetadataResponse(); message.metadatas = object.metadatas?.map((e) => Metadata.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1076,14 +1066,14 @@ function createBaseQueryDenomMetadataRequest(): QueryDenomMetadataRequest { }; } export const QueryDenomMetadataRequest = { - encode(message: QueryDenomMetadataRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomMetadataRequest(); while (reader.pos < end) { @@ -1109,9 +1099,7 @@ export const QueryDenomMetadataRequest = { message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDenomMetadataRequest { + fromPartial(object: Partial): QueryDenomMetadataRequest { const message = createBaseQueryDenomMetadataRequest(); message.denom = object.denom ?? ""; return message; @@ -1123,14 +1111,14 @@ function createBaseQueryDenomMetadataResponse(): QueryDenomMetadataResponse { }; } export const QueryDenomMetadataResponse = { - encode(message: QueryDenomMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.metadata !== undefined) { Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomMetadataResponse(); while (reader.pos < end) { @@ -1157,9 +1145,7 @@ export const QueryDenomMetadataResponse = { (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDenomMetadataResponse { + fromPartial(object: Partial): QueryDenomMetadataResponse { const message = createBaseQueryDenomMetadataResponse(); if (object.metadata !== undefined && object.metadata !== null) { message.metadata = Metadata.fromPartial(object.metadata); @@ -1174,7 +1160,7 @@ function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { }; } export const QueryDenomOwnersRequest = { - encode(message: QueryDenomOwnersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomOwnersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -1183,8 +1169,8 @@ export const QueryDenomOwnersRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomOwnersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomOwnersRequest(); while (reader.pos < end) { @@ -1216,7 +1202,7 @@ export const QueryDenomOwnersRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDenomOwnersRequest { + fromPartial(object: Partial): QueryDenomOwnersRequest { const message = createBaseQueryDenomOwnersRequest(); message.denom = object.denom ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1232,7 +1218,7 @@ function createBaseDenomOwner(): DenomOwner { }; } export const DenomOwner = { - encode(message: DenomOwner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DenomOwner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -1241,8 +1227,8 @@ export const DenomOwner = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DenomOwner { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDenomOwner(); while (reader.pos < end) { @@ -1274,7 +1260,7 @@ export const DenomOwner = { (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial, I>>(object: I): DenomOwner { + fromPartial(object: Partial): DenomOwner { const message = createBaseDenomOwner(); message.address = object.address ?? ""; if (object.balance !== undefined && object.balance !== null) { @@ -1290,7 +1276,7 @@ function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { }; } export const QueryDenomOwnersResponse = { - encode(message: QueryDenomOwnersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomOwnersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denomOwners) { DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1299,8 +1285,8 @@ export const QueryDenomOwnersResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomOwnersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomOwnersResponse(); while (reader.pos < end) { @@ -1337,9 +1323,7 @@ export const QueryDenomOwnersResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDenomOwnersResponse { + fromPartial(object: Partial): QueryDenomOwnersResponse { const message = createBaseQueryDenomOwnersResponse(); message.denomOwners = object.denomOwners?.map((e) => DenomOwner.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1355,7 +1339,7 @@ function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { }; } export const QuerySendEnabledRequest = { - encode(message: QuerySendEnabledRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySendEnabledRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denoms) { writer.uint32(10).string(v!); } @@ -1364,8 +1348,8 @@ export const QuerySendEnabledRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySendEnabledRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySendEnabledRequest(); while (reader.pos < end) { @@ -1401,7 +1385,7 @@ export const QuerySendEnabledRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QuerySendEnabledRequest { + fromPartial(object: Partial): QuerySendEnabledRequest { const message = createBaseQuerySendEnabledRequest(); message.denoms = object.denoms?.map((e) => e) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1417,7 +1401,7 @@ function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { }; } export const QuerySendEnabledResponse = { - encode(message: QuerySendEnabledResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.sendEnabled) { SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1426,8 +1410,8 @@ export const QuerySendEnabledResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySendEnabledResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySendEnabledResponse(); while (reader.pos < end) { @@ -1464,9 +1448,7 @@ export const QuerySendEnabledResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySendEnabledResponse { + fromPartial(object: Partial): QuerySendEnabledResponse { const message = createBaseQuerySendEnabledResponse(); message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1571,24 +1553,24 @@ export class QueryClientImpl implements Query { Balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Balance", data); - return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryBalanceResponse.decode(new BinaryReader(data))); } AllBalances(request: QueryAllBalancesRequest): Promise { const data = QueryAllBalancesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "AllBalances", data); - return promise.then((data) => QueryAllBalancesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllBalancesResponse.decode(new BinaryReader(data))); } SpendableBalances(request: QuerySpendableBalancesRequest): Promise { const data = QuerySpendableBalancesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalances", data); - return promise.then((data) => QuerySpendableBalancesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySpendableBalancesResponse.decode(new BinaryReader(data))); } SpendableBalanceByDenom( request: QuerySpendableBalanceByDenomRequest, ): Promise { const data = QuerySpendableBalanceByDenomRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalanceByDenom", data); - return promise.then((data) => QuerySpendableBalanceByDenomResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySpendableBalanceByDenomResponse.decode(new BinaryReader(data))); } TotalSupply( request: QueryTotalSupplyRequest = { @@ -1597,22 +1579,22 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryTotalSupplyRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "TotalSupply", data); - return promise.then((data) => QueryTotalSupplyResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalSupplyResponse.decode(new BinaryReader(data))); } SupplyOf(request: QuerySupplyOfRequest): Promise { const data = QuerySupplyOfRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SupplyOf", data); - return promise.then((data) => QuerySupplyOfResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySupplyOfResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } DenomMetadata(request: QueryDenomMetadataRequest): Promise { const data = QueryDenomMetadataRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); - return promise.then((data) => QueryDenomMetadataResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDenomMetadataResponse.decode(new BinaryReader(data))); } DenomsMetadata( request: QueryDenomsMetadataRequest = { @@ -1621,16 +1603,16 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryDenomsMetadataRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); - return promise.then((data) => QueryDenomsMetadataResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDenomsMetadataResponse.decode(new BinaryReader(data))); } DenomOwners(request: QueryDenomOwnersRequest): Promise { const data = QueryDenomOwnersRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); - return promise.then((data) => QueryDenomOwnersResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDenomOwnersResponse.decode(new BinaryReader(data))); } SendEnabled(request: QuerySendEnabledRequest): Promise { const data = QuerySendEnabledRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SendEnabled", data); - return promise.then((data) => QuerySendEnabledResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySendEnabledResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/bank/v1beta1/tx.amino.ts b/src/cosmos/bank/v1beta1/tx.amino.ts new file mode 100644 index 0000000..57986f6 --- /dev/null +++ b/src/cosmos/bank/v1beta1/tx.amino.ts @@ -0,0 +1,179 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export interface MsgSendAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSend"; + value: { + from_address: string; + to_address: string; + amount: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgMultiSendAminoType extends AminoMsg { + type: "cosmos-sdk/MsgMultiSend"; + value: { + inputs: { + address: string; + coins: { + denom: string; + amount: string; + }[]; + }[]; + outputs: { + address: string; + coins: { + denom: string; + amount: string; + }[]; + }[]; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/bank/MsgUpdateParams"; + value: { + authority: string; + params: { + send_enabled: { + denom: string; + enabled: boolean; + }[]; + default_send_enabled: boolean; + }; + }; +} +export interface MsgSetSendEnabledAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSetSendEnabled"; + value: { + authority: string; + send_enabled: { + denom: string; + enabled: boolean; + }[]; + use_default_for: string[]; + }; +} +export const AminoConverter = { + "/cosmos.bank.v1beta1.MsgSend": { + aminoType: "cosmos-sdk/MsgSend", + toAmino: ({ fromAddress, toAddress, amount }: MsgSend): MsgSendAminoType["value"] => { + return { + from_address: fromAddress, + to_address: toAddress, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ from_address, to_address, amount }: MsgSendAminoType["value"]): MsgSend => { + return { + fromAddress: from_address, + toAddress: to_address, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/cosmos.bank.v1beta1.MsgMultiSend": { + aminoType: "cosmos-sdk/MsgMultiSend", + toAmino: ({ inputs, outputs }: MsgMultiSend): MsgMultiSendAminoType["value"] => { + return { + inputs: inputs.map((el0) => ({ + address: el0.address, + coins: el0.coins.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + })), + outputs: outputs.map((el0) => ({ + address: el0.address, + coins: el0.coins.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + })), + }; + }, + fromAmino: ({ inputs, outputs }: MsgMultiSendAminoType["value"]): MsgMultiSend => { + return { + inputs: inputs.map((el0) => ({ + address: el0.address, + coins: el0.coins.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + })), + outputs: outputs.map((el0) => ({ + address: el0.address, + coins: el0.coins.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + })), + }; + }, + }, + "/cosmos.bank.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + send_enabled: params.sendEnabled.map((el0) => ({ + denom: el0.denom, + enabled: el0.enabled, + })), + default_send_enabled: params.defaultSendEnabled, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + sendEnabled: params.send_enabled.map((el1) => ({ + denom: el1.denom, + enabled: el1.enabled, + })), + defaultSendEnabled: params.default_send_enabled, + }, + }; + }, + }, + "/cosmos.bank.v1beta1.MsgSetSendEnabled": { + aminoType: "cosmos-sdk/MsgSetSendEnabled", + toAmino: ({ + authority, + sendEnabled, + useDefaultFor, + }: MsgSetSendEnabled): MsgSetSendEnabledAminoType["value"] => { + return { + authority, + send_enabled: sendEnabled.map((el0) => ({ + denom: el0.denom, + enabled: el0.enabled, + })), + use_default_for: useDefaultFor, + }; + }, + fromAmino: ({ + authority, + send_enabled, + use_default_for, + }: MsgSetSendEnabledAminoType["value"]): MsgSetSendEnabled => { + return { + authority, + sendEnabled: send_enabled.map((el0) => ({ + denom: el0.denom, + enabled: el0.enabled, + })), + useDefaultFor: use_default_for, + }; + }, + }, +}; diff --git a/src/cosmos/bank/v1beta1/tx.registry.ts b/src/cosmos/bank/v1beta1/tx.registry.ts new file mode 100644 index 0000000..3ac2584 --- /dev/null +++ b/src/cosmos/bank/v1beta1/tx.registry.ts @@ -0,0 +1,147 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.bank.v1beta1.MsgSend", MsgSend], + ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], + ["/cosmos.bank.v1beta1.MsgUpdateParams", MsgUpdateParams], + ["/cosmos.bank.v1beta1.MsgSetSendEnabled", MsgSetSendEnabled], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.encode(value).finish(), + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value, + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value, + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value, + }; + }, + }, + toJSON: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.toJSON(value), + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.toJSON(value), + }; + }, + }, + fromJSON: { + send(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.fromJSON(value), + }; + }, + multiSend(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + setSendEnabled(value: any) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.fromJSON(value), + }; + }, + }, + fromPartial: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSend", + value: MsgSend.fromPartial(value), + }; + }, + multiSend(value: MsgMultiSend) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", + value: MsgMultiSend.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/bank/v1beta1/tx.ts b/src/cosmos/bank/v1beta1/tx.ts index 5e232e3..e9e2105 100644 --- a/src/cosmos/bank/v1beta1/tx.ts +++ b/src/cosmos/bank/v1beta1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; import { Input, Output, Params, SendEnabled } from "./bank"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.bank.v1beta1"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { @@ -80,7 +80,7 @@ function createBaseMsgSend(): MsgSend { }; } export const MsgSend = { - encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } @@ -92,8 +92,8 @@ export const MsgSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { @@ -133,7 +133,7 @@ export const MsgSend = { } return obj; }, - fromPartial, I>>(object: I): MsgSend { + fromPartial(object: Partial): MsgSend { const message = createBaseMsgSend(); message.fromAddress = object.fromAddress ?? ""; message.toAddress = object.toAddress ?? ""; @@ -145,11 +145,11 @@ function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { @@ -170,7 +170,7 @@ export const MsgSendResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgSendResponse { + fromPartial(_: Partial): MsgSendResponse { const message = createBaseMsgSendResponse(); return message; }, @@ -182,7 +182,7 @@ function createBaseMsgMultiSend(): MsgMultiSend { }; } export const MsgMultiSend = { - encode(message: MsgMultiSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgMultiSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.inputs) { Input.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -191,8 +191,8 @@ export const MsgMultiSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMultiSend(); while (reader.pos < end) { @@ -231,7 +231,7 @@ export const MsgMultiSend = { } return obj; }, - fromPartial, I>>(object: I): MsgMultiSend { + fromPartial(object: Partial): MsgMultiSend { const message = createBaseMsgMultiSend(); message.inputs = object.inputs?.map((e) => Input.fromPartial(e)) || []; message.outputs = object.outputs?.map((e) => Output.fromPartial(e)) || []; @@ -242,11 +242,11 @@ function createBaseMsgMultiSendResponse(): MsgMultiSendResponse { return {}; } export const MsgMultiSendResponse = { - encode(_: MsgMultiSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgMultiSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMultiSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMultiSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMultiSendResponse(); while (reader.pos < end) { @@ -267,7 +267,7 @@ export const MsgMultiSendResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgMultiSendResponse { + fromPartial(_: Partial): MsgMultiSendResponse { const message = createBaseMsgMultiSendResponse(); return message; }, @@ -279,7 +279,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -288,8 +288,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -320,7 +320,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -333,11 +333,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -358,7 +358,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -371,7 +371,7 @@ function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { }; } export const MsgSetSendEnabled = { - encode(message: MsgSetSendEnabled, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSetSendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -383,8 +383,8 @@ export const MsgSetSendEnabled = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetSendEnabled { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetSendEnabled(); while (reader.pos < end) { @@ -430,7 +430,7 @@ export const MsgSetSendEnabled = { } return obj; }, - fromPartial, I>>(object: I): MsgSetSendEnabled { + fromPartial(object: Partial): MsgSetSendEnabled { const message = createBaseMsgSetSendEnabled(); message.authority = object.authority ?? ""; message.sendEnabled = object.sendEnabled?.map((e) => SendEnabled.fromPartial(e)) || []; @@ -442,11 +442,11 @@ function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { return {}; } export const MsgSetSendEnabledResponse = { - encode(_: MsgSetSendEnabledResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgSetSendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetSendEnabledResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetSendEnabledResponse(); while (reader.pos < end) { @@ -467,7 +467,7 @@ export const MsgSetSendEnabledResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgSetSendEnabledResponse { + fromPartial(_: Partial): MsgSetSendEnabledResponse { const message = createBaseMsgSetSendEnabledResponse(); return message; }, @@ -507,21 +507,21 @@ export class MsgClientImpl implements Msg { Send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "Send", data); - return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSendResponse.decode(new BinaryReader(data))); } MultiSend(request: MsgMultiSend): Promise { const data = MsgMultiSend.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); - return promise.then((data) => MsgMultiSendResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgMultiSendResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } SetSendEnabled(request: MsgSetSendEnabled): Promise { const data = MsgSetSendEnabled.encode(request).finish(); const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "SetSendEnabled", data); - return promise.then((data) => MsgSetSendEnabledResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSetSendEnabledResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/base/abci/v1beta1/abci.ts b/src/cosmos/base/abci/v1beta1/abci.ts index 90b1de9..36dc0c8 100644 --- a/src/cosmos/base/abci/v1beta1/abci.ts +++ b/src/cosmos/base/abci/v1beta1/abci.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Any } from "../../../../google/protobuf/any"; import { Event } from "../../../../tendermint/abci/types"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "cosmos.base.abci.v1beta1"; /** * TxResponse defines a structure containing relevant tx data and metadata. The @@ -10,7 +10,7 @@ export const protobufPackage = "cosmos.base.abci.v1beta1"; */ export interface TxResponse { /** The block height */ - height: Long; + height: bigint; /** The transaction hash. */ txhash: string; /** Namespace for the Code */ @@ -29,9 +29,9 @@ export interface TxResponse { /** Additional information. May be non-deterministic. */ info: string; /** Amount of gas requested for transaction. */ - gasWanted: Long; + gasWanted: bigint; /** Amount of gas consumed by transaction. */ - gasUsed: Long; + gasUsed: bigint; /** The request transaction bytes. */ tx: Any; /** @@ -79,9 +79,9 @@ export interface Attribute { /** GasInfo defines tx execution gas context. */ export interface GasInfo { /** GasWanted is the maximum units of work we allow this tx to perform. */ - gasWanted: Long; + gasWanted: bigint; /** GasUsed is the amount of gas actually consumed. */ - gasUsed: Long; + gasUsed: bigint; } /** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface Result { @@ -142,21 +142,21 @@ export interface TxMsgData { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { /** Count of all txs */ - totalCount: Long; + totalCount: bigint; /** Count of txs in current page */ - count: Long; + count: bigint; /** Index of current page, start from 1 */ - pageNumber: Long; + pageNumber: bigint; /** Count of total pages */ - pageTotal: Long; + pageTotal: bigint; /** Max count txs per page */ - limit: Long; + limit: bigint; /** List of txs in current page */ txs: TxResponse[]; } function createBaseTxResponse(): TxResponse { return { - height: Long.ZERO, + height: BigInt(0), txhash: "", codespace: "", code: 0, @@ -164,16 +164,16 @@ function createBaseTxResponse(): TxResponse { rawLog: "", logs: [], info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), tx: Any.fromPartial({}), timestamp: "", events: [], }; } export const TxResponse = { - encode(message: TxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: TxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.txhash !== "") { @@ -197,10 +197,10 @@ export const TxResponse = { if (message.info !== "") { writer.uint32(66).string(message.info); } - if (!message.gasWanted.isZero()) { + if (message.gasWanted !== BigInt(0)) { writer.uint32(72).int64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(80).int64(message.gasUsed); } if (message.tx !== undefined) { @@ -214,15 +214,15 @@ export const TxResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 2: message.txhash = reader.string(); @@ -246,10 +246,10 @@ export const TxResponse = { message.info = reader.string(); break; case 9: - message.gasWanted = reader.int64() as Long; + message.gasWanted = reader.int64(); break; case 10: - message.gasUsed = reader.int64() as Long; + message.gasUsed = reader.int64(); break; case 11: message.tx = Any.decode(reader, reader.uint32()); @@ -269,7 +269,7 @@ export const TxResponse = { }, fromJSON(object: any): TxResponse { const obj = createBaseTxResponse(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.txhash)) obj.txhash = String(object.txhash); if (isSet(object.codespace)) obj.codespace = String(object.codespace); if (isSet(object.code)) obj.code = Number(object.code); @@ -277,8 +277,8 @@ export const TxResponse = { if (isSet(object.rawLog)) obj.rawLog = String(object.rawLog); if (Array.isArray(object?.logs)) obj.logs = object.logs.map((e: any) => ABCIMessageLog.fromJSON(e)); if (isSet(object.info)) obj.info = String(object.info); - if (isSet(object.gasWanted)) obj.gasWanted = Long.fromValue(object.gasWanted); - if (isSet(object.gasUsed)) obj.gasUsed = Long.fromValue(object.gasUsed); + if (isSet(object.gasWanted)) obj.gasWanted = BigInt(object.gasWanted.toString()); + if (isSet(object.gasUsed)) obj.gasUsed = BigInt(object.gasUsed.toString()); if (isSet(object.tx)) obj.tx = Any.fromJSON(object.tx); if (isSet(object.timestamp)) obj.timestamp = String(object.timestamp); if (Array.isArray(object?.events)) obj.events = object.events.map((e: any) => Event.fromJSON(e)); @@ -286,7 +286,7 @@ export const TxResponse = { }, toJSON(message: TxResponse): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.txhash !== undefined && (obj.txhash = message.txhash); message.codespace !== undefined && (obj.codespace = message.codespace); message.code !== undefined && (obj.code = Math.round(message.code)); @@ -298,8 +298,8 @@ export const TxResponse = { obj.logs = []; } message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.ZERO).toString()); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); message.tx !== undefined && (obj.tx = message.tx ? Any.toJSON(message.tx) : undefined); message.timestamp !== undefined && (obj.timestamp = message.timestamp); if (message.events) { @@ -309,10 +309,10 @@ export const TxResponse = { } return obj; }, - fromPartial, I>>(object: I): TxResponse { + fromPartial(object: Partial): TxResponse { const message = createBaseTxResponse(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.txhash = object.txhash ?? ""; message.codespace = object.codespace ?? ""; @@ -322,10 +322,10 @@ export const TxResponse = { message.logs = object.logs?.map((e) => ABCIMessageLog.fromPartial(e)) || []; message.info = object.info ?? ""; if (object.gasWanted !== undefined && object.gasWanted !== null) { - message.gasWanted = Long.fromValue(object.gasWanted); + message.gasWanted = BigInt(object.gasWanted.toString()); } if (object.gasUsed !== undefined && object.gasUsed !== null) { - message.gasUsed = Long.fromValue(object.gasUsed); + message.gasUsed = BigInt(object.gasUsed.toString()); } if (object.tx !== undefined && object.tx !== null) { message.tx = Any.fromPartial(object.tx); @@ -343,7 +343,7 @@ function createBaseABCIMessageLog(): ABCIMessageLog { }; } export const ABCIMessageLog = { - encode(message: ABCIMessageLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ABCIMessageLog, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgIndex !== 0) { writer.uint32(8).uint32(message.msgIndex); } @@ -355,8 +355,8 @@ export const ABCIMessageLog = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ABCIMessageLog { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ABCIMessageLog { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseABCIMessageLog(); while (reader.pos < end) { @@ -396,7 +396,7 @@ export const ABCIMessageLog = { } return obj; }, - fromPartial, I>>(object: I): ABCIMessageLog { + fromPartial(object: Partial): ABCIMessageLog { const message = createBaseABCIMessageLog(); message.msgIndex = object.msgIndex ?? 0; message.log = object.log ?? ""; @@ -411,7 +411,7 @@ function createBaseStringEvent(): StringEvent { }; } export const StringEvent = { - encode(message: StringEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StringEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -420,8 +420,8 @@ export const StringEvent = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StringEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StringEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStringEvent(); while (reader.pos < end) { @@ -457,7 +457,7 @@ export const StringEvent = { } return obj; }, - fromPartial, I>>(object: I): StringEvent { + fromPartial(object: Partial): StringEvent { const message = createBaseStringEvent(); message.type = object.type ?? ""; message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; @@ -471,7 +471,7 @@ function createBaseAttribute(): Attribute { }; } export const Attribute = { - encode(message: Attribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Attribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -480,8 +480,8 @@ export const Attribute = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Attribute { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Attribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAttribute(); while (reader.pos < end) { @@ -512,7 +512,7 @@ export const Attribute = { message.value !== undefined && (obj.value = message.value); return obj; }, - fromPartial, I>>(object: I): Attribute { + fromPartial(object: Partial): Attribute { const message = createBaseAttribute(); message.key = object.key ?? ""; message.value = object.value ?? ""; @@ -521,32 +521,32 @@ export const Attribute = { }; function createBaseGasInfo(): GasInfo { return { - gasWanted: Long.UZERO, - gasUsed: Long.UZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), }; } export const GasInfo = { - encode(message: GasInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.gasWanted.isZero()) { + encode(message: GasInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.gasWanted !== BigInt(0)) { writer.uint32(8).uint64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(16).uint64(message.gasUsed); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GasInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GasInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGasInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.gasWanted = reader.uint64() as Long; + message.gasWanted = reader.uint64(); break; case 2: - message.gasUsed = reader.uint64() as Long; + message.gasUsed = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -557,23 +557,23 @@ export const GasInfo = { }, fromJSON(object: any): GasInfo { const obj = createBaseGasInfo(); - if (isSet(object.gasWanted)) obj.gasWanted = Long.fromValue(object.gasWanted); - if (isSet(object.gasUsed)) obj.gasUsed = Long.fromValue(object.gasUsed); + if (isSet(object.gasWanted)) obj.gasWanted = BigInt(object.gasWanted.toString()); + if (isSet(object.gasUsed)) obj.gasUsed = BigInt(object.gasUsed.toString()); return obj; }, toJSON(message: GasInfo): unknown { const obj: any = {}; - message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || Long.UZERO).toString()); - message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || Long.UZERO).toString()); + message.gasWanted !== undefined && (obj.gasWanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): GasInfo { + fromPartial(object: Partial): GasInfo { const message = createBaseGasInfo(); if (object.gasWanted !== undefined && object.gasWanted !== null) { - message.gasWanted = Long.fromValue(object.gasWanted); + message.gasWanted = BigInt(object.gasWanted.toString()); } if (object.gasUsed !== undefined && object.gasUsed !== null) { - message.gasUsed = Long.fromValue(object.gasUsed); + message.gasUsed = BigInt(object.gasUsed.toString()); } return message; }, @@ -587,7 +587,7 @@ function createBaseResult(): Result { }; } export const Result = { - encode(message: Result, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Result, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } @@ -602,8 +602,8 @@ export const Result = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Result { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Result { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResult(); while (reader.pos < end) { @@ -654,7 +654,7 @@ export const Result = { } return obj; }, - fromPartial, I>>(object: I): Result { + fromPartial(object: Partial): Result { const message = createBaseResult(); message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; @@ -670,7 +670,7 @@ function createBaseSimulationResponse(): SimulationResponse { }; } export const SimulationResponse = { - encode(message: SimulationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SimulationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasInfo !== undefined) { GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); } @@ -679,8 +679,8 @@ export const SimulationResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimulationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimulationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimulationResponse(); while (reader.pos < end) { @@ -712,7 +712,7 @@ export const SimulationResponse = { message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); return obj; }, - fromPartial, I>>(object: I): SimulationResponse { + fromPartial(object: Partial): SimulationResponse { const message = createBaseSimulationResponse(); if (object.gasInfo !== undefined && object.gasInfo !== null) { message.gasInfo = GasInfo.fromPartial(object.gasInfo); @@ -730,7 +730,7 @@ function createBaseMsgData(): MsgData { }; } export const MsgData = { - encode(message: MsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.msgType !== "") { writer.uint32(10).string(message.msgType); } @@ -739,8 +739,8 @@ export const MsgData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgData(); while (reader.pos < end) { @@ -772,7 +772,7 @@ export const MsgData = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MsgData { + fromPartial(object: Partial): MsgData { const message = createBaseMsgData(); message.msgType = object.msgType ?? ""; message.data = object.data ?? new Uint8Array(); @@ -786,7 +786,7 @@ function createBaseTxMsgData(): TxMsgData { }; } export const TxMsgData = { - encode(message: TxMsgData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxMsgData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.data) { MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -795,8 +795,8 @@ export const TxMsgData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxMsgData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxMsgData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxMsgData(); while (reader.pos < end) { @@ -836,7 +836,7 @@ export const TxMsgData = { } return obj; }, - fromPartial, I>>(object: I): TxMsgData { + fromPartial(object: Partial): TxMsgData { const message = createBaseTxMsgData(); message.data = object.data?.map((e) => MsgData.fromPartial(e)) || []; message.msgResponses = object.msgResponses?.map((e) => Any.fromPartial(e)) || []; @@ -845,29 +845,29 @@ export const TxMsgData = { }; function createBaseSearchTxsResult(): SearchTxsResult { return { - totalCount: Long.UZERO, - count: Long.UZERO, - pageNumber: Long.UZERO, - pageTotal: Long.UZERO, - limit: Long.UZERO, + totalCount: BigInt(0), + count: BigInt(0), + pageNumber: BigInt(0), + pageTotal: BigInt(0), + limit: BigInt(0), txs: [], }; } export const SearchTxsResult = { - encode(message: SearchTxsResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.totalCount.isZero()) { + encode(message: SearchTxsResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCount !== BigInt(0)) { writer.uint32(8).uint64(message.totalCount); } - if (!message.count.isZero()) { + if (message.count !== BigInt(0)) { writer.uint32(16).uint64(message.count); } - if (!message.pageNumber.isZero()) { + if (message.pageNumber !== BigInt(0)) { writer.uint32(24).uint64(message.pageNumber); } - if (!message.pageTotal.isZero()) { + if (message.pageTotal !== BigInt(0)) { writer.uint32(32).uint64(message.pageTotal); } - if (!message.limit.isZero()) { + if (message.limit !== BigInt(0)) { writer.uint32(40).uint64(message.limit); } for (const v of message.txs) { @@ -875,27 +875,27 @@ export const SearchTxsResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SearchTxsResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SearchTxsResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSearchTxsResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.totalCount = reader.uint64() as Long; + message.totalCount = reader.uint64(); break; case 2: - message.count = reader.uint64() as Long; + message.count = reader.uint64(); break; case 3: - message.pageNumber = reader.uint64() as Long; + message.pageNumber = reader.uint64(); break; case 4: - message.pageTotal = reader.uint64() as Long; + message.pageTotal = reader.uint64(); break; case 5: - message.limit = reader.uint64() as Long; + message.limit = reader.uint64(); break; case 6: message.txs.push(TxResponse.decode(reader, reader.uint32())); @@ -909,21 +909,21 @@ export const SearchTxsResult = { }, fromJSON(object: any): SearchTxsResult { const obj = createBaseSearchTxsResult(); - if (isSet(object.totalCount)) obj.totalCount = Long.fromValue(object.totalCount); - if (isSet(object.count)) obj.count = Long.fromValue(object.count); - if (isSet(object.pageNumber)) obj.pageNumber = Long.fromValue(object.pageNumber); - if (isSet(object.pageTotal)) obj.pageTotal = Long.fromValue(object.pageTotal); - if (isSet(object.limit)) obj.limit = Long.fromValue(object.limit); + if (isSet(object.totalCount)) obj.totalCount = BigInt(object.totalCount.toString()); + if (isSet(object.count)) obj.count = BigInt(object.count.toString()); + if (isSet(object.pageNumber)) obj.pageNumber = BigInt(object.pageNumber.toString()); + if (isSet(object.pageTotal)) obj.pageTotal = BigInt(object.pageTotal.toString()); + if (isSet(object.limit)) obj.limit = BigInt(object.limit.toString()); if (Array.isArray(object?.txs)) obj.txs = object.txs.map((e: any) => TxResponse.fromJSON(e)); return obj; }, toJSON(message: SearchTxsResult): unknown { const obj: any = {}; - message.totalCount !== undefined && (obj.totalCount = (message.totalCount || Long.UZERO).toString()); - message.count !== undefined && (obj.count = (message.count || Long.UZERO).toString()); - message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || Long.UZERO).toString()); - message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.totalCount !== undefined && (obj.totalCount = (message.totalCount || BigInt(0)).toString()); + message.count !== undefined && (obj.count = (message.count || BigInt(0)).toString()); + message.pageNumber !== undefined && (obj.pageNumber = (message.pageNumber || BigInt(0)).toString()); + message.pageTotal !== undefined && (obj.pageTotal = (message.pageTotal || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); if (message.txs) { obj.txs = message.txs.map((e) => (e ? TxResponse.toJSON(e) : undefined)); } else { @@ -931,22 +931,22 @@ export const SearchTxsResult = { } return obj; }, - fromPartial, I>>(object: I): SearchTxsResult { + fromPartial(object: Partial): SearchTxsResult { const message = createBaseSearchTxsResult(); if (object.totalCount !== undefined && object.totalCount !== null) { - message.totalCount = Long.fromValue(object.totalCount); + message.totalCount = BigInt(object.totalCount.toString()); } if (object.count !== undefined && object.count !== null) { - message.count = Long.fromValue(object.count); + message.count = BigInt(object.count.toString()); } if (object.pageNumber !== undefined && object.pageNumber !== null) { - message.pageNumber = Long.fromValue(object.pageNumber); + message.pageNumber = BigInt(object.pageNumber.toString()); } if (object.pageTotal !== undefined && object.pageTotal !== null) { - message.pageTotal = Long.fromValue(object.pageTotal); + message.pageTotal = BigInt(object.pageTotal.toString()); } if (object.limit !== undefined && object.limit !== null) { - message.limit = Long.fromValue(object.limit); + message.limit = BigInt(object.limit.toString()); } message.txs = object.txs?.map((e) => TxResponse.fromPartial(e)) || []; return message; diff --git a/src/cosmos/base/kv/v1beta1/kv.ts b/src/cosmos/base/kv/v1beta1/kv.ts index 9ed00ee..80b6196 100644 --- a/src/cosmos/base/kv/v1beta1/kv.ts +++ b/src/cosmos/base/kv/v1beta1/kv.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "cosmos.base.kv.v1beta1"; /** Pairs defines a repeated slice of Pair objects. */ export interface Pairs { @@ -17,14 +17,14 @@ function createBasePairs(): Pairs { }; } export const Pairs = { - encode(message: Pairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Pairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pairs) { Pair.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Pairs { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Pairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePairs(); while (reader.pos < end) { @@ -54,7 +54,7 @@ export const Pairs = { } return obj; }, - fromPartial, I>>(object: I): Pairs { + fromPartial(object: Partial): Pairs { const message = createBasePairs(); message.pairs = object.pairs?.map((e) => Pair.fromPartial(e)) || []; return message; @@ -67,7 +67,7 @@ function createBasePair(): Pair { }; } export const Pair = { - encode(message: Pair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Pair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -76,8 +76,8 @@ export const Pair = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Pair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Pair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePair(); while (reader.pos < end) { @@ -110,7 +110,7 @@ export const Pair = { (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): Pair { + fromPartial(object: Partial): Pair { const message = createBasePair(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); diff --git a/src/cosmos/base/node/v1beta1/query.ts b/src/cosmos/base/node/v1beta1/query.ts index c50fb74..f8d9f92 100644 --- a/src/cosmos/base/node/v1beta1/query.ts +++ b/src/cosmos/base/node/v1beta1/query.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, Rpc } from "../../../../helpers"; export const protobufPackage = "cosmos.base.node.v1beta1"; /** ConfigRequest defines the request structure for the Config gRPC query. */ export interface ConfigRequest {} @@ -12,11 +12,11 @@ function createBaseConfigRequest(): ConfigRequest { return {}; } export const ConfigRequest = { - encode(_: ConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: ConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConfigRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfigRequest(); while (reader.pos < end) { @@ -37,7 +37,7 @@ export const ConfigRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): ConfigRequest { + fromPartial(_: Partial): ConfigRequest { const message = createBaseConfigRequest(); return message; }, @@ -48,14 +48,14 @@ function createBaseConfigResponse(): ConfigResponse { }; } export const ConfigResponse = { - encode(message: ConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minimumGasPrice !== "") { writer.uint32(10).string(message.minimumGasPrice); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfigResponse(); while (reader.pos < end) { @@ -81,7 +81,7 @@ export const ConfigResponse = { message.minimumGasPrice !== undefined && (obj.minimumGasPrice = message.minimumGasPrice); return obj; }, - fromPartial, I>>(object: I): ConfigResponse { + fromPartial(object: Partial): ConfigResponse { const message = createBaseConfigResponse(); message.minimumGasPrice = object.minimumGasPrice ?? ""; return message; @@ -101,6 +101,6 @@ export class ServiceClientImpl implements Service { Config(request: ConfigRequest = {}): Promise { const data = ConfigRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data); - return promise.then((data) => ConfigResponse.decode(new _m0.Reader(data))); + return promise.then((data) => ConfigResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/base/query/v1beta1/pagination.ts b/src/cosmos/base/query/v1beta1/pagination.ts index 0990330..8295de7 100644 --- a/src/cosmos/base/query/v1beta1/pagination.ts +++ b/src/cosmos/base/query/v1beta1/pagination.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "cosmos.base.query.v1beta1"; /** * PageRequest is to be embedded in gRPC request messages for efficient @@ -23,12 +23,12 @@ export interface PageRequest { * It is less efficient than using key. Only one of offset or key should * be set. */ - offset: Long; + offset: bigint; /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: Long; + limit: bigint; /** * 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. @@ -63,26 +63,26 @@ export interface PageResponse { * total is total number of results available if PageRequest.count_total * was set, its value is undefined otherwise */ - total: Long; + total: bigint; } function createBasePageRequest(): PageRequest { return { key: new Uint8Array(), - offset: Long.UZERO, - limit: Long.UZERO, + offset: BigInt(0), + limit: BigInt(0), countTotal: false, reverse: false, }; } export const PageRequest = { - encode(message: PageRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PageRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } - if (!message.offset.isZero()) { + if (message.offset !== BigInt(0)) { writer.uint32(16).uint64(message.offset); } - if (!message.limit.isZero()) { + if (message.limit !== BigInt(0)) { writer.uint32(24).uint64(message.limit); } if (message.countTotal === true) { @@ -93,8 +93,8 @@ export const PageRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PageRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePageRequest(); while (reader.pos < end) { @@ -104,10 +104,10 @@ export const PageRequest = { message.key = reader.bytes(); break; case 2: - message.offset = reader.uint64() as Long; + message.offset = reader.uint64(); break; case 3: - message.limit = reader.uint64() as Long; + message.limit = reader.uint64(); break; case 4: message.countTotal = reader.bool(); @@ -125,8 +125,8 @@ export const PageRequest = { fromJSON(object: any): PageRequest { const obj = createBasePageRequest(); if (isSet(object.key)) obj.key = bytesFromBase64(object.key); - if (isSet(object.offset)) obj.offset = Long.fromValue(object.offset); - if (isSet(object.limit)) obj.limit = Long.fromValue(object.limit); + if (isSet(object.offset)) obj.offset = BigInt(object.offset.toString()); + if (isSet(object.limit)) obj.limit = BigInt(object.limit.toString()); if (isSet(object.countTotal)) obj.countTotal = Boolean(object.countTotal); if (isSet(object.reverse)) obj.reverse = Boolean(object.reverse); return obj; @@ -135,20 +135,20 @@ export const PageRequest = { const obj: any = {}; message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); - message.offset !== undefined && (obj.offset = (message.offset || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.offset !== undefined && (obj.offset = (message.offset || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); message.countTotal !== undefined && (obj.countTotal = message.countTotal); message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, - fromPartial, I>>(object: I): PageRequest { + fromPartial(object: Partial): PageRequest { const message = createBasePageRequest(); message.key = object.key ?? new Uint8Array(); if (object.offset !== undefined && object.offset !== null) { - message.offset = Long.fromValue(object.offset); + message.offset = BigInt(object.offset.toString()); } if (object.limit !== undefined && object.limit !== null) { - message.limit = Long.fromValue(object.limit); + message.limit = BigInt(object.limit.toString()); } message.countTotal = object.countTotal ?? false; message.reverse = object.reverse ?? false; @@ -158,21 +158,21 @@ export const PageRequest = { function createBasePageResponse(): PageResponse { return { nextKey: new Uint8Array(), - total: Long.UZERO, + total: BigInt(0), }; } export const PageResponse = { - encode(message: PageResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PageResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nextKey.length !== 0) { writer.uint32(10).bytes(message.nextKey); } - if (!message.total.isZero()) { + if (message.total !== BigInt(0)) { writer.uint32(16).uint64(message.total); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PageResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePageResponse(); while (reader.pos < end) { @@ -182,7 +182,7 @@ export const PageResponse = { message.nextKey = reader.bytes(); break; case 2: - message.total = reader.uint64() as Long; + message.total = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -194,21 +194,21 @@ export const PageResponse = { fromJSON(object: any): PageResponse { const obj = createBasePageResponse(); if (isSet(object.nextKey)) obj.nextKey = bytesFromBase64(object.nextKey); - if (isSet(object.total)) obj.total = Long.fromValue(object.total); + if (isSet(object.total)) obj.total = BigInt(object.total.toString()); return obj; }, toJSON(message: PageResponse): unknown { const obj: any = {}; message.nextKey !== undefined && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): PageResponse { + fromPartial(object: Partial): PageResponse { const message = createBasePageResponse(); message.nextKey = object.nextKey ?? new Uint8Array(); if (object.total !== undefined && object.total !== null) { - message.total = Long.fromValue(object.total); + message.total = BigInt(object.total.toString()); } return message; }, diff --git a/src/cosmos/base/reflection/v1beta1/reflection.ts b/src/cosmos/base/reflection/v1beta1/reflection.ts index 6d04849..4d342cd 100644 --- a/src/cosmos/base/reflection/v1beta1/reflection.ts +++ b/src/cosmos/base/reflection/v1beta1/reflection.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, Rpc } from "../../../../helpers"; export const protobufPackage = "cosmos.base.reflection.v1beta1"; /** ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. */ export interface ListAllInterfacesRequest {} @@ -28,11 +28,11 @@ function createBaseListAllInterfacesRequest(): ListAllInterfacesRequest { return {}; } export const ListAllInterfacesRequest = { - encode(_: ListAllInterfacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: ListAllInterfacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListAllInterfacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListAllInterfacesRequest(); while (reader.pos < end) { @@ -53,7 +53,7 @@ export const ListAllInterfacesRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): ListAllInterfacesRequest { + fromPartial(_: Partial): ListAllInterfacesRequest { const message = createBaseListAllInterfacesRequest(); return message; }, @@ -64,14 +64,14 @@ function createBaseListAllInterfacesResponse(): ListAllInterfacesResponse { }; } export const ListAllInterfacesResponse = { - encode(message: ListAllInterfacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListAllInterfacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.interfaceNames) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListAllInterfacesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListAllInterfacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListAllInterfacesResponse(); while (reader.pos < end) { @@ -102,9 +102,7 @@ export const ListAllInterfacesResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): ListAllInterfacesResponse { + fromPartial(object: Partial): ListAllInterfacesResponse { const message = createBaseListAllInterfacesResponse(); message.interfaceNames = object.interfaceNames?.map((e) => e) || []; return message; @@ -116,14 +114,14 @@ function createBaseListImplementationsRequest(): ListImplementationsRequest { }; } export const ListImplementationsRequest = { - encode(message: ListImplementationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListImplementationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.interfaceName !== "") { writer.uint32(10).string(message.interfaceName); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListImplementationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListImplementationsRequest(); while (reader.pos < end) { @@ -149,9 +147,7 @@ export const ListImplementationsRequest = { message.interfaceName !== undefined && (obj.interfaceName = message.interfaceName); return obj; }, - fromPartial, I>>( - object: I, - ): ListImplementationsRequest { + fromPartial(object: Partial): ListImplementationsRequest { const message = createBaseListImplementationsRequest(); message.interfaceName = object.interfaceName ?? ""; return message; @@ -163,14 +159,14 @@ function createBaseListImplementationsResponse(): ListImplementationsResponse { }; } export const ListImplementationsResponse = { - encode(message: ListImplementationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListImplementationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.implementationMessageNames) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListImplementationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListImplementationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListImplementationsResponse(); while (reader.pos < end) { @@ -201,9 +197,7 @@ export const ListImplementationsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): ListImplementationsResponse { + fromPartial(object: Partial): ListImplementationsResponse { const message = createBaseListImplementationsResponse(); message.implementationMessageNames = object.implementationMessageNames?.map((e) => e) || []; return message; @@ -236,7 +230,7 @@ export class ReflectionServiceClientImpl implements ReflectionService { "ListAllInterfaces", data, ); - return promise.then((data) => ListAllInterfacesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => ListAllInterfacesResponse.decode(new BinaryReader(data))); } ListImplementations(request: ListImplementationsRequest): Promise { const data = ListImplementationsRequest.encode(request).finish(); @@ -245,6 +239,6 @@ export class ReflectionServiceClientImpl implements ReflectionService { "ListImplementations", data, ); - return promise.then((data) => ListImplementationsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => ListImplementationsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/base/snapshots/v1beta1/snapshot.ts b/src/cosmos/base/snapshots/v1beta1/snapshot.ts index 89bc0fe..1879e30 100644 --- a/src/cosmos/base/snapshots/v1beta1/snapshot.ts +++ b/src/cosmos/base/snapshots/v1beta1/snapshot.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "cosmos.base.snapshots.v1beta1"; /** Snapshot contains Tendermint state sync snapshot info. */ export interface Snapshot { - height: Long; + height: bigint; format: number; chunks: number; hash: Uint8Array; @@ -47,7 +47,7 @@ export interface SnapshotIAVLItem { key: Uint8Array; value: Uint8Array; /** version is block height */ - version: Long; + version: bigint; /** height is depth of the tree. */ height: number; } @@ -91,7 +91,7 @@ export interface SnapshotSchema { } function createBaseSnapshot(): Snapshot { return { - height: Long.UZERO, + height: BigInt(0), format: 0, chunks: 0, hash: new Uint8Array(), @@ -99,8 +99,8 @@ function createBaseSnapshot(): Snapshot { }; } export const Snapshot = { - encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { @@ -117,15 +117,15 @@ export const Snapshot = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.uint64() as Long; + message.height = reader.uint64(); break; case 2: message.format = reader.uint32(); @@ -148,7 +148,7 @@ export const Snapshot = { }, fromJSON(object: any): Snapshot { const obj = createBaseSnapshot(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.format)) obj.format = Number(object.format); if (isSet(object.chunks)) obj.chunks = Number(object.chunks); if (isSet(object.hash)) obj.hash = bytesFromBase64(object.hash); @@ -157,7 +157,7 @@ export const Snapshot = { }, toJSON(message: Snapshot): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.format !== undefined && (obj.format = Math.round(message.format)); message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); message.hash !== undefined && @@ -166,10 +166,10 @@ export const Snapshot = { (obj.metadata = message.metadata ? Metadata.toJSON(message.metadata) : undefined); return obj; }, - fromPartial, I>>(object: I): Snapshot { + fromPartial(object: Partial): Snapshot { const message = createBaseSnapshot(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.format = object.format ?? 0; message.chunks = object.chunks ?? 0; @@ -186,14 +186,14 @@ function createBaseMetadata(): Metadata { }; } export const Metadata = { - encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.chunkHashes) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMetadata(); while (reader.pos < end) { @@ -226,7 +226,7 @@ export const Metadata = { } return obj; }, - fromPartial, I>>(object: I): Metadata { + fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.chunkHashes = object.chunkHashes?.map((e) => e) || []; return message; @@ -243,7 +243,7 @@ function createBaseSnapshotItem(): SnapshotItem { }; } export const SnapshotItem = { - encode(message: SnapshotItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.store !== undefined) { SnapshotStoreItem.encode(message.store, writer.uint32(10).fork()).ldelim(); } @@ -264,8 +264,8 @@ export const SnapshotItem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotItem(); while (reader.pos < end) { @@ -324,7 +324,7 @@ export const SnapshotItem = { (obj.schema = message.schema ? SnapshotSchema.toJSON(message.schema) : undefined); return obj; }, - fromPartial, I>>(object: I): SnapshotItem { + fromPartial(object: Partial): SnapshotItem { const message = createBaseSnapshotItem(); if (object.store !== undefined && object.store !== null) { message.store = SnapshotStoreItem.fromPartial(object.store); @@ -353,14 +353,14 @@ function createBaseSnapshotStoreItem(): SnapshotStoreItem { }; } export const SnapshotStoreItem = { - encode(message: SnapshotStoreItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotStoreItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotStoreItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotStoreItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotStoreItem(); while (reader.pos < end) { @@ -386,7 +386,7 @@ export const SnapshotStoreItem = { message.name !== undefined && (obj.name = message.name); return obj; }, - fromPartial, I>>(object: I): SnapshotStoreItem { + fromPartial(object: Partial): SnapshotStoreItem { const message = createBaseSnapshotStoreItem(); message.name = object.name ?? ""; return message; @@ -396,19 +396,19 @@ function createBaseSnapshotIAVLItem(): SnapshotIAVLItem { return { key: new Uint8Array(), value: new Uint8Array(), - version: Long.ZERO, + version: BigInt(0), height: 0, }; } export const SnapshotIAVLItem = { - encode(message: SnapshotIAVLItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotIAVLItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } if (message.value.length !== 0) { writer.uint32(18).bytes(message.value); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(24).int64(message.version); } if (message.height !== 0) { @@ -416,8 +416,8 @@ export const SnapshotIAVLItem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotIAVLItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotIAVLItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotIAVLItem(); while (reader.pos < end) { @@ -430,7 +430,7 @@ export const SnapshotIAVLItem = { message.value = reader.bytes(); break; case 3: - message.version = reader.int64() as Long; + message.version = reader.int64(); break; case 4: message.height = reader.int32(); @@ -446,7 +446,7 @@ export const SnapshotIAVLItem = { const obj = createBaseSnapshotIAVLItem(); if (isSet(object.key)) obj.key = bytesFromBase64(object.key); if (isSet(object.value)) obj.value = bytesFromBase64(object.value); - if (isSet(object.version)) obj.version = Long.fromValue(object.version); + if (isSet(object.version)) obj.version = BigInt(object.version.toString()); if (isSet(object.height)) obj.height = Number(object.height); return obj; }, @@ -456,16 +456,16 @@ export const SnapshotIAVLItem = { (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.height !== undefined && (obj.height = Math.round(message.height)); return obj; }, - fromPartial, I>>(object: I): SnapshotIAVLItem { + fromPartial(object: Partial): SnapshotIAVLItem { const message = createBaseSnapshotIAVLItem(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); if (object.version !== undefined && object.version !== null) { - message.version = Long.fromValue(object.version); + message.version = BigInt(object.version.toString()); } message.height = object.height ?? 0; return message; @@ -478,7 +478,7 @@ function createBaseSnapshotExtensionMeta(): SnapshotExtensionMeta { }; } export const SnapshotExtensionMeta = { - encode(message: SnapshotExtensionMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotExtensionMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -487,8 +487,8 @@ export const SnapshotExtensionMeta = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotExtensionMeta { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotExtensionMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotExtensionMeta(); while (reader.pos < end) { @@ -519,7 +519,7 @@ export const SnapshotExtensionMeta = { message.format !== undefined && (obj.format = Math.round(message.format)); return obj; }, - fromPartial, I>>(object: I): SnapshotExtensionMeta { + fromPartial(object: Partial): SnapshotExtensionMeta { const message = createBaseSnapshotExtensionMeta(); message.name = object.name ?? ""; message.format = object.format ?? 0; @@ -532,14 +532,14 @@ function createBaseSnapshotExtensionPayload(): SnapshotExtensionPayload { }; } export const SnapshotExtensionPayload = { - encode(message: SnapshotExtensionPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotExtensionPayload, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.payload.length !== 0) { writer.uint32(10).bytes(message.payload); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotExtensionPayload { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotExtensionPayload { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotExtensionPayload(); while (reader.pos < end) { @@ -566,9 +566,7 @@ export const SnapshotExtensionPayload = { (obj.payload = base64FromBytes(message.payload !== undefined ? message.payload : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): SnapshotExtensionPayload { + fromPartial(object: Partial): SnapshotExtensionPayload { const message = createBaseSnapshotExtensionPayload(); message.payload = object.payload ?? new Uint8Array(); return message; @@ -581,7 +579,7 @@ function createBaseSnapshotKVItem(): SnapshotKVItem { }; } export const SnapshotKVItem = { - encode(message: SnapshotKVItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotKVItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -590,8 +588,8 @@ export const SnapshotKVItem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotKVItem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotKVItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotKVItem(); while (reader.pos < end) { @@ -624,7 +622,7 @@ export const SnapshotKVItem = { (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): SnapshotKVItem { + fromPartial(object: Partial): SnapshotKVItem { const message = createBaseSnapshotKVItem(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); @@ -637,14 +635,14 @@ function createBaseSnapshotSchema(): SnapshotSchema { }; } export const SnapshotSchema = { - encode(message: SnapshotSchema, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SnapshotSchema, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.keys) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SnapshotSchema { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotSchema { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshotSchema(); while (reader.pos < end) { @@ -674,7 +672,7 @@ export const SnapshotSchema = { } return obj; }, - fromPartial, I>>(object: I): SnapshotSchema { + fromPartial(object: Partial): SnapshotSchema { const message = createBaseSnapshotSchema(); message.keys = object.keys?.map((e) => e) || []; return message; diff --git a/src/cosmos/base/store/v1beta1/commit_info.ts b/src/cosmos/base/store/v1beta1/commit_info.ts index 8add2bf..013c8af 100644 --- a/src/cosmos/base/store/v1beta1/commit_info.ts +++ b/src/cosmos/base/store/v1beta1/commit_info.ts @@ -1,23 +1,20 @@ /* eslint-disable */ import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { - Long, isSet, fromJsonTimestamp, fromTimestamp, - DeepPartial, - Exact, bytesFromBase64, base64FromBytes, } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.store.v1beta1"; /** * CommitInfo defines commit information used by the multi-store when committing * a version/height. */ export interface CommitInfo { - version: Long; + version: bigint; storeInfos: StoreInfo[]; timestamp: Timestamp; } @@ -34,19 +31,19 @@ export interface StoreInfo { * committed. */ export interface CommitID { - version: Long; + version: bigint; hash: Uint8Array; } function createBaseCommitInfo(): CommitInfo { return { - version: Long.ZERO, + version: BigInt(0), storeInfos: [], timestamp: Timestamp.fromPartial({}), }; } export const CommitInfo = { - encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.version.isZero()) { + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== BigInt(0)) { writer.uint32(8).int64(message.version); } for (const v of message.storeInfos) { @@ -57,15 +54,15 @@ export const CommitInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.int64() as Long; + message.version = reader.int64(); break; case 2: message.storeInfos.push(StoreInfo.decode(reader, reader.uint32())); @@ -82,7 +79,7 @@ export const CommitInfo = { }, fromJSON(object: any): CommitInfo { const obj = createBaseCommitInfo(); - if (isSet(object.version)) obj.version = Long.fromValue(object.version); + if (isSet(object.version)) obj.version = BigInt(object.version.toString()); if (Array.isArray(object?.storeInfos)) obj.storeInfos = object.storeInfos.map((e: any) => StoreInfo.fromJSON(e)); if (isSet(object.timestamp)) obj.timestamp = fromJsonTimestamp(object.timestamp); @@ -90,7 +87,7 @@ export const CommitInfo = { }, toJSON(message: CommitInfo): unknown { const obj: any = {}; - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); if (message.storeInfos) { obj.storeInfos = message.storeInfos.map((e) => (e ? StoreInfo.toJSON(e) : undefined)); } else { @@ -99,10 +96,10 @@ export const CommitInfo = { message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); return obj; }, - fromPartial, I>>(object: I): CommitInfo { + fromPartial(object: Partial): CommitInfo { const message = createBaseCommitInfo(); if (object.version !== undefined && object.version !== null) { - message.version = Long.fromValue(object.version); + message.version = BigInt(object.version.toString()); } message.storeInfos = object.storeInfos?.map((e) => StoreInfo.fromPartial(e)) || []; if (object.timestamp !== undefined && object.timestamp !== null) { @@ -118,7 +115,7 @@ function createBaseStoreInfo(): StoreInfo { }; } export const StoreInfo = { - encode(message: StoreInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StoreInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -127,8 +124,8 @@ export const StoreInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreInfo(); while (reader.pos < end) { @@ -160,7 +157,7 @@ export const StoreInfo = { (obj.commitId = message.commitId ? CommitID.toJSON(message.commitId) : undefined); return obj; }, - fromPartial, I>>(object: I): StoreInfo { + fromPartial(object: Partial): StoreInfo { const message = createBaseStoreInfo(); message.name = object.name ?? ""; if (object.commitId !== undefined && object.commitId !== null) { @@ -171,13 +168,13 @@ export const StoreInfo = { }; function createBaseCommitID(): CommitID { return { - version: Long.ZERO, + version: BigInt(0), hash: new Uint8Array(), }; } export const CommitID = { - encode(message: CommitID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.version.isZero()) { + encode(message: CommitID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== BigInt(0)) { writer.uint32(8).int64(message.version); } if (message.hash.length !== 0) { @@ -185,15 +182,15 @@ export const CommitID = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitID(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.int64() as Long; + message.version = reader.int64(); break; case 2: message.hash = reader.bytes(); @@ -207,21 +204,21 @@ export const CommitID = { }, fromJSON(object: any): CommitID { const obj = createBaseCommitID(); - if (isSet(object.version)) obj.version = Long.fromValue(object.version); + if (isSet(object.version)) obj.version = BigInt(object.version.toString()); if (isSet(object.hash)) obj.hash = bytesFromBase64(object.hash); return obj; }, toJSON(message: CommitID): unknown { const obj: any = {}; - message.version !== undefined && (obj.version = (message.version || Long.ZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): CommitID { + fromPartial(object: Partial): CommitID { const message = createBaseCommitID(); if (object.version !== undefined && object.version !== null) { - message.version = Long.fromValue(object.version); + message.version = BigInt(object.version.toString()); } message.hash = object.hash ?? new Uint8Array(); return message; diff --git a/src/cosmos/base/store/v1beta1/listening.ts b/src/cosmos/base/store/v1beta1/listening.ts index 1222351..131cf1f 100644 --- a/src/cosmos/base/store/v1beta1/listening.ts +++ b/src/cosmos/base/store/v1beta1/listening.ts @@ -8,8 +8,8 @@ import { ResponseEndBlock, ResponseCommit, } from "../../../../tendermint/abci/types"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "cosmos.base.store.v1beta1"; /** * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) @@ -52,7 +52,7 @@ function createBaseStoreKVPair(): StoreKVPair { }; } export const StoreKVPair = { - encode(message: StoreKVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StoreKVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.storeKey !== "") { writer.uint32(10).string(message.storeKey); } @@ -67,8 +67,8 @@ export const StoreKVPair = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreKVPair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreKVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreKVPair(); while (reader.pos < end) { @@ -111,7 +111,7 @@ export const StoreKVPair = { (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): StoreKVPair { + fromPartial(object: Partial): StoreKVPair { const message = createBaseStoreKVPair(); message.storeKey = object.storeKey ?? ""; message.delete = object.delete ?? false; @@ -131,7 +131,7 @@ function createBaseBlockMetadata(): BlockMetadata { }; } export const BlockMetadata = { - encode(message: BlockMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BlockMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.requestBeginBlock !== undefined) { RequestBeginBlock.encode(message.requestBeginBlock, writer.uint32(10).fork()).ldelim(); } @@ -152,8 +152,8 @@ export const BlockMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockMetadata(); while (reader.pos < end) { @@ -227,7 +227,7 @@ export const BlockMetadata = { : undefined); return obj; }, - fromPartial, I>>(object: I): BlockMetadata { + fromPartial(object: Partial): BlockMetadata { const message = createBaseBlockMetadata(); if (object.requestBeginBlock !== undefined && object.requestBeginBlock !== null) { message.requestBeginBlock = RequestBeginBlock.fromPartial(object.requestBeginBlock); @@ -255,7 +255,7 @@ function createBaseBlockMetadata_DeliverTx(): BlockMetadata_DeliverTx { }; } export const BlockMetadata_DeliverTx = { - encode(message: BlockMetadata_DeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BlockMetadata_DeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.request !== undefined) { RequestDeliverTx.encode(message.request, writer.uint32(10).fork()).ldelim(); } @@ -264,8 +264,8 @@ export const BlockMetadata_DeliverTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockMetadata_DeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockMetadata_DeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockMetadata_DeliverTx(); while (reader.pos < end) { @@ -298,7 +298,7 @@ export const BlockMetadata_DeliverTx = { (obj.response = message.response ? ResponseDeliverTx.toJSON(message.response) : undefined); return obj; }, - fromPartial, I>>(object: I): BlockMetadata_DeliverTx { + fromPartial(object: Partial): BlockMetadata_DeliverTx { const message = createBaseBlockMetadata_DeliverTx(); if (object.request !== undefined && object.request !== null) { message.request = RequestDeliverTx.fromPartial(object.request); diff --git a/src/cosmos/base/tendermint/v1beta1/query.ts b/src/cosmos/base/tendermint/v1beta1/query.ts index cb90628..5edd6d5 100644 --- a/src/cosmos/base/tendermint/v1beta1/query.ts +++ b/src/cosmos/base/tendermint/v1beta1/query.ts @@ -5,18 +5,18 @@ import { BlockID } from "../../../../tendermint/types/types"; import { Block as Block1 } from "../../../../tendermint/types/block"; import { Block as Block2 } from "./types"; import { DefaultNodeInfo } from "../../../../tendermint/p2p/types"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "cosmos.base.tendermint.v1beta1"; /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { - height: Long; + height: bigint; /** pagination defines an pagination for the request. */ pagination: PageRequest; } /** GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightResponse { - blockHeight: Long; + blockHeight: bigint; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination: PageResponse; @@ -28,7 +28,7 @@ export interface GetLatestValidatorSetRequest { } /** GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetResponse { - blockHeight: Long; + blockHeight: bigint; validators: Validator[]; /** pagination defines an pagination for the response. */ pagination: PageResponse; @@ -37,12 +37,12 @@ export interface GetLatestValidatorSetResponse { export interface Validator { address: string; pubKey: Any; - votingPower: Long; - proposerPriority: Long; + votingPower: bigint; + proposerPriority: bigint; } /** GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightRequest { - height: Long; + height: bigint; } /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponse { @@ -100,7 +100,7 @@ export interface Module { export interface ABCIQueryRequest { data: Uint8Array; path: string; - height: Long; + height: bigint; prove: boolean; } /** @@ -115,11 +115,11 @@ export interface ABCIQueryResponse { log: string; /** nondeterministic */ info: string; - index: Long; + index: bigint; key: Uint8Array; value: Uint8Array; proofOps: ProofOps; - height: Long; + height: bigint; codespace: string; } /** @@ -144,13 +144,16 @@ export interface ProofOps { } function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { return { - height: Long.ZERO, + height: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const GetValidatorSetByHeightRequest = { - encode(message: GetValidatorSetByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode( + message: GetValidatorSetByHeightRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { @@ -158,15 +161,15 @@ export const GetValidatorSetByHeightRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetValidatorSetByHeightRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -180,23 +183,21 @@ export const GetValidatorSetByHeightRequest = { }, fromJSON(object: any): GetValidatorSetByHeightRequest { const obj = createBaseGetValidatorSetByHeightRequest(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: GetValidatorSetByHeightRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): GetValidatorSetByHeightRequest { + fromPartial(object: Partial): GetValidatorSetByHeightRequest { const message = createBaseGetValidatorSetByHeightRequest(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -206,14 +207,17 @@ export const GetValidatorSetByHeightRequest = { }; function createBaseGetValidatorSetByHeightResponse(): GetValidatorSetByHeightResponse { return { - blockHeight: Long.ZERO, + blockHeight: BigInt(0), validators: [], pagination: PageResponse.fromPartial({}), }; } export const GetValidatorSetByHeightResponse = { - encode(message: GetValidatorSetByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockHeight.isZero()) { + encode( + message: GetValidatorSetByHeightResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { @@ -224,15 +228,15 @@ export const GetValidatorSetByHeightResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetValidatorSetByHeightResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetValidatorSetByHeightResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockHeight = reader.int64() as Long; + message.blockHeight = reader.int64(); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -249,7 +253,7 @@ export const GetValidatorSetByHeightResponse = { }, fromJSON(object: any): GetValidatorSetByHeightResponse { const obj = createBaseGetValidatorSetByHeightResponse(); - if (isSet(object.blockHeight)) obj.blockHeight = Long.fromValue(object.blockHeight); + if (isSet(object.blockHeight)) obj.blockHeight = BigInt(object.blockHeight.toString()); if (Array.isArray(object?.validators)) obj.validators = object.validators.map((e: any) => Validator.fromJSON(e)); if (isSet(object.pagination)) obj.pagination = PageResponse.fromJSON(object.pagination); @@ -257,7 +261,7 @@ export const GetValidatorSetByHeightResponse = { }, toJSON(message: GetValidatorSetByHeightResponse): unknown { const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); if (message.validators) { obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); } else { @@ -267,12 +271,10 @@ export const GetValidatorSetByHeightResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): GetValidatorSetByHeightResponse { + fromPartial(object: Partial): GetValidatorSetByHeightResponse { const message = createBaseGetValidatorSetByHeightResponse(); if (object.blockHeight !== undefined && object.blockHeight !== null) { - message.blockHeight = Long.fromValue(object.blockHeight); + message.blockHeight = BigInt(object.blockHeight.toString()); } message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -287,14 +289,14 @@ function createBaseGetLatestValidatorSetRequest(): GetLatestValidatorSetRequest }; } export const GetLatestValidatorSetRequest = { - encode(message: GetLatestValidatorSetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetLatestValidatorSetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestValidatorSetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetRequest(); while (reader.pos < end) { @@ -321,9 +323,7 @@ export const GetLatestValidatorSetRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): GetLatestValidatorSetRequest { + fromPartial(object: Partial): GetLatestValidatorSetRequest { const message = createBaseGetLatestValidatorSetRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -333,14 +333,14 @@ export const GetLatestValidatorSetRequest = { }; function createBaseGetLatestValidatorSetResponse(): GetLatestValidatorSetResponse { return { - blockHeight: Long.ZERO, + blockHeight: BigInt(0), validators: [], pagination: PageResponse.fromPartial({}), }; } export const GetLatestValidatorSetResponse = { - encode(message: GetLatestValidatorSetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockHeight.isZero()) { + encode(message: GetLatestValidatorSetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { writer.uint32(8).int64(message.blockHeight); } for (const v of message.validators) { @@ -351,15 +351,15 @@ export const GetLatestValidatorSetResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestValidatorSetResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestValidatorSetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestValidatorSetResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockHeight = reader.int64() as Long; + message.blockHeight = reader.int64(); break; case 2: message.validators.push(Validator.decode(reader, reader.uint32())); @@ -376,7 +376,7 @@ export const GetLatestValidatorSetResponse = { }, fromJSON(object: any): GetLatestValidatorSetResponse { const obj = createBaseGetLatestValidatorSetResponse(); - if (isSet(object.blockHeight)) obj.blockHeight = Long.fromValue(object.blockHeight); + if (isSet(object.blockHeight)) obj.blockHeight = BigInt(object.blockHeight.toString()); if (Array.isArray(object?.validators)) obj.validators = object.validators.map((e: any) => Validator.fromJSON(e)); if (isSet(object.pagination)) obj.pagination = PageResponse.fromJSON(object.pagination); @@ -384,7 +384,7 @@ export const GetLatestValidatorSetResponse = { }, toJSON(message: GetLatestValidatorSetResponse): unknown { const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.ZERO).toString()); + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); if (message.validators) { obj.validators = message.validators.map((e) => (e ? Validator.toJSON(e) : undefined)); } else { @@ -394,12 +394,10 @@ export const GetLatestValidatorSetResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): GetLatestValidatorSetResponse { + fromPartial(object: Partial): GetLatestValidatorSetResponse { const message = createBaseGetLatestValidatorSetResponse(); if (object.blockHeight !== undefined && object.blockHeight !== null) { - message.blockHeight = Long.fromValue(object.blockHeight); + message.blockHeight = BigInt(object.blockHeight.toString()); } message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -412,28 +410,28 @@ function createBaseValidator(): Validator { return { address: "", pubKey: Any.fromPartial({}), - votingPower: Long.ZERO, - proposerPriority: Long.ZERO, + votingPower: BigInt(0), + proposerPriority: BigInt(0), }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } if (message.pubKey !== undefined) { Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (!message.votingPower.isZero()) { + if (message.votingPower !== BigInt(0)) { writer.uint32(24).int64(message.votingPower); } - if (!message.proposerPriority.isZero()) { + if (message.proposerPriority !== BigInt(0)) { writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -446,10 +444,10 @@ export const Validator = { message.pubKey = Any.decode(reader, reader.uint32()); break; case 3: - message.votingPower = reader.int64() as Long; + message.votingPower = reader.int64(); break; case 4: - message.proposerPriority = reader.int64() as Long; + message.proposerPriority = reader.int64(); break; default: reader.skipType(tag & 7); @@ -462,55 +460,55 @@ export const Validator = { const obj = createBaseValidator(); if (isSet(object.address)) obj.address = String(object.address); if (isSet(object.pubKey)) obj.pubKey = Any.fromJSON(object.pubKey); - if (isSet(object.votingPower)) obj.votingPower = Long.fromValue(object.votingPower); - if (isSet(object.proposerPriority)) obj.proposerPriority = Long.fromValue(object.proposerPriority); + if (isSet(object.votingPower)) obj.votingPower = BigInt(object.votingPower.toString()); + if (isSet(object.proposerPriority)) obj.proposerPriority = BigInt(object.proposerPriority.toString()); return obj; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? Any.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || BigInt(0)).toString()); message.proposerPriority !== undefined && - (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + (obj.proposerPriority = (message.proposerPriority || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Validator { + fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? ""; if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = Any.fromPartial(object.pubKey); } if (object.votingPower !== undefined && object.votingPower !== null) { - message.votingPower = Long.fromValue(object.votingPower); + message.votingPower = BigInt(object.votingPower.toString()); } if (object.proposerPriority !== undefined && object.proposerPriority !== null) { - message.proposerPriority = Long.fromValue(object.proposerPriority); + message.proposerPriority = BigInt(object.proposerPriority.toString()); } return message; }, }; function createBaseGetBlockByHeightRequest(): GetBlockByHeightRequest { return { - height: Long.ZERO, + height: BigInt(0), }; } export const GetBlockByHeightRequest = { - encode(message: GetBlockByHeightRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: GetBlockByHeightRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockByHeightRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -521,18 +519,18 @@ export const GetBlockByHeightRequest = { }, fromJSON(object: any): GetBlockByHeightRequest { const obj = createBaseGetBlockByHeightRequest(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); return obj; }, toJSON(message: GetBlockByHeightRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): GetBlockByHeightRequest { + fromPartial(object: Partial): GetBlockByHeightRequest { const message = createBaseGetBlockByHeightRequest(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } return message; }, @@ -545,7 +543,7 @@ function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { }; } export const GetBlockByHeightResponse = { - encode(message: GetBlockByHeightResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetBlockByHeightResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } @@ -557,8 +555,8 @@ export const GetBlockByHeightResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockByHeightResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockByHeightResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockByHeightResponse(); while (reader.pos < end) { @@ -596,9 +594,7 @@ export const GetBlockByHeightResponse = { (obj.sdkBlock = message.sdkBlock ? Block2.toJSON(message.sdkBlock) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): GetBlockByHeightResponse { + fromPartial(object: Partial): GetBlockByHeightResponse { const message = createBaseGetBlockByHeightResponse(); if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromPartial(object.blockId); @@ -616,11 +612,11 @@ function createBaseGetLatestBlockRequest(): GetLatestBlockRequest { return {}; } export const GetLatestBlockRequest = { - encode(_: GetLatestBlockRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: GetLatestBlockRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestBlockRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockRequest(); while (reader.pos < end) { @@ -641,7 +637,7 @@ export const GetLatestBlockRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): GetLatestBlockRequest { + fromPartial(_: Partial): GetLatestBlockRequest { const message = createBaseGetLatestBlockRequest(); return message; }, @@ -654,7 +650,7 @@ function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { }; } export const GetLatestBlockResponse = { - encode(message: GetLatestBlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetLatestBlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } @@ -666,8 +662,8 @@ export const GetLatestBlockResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetLatestBlockResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetLatestBlockResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetLatestBlockResponse(); while (reader.pos < end) { @@ -705,7 +701,7 @@ export const GetLatestBlockResponse = { (obj.sdkBlock = message.sdkBlock ? Block2.toJSON(message.sdkBlock) : undefined); return obj; }, - fromPartial, I>>(object: I): GetLatestBlockResponse { + fromPartial(object: Partial): GetLatestBlockResponse { const message = createBaseGetLatestBlockResponse(); if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromPartial(object.blockId); @@ -723,11 +719,11 @@ function createBaseGetSyncingRequest(): GetSyncingRequest { return {}; } export const GetSyncingRequest = { - encode(_: GetSyncingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: GetSyncingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetSyncingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingRequest(); while (reader.pos < end) { @@ -748,7 +744,7 @@ export const GetSyncingRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): GetSyncingRequest { + fromPartial(_: Partial): GetSyncingRequest { const message = createBaseGetSyncingRequest(); return message; }, @@ -759,14 +755,14 @@ function createBaseGetSyncingResponse(): GetSyncingResponse { }; } export const GetSyncingResponse = { - encode(message: GetSyncingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetSyncingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.syncing === true) { writer.uint32(8).bool(message.syncing); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetSyncingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetSyncingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetSyncingResponse(); while (reader.pos < end) { @@ -792,7 +788,7 @@ export const GetSyncingResponse = { message.syncing !== undefined && (obj.syncing = message.syncing); return obj; }, - fromPartial, I>>(object: I): GetSyncingResponse { + fromPartial(object: Partial): GetSyncingResponse { const message = createBaseGetSyncingResponse(); message.syncing = object.syncing ?? false; return message; @@ -802,11 +798,11 @@ function createBaseGetNodeInfoRequest(): GetNodeInfoRequest { return {}; } export const GetNodeInfoRequest = { - encode(_: GetNodeInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: GetNodeInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetNodeInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoRequest(); while (reader.pos < end) { @@ -827,7 +823,7 @@ export const GetNodeInfoRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): GetNodeInfoRequest { + fromPartial(_: Partial): GetNodeInfoRequest { const message = createBaseGetNodeInfoRequest(); return message; }, @@ -839,7 +835,7 @@ function createBaseGetNodeInfoResponse(): GetNodeInfoResponse { }; } export const GetNodeInfoResponse = { - encode(message: GetNodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetNodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.defaultNodeInfo !== undefined) { DefaultNodeInfo.encode(message.defaultNodeInfo, writer.uint32(10).fork()).ldelim(); } @@ -848,8 +844,8 @@ export const GetNodeInfoResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetNodeInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetNodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetNodeInfoResponse(); while (reader.pos < end) { @@ -887,7 +883,7 @@ export const GetNodeInfoResponse = { : undefined); return obj; }, - fromPartial, I>>(object: I): GetNodeInfoResponse { + fromPartial(object: Partial): GetNodeInfoResponse { const message = createBaseGetNodeInfoResponse(); if (object.defaultNodeInfo !== undefined && object.defaultNodeInfo !== null) { message.defaultNodeInfo = DefaultNodeInfo.fromPartial(object.defaultNodeInfo); @@ -911,7 +907,7 @@ function createBaseVersionInfo(): VersionInfo { }; } export const VersionInfo = { - encode(message: VersionInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: VersionInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -938,8 +934,8 @@ export const VersionInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VersionInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VersionInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVersionInfo(); while (reader.pos < end) { @@ -1005,7 +1001,7 @@ export const VersionInfo = { message.cosmosSdkVersion !== undefined && (obj.cosmosSdkVersion = message.cosmosSdkVersion); return obj; }, - fromPartial, I>>(object: I): VersionInfo { + fromPartial(object: Partial): VersionInfo { const message = createBaseVersionInfo(); message.name = object.name ?? ""; message.appName = object.appName ?? ""; @@ -1026,7 +1022,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== "") { writer.uint32(10).string(message.path); } @@ -1038,8 +1034,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -1075,7 +1071,7 @@ export const Module = { message.sum !== undefined && (obj.sum = message.sum); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.path = object.path ?? ""; message.version = object.version ?? ""; @@ -1087,19 +1083,19 @@ function createBaseABCIQueryRequest(): ABCIQueryRequest { return { data: new Uint8Array(), path: "", - height: Long.ZERO, + height: BigInt(0), prove: false, }; } export const ABCIQueryRequest = { - encode(message: ABCIQueryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ABCIQueryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { @@ -1107,8 +1103,8 @@ export const ABCIQueryRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ABCIQueryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseABCIQueryRequest(); while (reader.pos < end) { @@ -1121,7 +1117,7 @@ export const ABCIQueryRequest = { message.path = reader.string(); break; case 3: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 4: message.prove = reader.bool(); @@ -1137,7 +1133,7 @@ export const ABCIQueryRequest = { const obj = createBaseABCIQueryRequest(); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); if (isSet(object.path)) obj.path = String(object.path); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.prove)) obj.prove = Boolean(object.prove); return obj; }, @@ -1146,16 +1142,16 @@ export const ABCIQueryRequest = { message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.prove !== undefined && (obj.prove = message.prove); return obj; }, - fromPartial, I>>(object: I): ABCIQueryRequest { + fromPartial(object: Partial): ABCIQueryRequest { const message = createBaseABCIQueryRequest(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.prove = object.prove ?? false; return message; @@ -1166,16 +1162,16 @@ function createBaseABCIQueryResponse(): ABCIQueryResponse { code: 0, log: "", info: "", - index: Long.ZERO, + index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), proofOps: ProofOps.fromPartial({}), - height: Long.ZERO, + height: BigInt(0), codespace: "", }; } export const ABCIQueryResponse = { - encode(message: ABCIQueryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ABCIQueryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -1185,7 +1181,7 @@ export const ABCIQueryResponse = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.index.isZero()) { + if (message.index !== BigInt(0)) { writer.uint32(40).int64(message.index); } if (message.key.length !== 0) { @@ -1197,7 +1193,7 @@ export const ABCIQueryResponse = { if (message.proofOps !== undefined) { ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { @@ -1205,8 +1201,8 @@ export const ABCIQueryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ABCIQueryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ABCIQueryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseABCIQueryResponse(); while (reader.pos < end) { @@ -1222,7 +1218,7 @@ export const ABCIQueryResponse = { message.info = reader.string(); break; case 5: - message.index = reader.int64() as Long; + message.index = reader.int64(); break; case 6: message.key = reader.bytes(); @@ -1234,7 +1230,7 @@ export const ABCIQueryResponse = { message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 10: message.codespace = reader.string(); @@ -1251,11 +1247,11 @@ export const ABCIQueryResponse = { if (isSet(object.code)) obj.code = Number(object.code); if (isSet(object.log)) obj.log = String(object.log); if (isSet(object.info)) obj.info = String(object.info); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); if (isSet(object.key)) obj.key = bytesFromBase64(object.key); if (isSet(object.value)) obj.value = bytesFromBase64(object.value); if (isSet(object.proofOps)) obj.proofOps = ProofOps.fromJSON(object.proofOps); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.codespace)) obj.codespace = String(object.codespace); return obj; }, @@ -1264,24 +1260,24 @@ export const ABCIQueryResponse = { message.code !== undefined && (obj.code = Math.round(message.code)); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.codespace !== undefined && (obj.codespace = message.codespace); return obj; }, - fromPartial, I>>(object: I): ABCIQueryResponse { + fromPartial(object: Partial): ABCIQueryResponse { const message = createBaseABCIQueryResponse(); message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); @@ -1289,7 +1285,7 @@ export const ABCIQueryResponse = { message.proofOps = ProofOps.fromPartial(object.proofOps); } if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.codespace = object.codespace ?? ""; return message; @@ -1303,7 +1299,7 @@ function createBaseProofOp(): ProofOp { }; } export const ProofOp = { - encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -1315,8 +1311,8 @@ export const ProofOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOp(); while (reader.pos < end) { @@ -1354,7 +1350,7 @@ export const ProofOp = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): ProofOp { + fromPartial(object: Partial): ProofOp { const message = createBaseProofOp(); message.type = object.type ?? ""; message.key = object.key ?? new Uint8Array(); @@ -1368,14 +1364,14 @@ function createBaseProofOps(): ProofOps { }; } export const ProofOps = { - encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOps(); while (reader.pos < end) { @@ -1405,7 +1401,7 @@ export const ProofOps = { } return obj; }, - fromPartial, I>>(object: I): ProofOps { + fromPartial(object: Partial): ProofOps { const message = createBaseProofOps(); message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; return message; @@ -1449,22 +1445,22 @@ export class ServiceClientImpl implements Service { GetNodeInfo(request: GetNodeInfoRequest = {}): Promise { const data = GetNodeInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetNodeInfo", data); - return promise.then((data) => GetNodeInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetNodeInfoResponse.decode(new BinaryReader(data))); } GetSyncing(request: GetSyncingRequest = {}): Promise { const data = GetSyncingRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetSyncing", data); - return promise.then((data) => GetSyncingResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetSyncingResponse.decode(new BinaryReader(data))); } GetLatestBlock(request: GetLatestBlockRequest = {}): Promise { const data = GetLatestBlockRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestBlock", data); - return promise.then((data) => GetLatestBlockResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetLatestBlockResponse.decode(new BinaryReader(data))); } GetBlockByHeight(request: GetBlockByHeightRequest): Promise { const data = GetBlockByHeightRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetBlockByHeight", data); - return promise.then((data) => GetBlockByHeightResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetBlockByHeightResponse.decode(new BinaryReader(data))); } GetLatestValidatorSet( request: GetLatestValidatorSetRequest = { @@ -1473,7 +1469,7 @@ export class ServiceClientImpl implements Service { ): Promise { const data = GetLatestValidatorSetRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetLatestValidatorSet", data); - return promise.then((data) => GetLatestValidatorSetResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetLatestValidatorSetResponse.decode(new BinaryReader(data))); } GetValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { const data = GetValidatorSetByHeightRequest.encode(request).finish(); @@ -1482,11 +1478,11 @@ export class ServiceClientImpl implements Service { "GetValidatorSetByHeight", data, ); - return promise.then((data) => GetValidatorSetByHeightResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetValidatorSetByHeightResponse.decode(new BinaryReader(data))); } ABCIQuery(request: ABCIQueryRequest): Promise { const data = ABCIQueryRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "ABCIQuery", data); - return promise.then((data) => ABCIQueryResponse.decode(new _m0.Reader(data))); + return promise.then((data) => ABCIQueryResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/base/tendermint/v1beta1/types.ts b/src/cosmos/base/tendermint/v1beta1/types.ts index eb2888b..1ee0e2b 100644 --- a/src/cosmos/base/tendermint/v1beta1/types.ts +++ b/src/cosmos/base/tendermint/v1beta1/types.ts @@ -3,17 +3,14 @@ import { Data, Commit, BlockID } from "../../../../tendermint/types/types"; import { EvidenceList } from "../../../../tendermint/types/evidence"; import { Consensus } from "../../../../tendermint/version/types"; import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { - Long, isSet, - DeepPartial, - Exact, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes, } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.base.tendermint.v1beta1"; /** * Block is tendermint type Block, with the Header proposer address @@ -30,7 +27,7 @@ export interface Header { /** basic block info */ version: Consensus; chainId: string; - height: Long; + height: bigint; time: Timestamp; /** prev block info */ lastBlockId: BlockID; @@ -64,7 +61,7 @@ function createBaseBlock(): Block { }; } export const Block = { - encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -79,8 +76,8 @@ export const Block = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Block { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Block { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlock(); while (reader.pos < end) { @@ -123,7 +120,7 @@ export const Block = { (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); return obj; }, - fromPartial, I>>(object: I): Block { + fromPartial(object: Partial): Block { const message = createBaseBlock(); if (object.header !== undefined && object.header !== null) { message.header = Header.fromPartial(object.header); @@ -144,7 +141,7 @@ function createBaseHeader(): Header { return { version: Consensus.fromPartial({}), chainId: "", - height: Long.ZERO, + height: BigInt(0), time: Timestamp.fromPartial({}), lastBlockId: BlockID.fromPartial({}), lastCommitHash: new Uint8Array(), @@ -159,14 +156,14 @@ function createBaseHeader(): Header { }; } export const Header = { - encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } if (message.chainId !== "") { writer.uint32(18).string(message.chainId); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { @@ -204,8 +201,8 @@ export const Header = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeader(); while (reader.pos < end) { @@ -218,7 +215,7 @@ export const Header = { message.chainId = reader.string(); break; case 3: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 4: message.time = Timestamp.decode(reader, reader.uint32()); @@ -264,7 +261,7 @@ export const Header = { const obj = createBaseHeader(); if (isSet(object.version)) obj.version = Consensus.fromJSON(object.version); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); if (isSet(object.lastBlockId)) obj.lastBlockId = BlockID.fromJSON(object.lastBlockId); if (isSet(object.lastCommitHash)) obj.lastCommitHash = bytesFromBase64(object.lastCommitHash); @@ -283,7 +280,7 @@ export const Header = { message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); message.chainId !== undefined && (obj.chainId = message.chainId); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.lastBlockId !== undefined && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); @@ -318,14 +315,14 @@ export const Header = { message.proposerAddress !== undefined && (obj.proposerAddress = message.proposerAddress); return obj; }, - fromPartial, I>>(object: I): Header { + fromPartial(object: Partial
): Header { const message = createBaseHeader(); if (object.version !== undefined && object.version !== null) { message.version = Consensus.fromPartial(object.version); } message.chainId = object.chainId ?? ""; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); diff --git a/src/cosmos/base/v1beta1/coin.ts b/src/cosmos/base/v1beta1/coin.ts index f7e9aac..43b6697 100644 --- a/src/cosmos/base/v1beta1/coin.ts +++ b/src/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.base.v1beta1"; /** * Coin defines a token with a denomination and an amount. @@ -37,7 +37,7 @@ function createBaseCoin(): Coin { }; } export const Coin = { - encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Coin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -46,8 +46,8 @@ export const Coin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Coin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Coin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCoin(); while (reader.pos < end) { @@ -78,7 +78,7 @@ export const Coin = { message.amount !== undefined && (obj.amount = message.amount); return obj; }, - fromPartial, I>>(object: I): Coin { + fromPartial(object: Partial): Coin { const message = createBaseCoin(); message.denom = object.denom ?? ""; message.amount = object.amount ?? ""; @@ -92,7 +92,7 @@ function createBaseDecCoin(): DecCoin { }; } export const DecCoin = { - encode(message: DecCoin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DecCoin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -101,8 +101,8 @@ export const DecCoin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DecCoin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecCoin(); while (reader.pos < end) { @@ -133,7 +133,7 @@ export const DecCoin = { message.amount !== undefined && (obj.amount = message.amount); return obj; }, - fromPartial, I>>(object: I): DecCoin { + fromPartial(object: Partial): DecCoin { const message = createBaseDecCoin(); message.denom = object.denom ?? ""; message.amount = object.amount ?? ""; @@ -146,14 +146,14 @@ function createBaseIntProto(): IntProto { }; } export const IntProto = { - encode(message: IntProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IntProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.int !== "") { writer.uint32(10).string(message.int); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IntProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IntProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIntProto(); while (reader.pos < end) { @@ -179,7 +179,7 @@ export const IntProto = { message.int !== undefined && (obj.int = message.int); return obj; }, - fromPartial, I>>(object: I): IntProto { + fromPartial(object: Partial): IntProto { const message = createBaseIntProto(); message.int = object.int ?? ""; return message; @@ -191,14 +191,14 @@ function createBaseDecProto(): DecProto { }; } export const DecProto = { - encode(message: DecProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.dec !== "") { writer.uint32(10).string(message.dec); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DecProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DecProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecProto(); while (reader.pos < end) { @@ -224,7 +224,7 @@ export const DecProto = { message.dec !== undefined && (obj.dec = message.dec); return obj; }, - fromPartial, I>>(object: I): DecProto { + fromPartial(object: Partial): DecProto { const message = createBaseDecProto(); message.dec = object.dec ?? ""; return message; diff --git a/src/cosmos/capability/module/v1/module.ts b/src/cosmos/capability/module/v1/module.ts index 3f05a07..b502936 100644 --- a/src/cosmos/capability/module/v1/module.ts +++ b/src/cosmos/capability/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.capability.module.v1"; /** Module is the config object of the capability module. */ export interface Module { @@ -16,14 +16,14 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sealKeeper === true) { writer.uint32(8).bool(message.sealKeeper); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -49,7 +49,7 @@ export const Module = { message.sealKeeper !== undefined && (obj.sealKeeper = message.sealKeeper); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.sealKeeper = object.sealKeeper ?? false; return message; diff --git a/src/cosmos/capability/v1beta1/capability.ts b/src/cosmos/capability/v1beta1/capability.ts index 4ad23d5..749f35e 100644 --- a/src/cosmos/capability/v1beta1/capability.ts +++ b/src/cosmos/capability/v1beta1/capability.ts @@ -1,13 +1,13 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.capability.v1beta1"; /** * Capability defines an implementation of an object capability. The index * provided to a Capability must be globally unique. */ export interface Capability { - index: Long; + index: bigint; } /** * Owner defines a single capability owner. An owner is defined by the name of @@ -26,25 +26,25 @@ export interface CapabilityOwners { } function createBaseCapability(): Capability { return { - index: Long.UZERO, + index: BigInt(0), }; } export const Capability = { - encode(message: Capability, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + encode(message: Capability, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Capability { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Capability { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCapability(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = reader.uint64() as Long; + message.index = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -55,18 +55,18 @@ export const Capability = { }, fromJSON(object: any): Capability { const obj = createBaseCapability(); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); return obj; }, toJSON(message: Capability): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Capability { + fromPartial(object: Partial): Capability { const message = createBaseCapability(); if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } return message; }, @@ -78,7 +78,7 @@ function createBaseOwner(): Owner { }; } export const Owner = { - encode(message: Owner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Owner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.module !== "") { writer.uint32(10).string(message.module); } @@ -87,8 +87,8 @@ export const Owner = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Owner { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Owner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOwner(); while (reader.pos < end) { @@ -119,7 +119,7 @@ export const Owner = { message.name !== undefined && (obj.name = message.name); return obj; }, - fromPartial, I>>(object: I): Owner { + fromPartial(object: Partial): Owner { const message = createBaseOwner(); message.module = object.module ?? ""; message.name = object.name ?? ""; @@ -132,14 +132,14 @@ function createBaseCapabilityOwners(): CapabilityOwners { }; } export const CapabilityOwners = { - encode(message: CapabilityOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CapabilityOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.owners) { Owner.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CapabilityOwners { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CapabilityOwners { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCapabilityOwners(); while (reader.pos < end) { @@ -169,7 +169,7 @@ export const CapabilityOwners = { } return obj; }, - fromPartial, I>>(object: I): CapabilityOwners { + fromPartial(object: Partial): CapabilityOwners { const message = createBaseCapabilityOwners(); message.owners = object.owners?.map((e) => Owner.fromPartial(e)) || []; return message; diff --git a/src/cosmos/capability/v1beta1/genesis.ts b/src/cosmos/capability/v1beta1/genesis.ts index c070b9c..9dd561b 100644 --- a/src/cosmos/capability/v1beta1/genesis.ts +++ b/src/cosmos/capability/v1beta1/genesis.ts @@ -1,19 +1,19 @@ /* eslint-disable */ import { CapabilityOwners } from "./capability"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.capability.v1beta1"; /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwners { /** index is the index of the capability owner. */ - index: Long; + index: bigint; /** index_owners are the owners at the given index. */ indexOwners: CapabilityOwners; } /** GenesisState defines the capability module's genesis state. */ export interface GenesisState { /** index is the capability global index. */ - index: Long; + index: bigint; /** * owners represents a map from index to owners of the capability index * index key is string to allow amino marshalling. @@ -22,13 +22,13 @@ export interface GenesisState { } function createBaseGenesisOwners(): GenesisOwners { return { - index: Long.UZERO, + index: BigInt(0), indexOwners: CapabilityOwners.fromPartial({}), }; } export const GenesisOwners = { - encode(message: GenesisOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + encode(message: GenesisOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); } if (message.indexOwners !== undefined) { @@ -36,15 +36,15 @@ export const GenesisOwners = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisOwners { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisOwners { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisOwners(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = reader.uint64() as Long; + message.index = reader.uint64(); break; case 2: message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()); @@ -58,21 +58,21 @@ export const GenesisOwners = { }, fromJSON(object: any): GenesisOwners { const obj = createBaseGenesisOwners(); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); if (isSet(object.indexOwners)) obj.indexOwners = CapabilityOwners.fromJSON(object.indexOwners); return obj; }, toJSON(message: GenesisOwners): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.indexOwners !== undefined && (obj.indexOwners = message.indexOwners ? CapabilityOwners.toJSON(message.indexOwners) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisOwners { + fromPartial(object: Partial): GenesisOwners { const message = createBaseGenesisOwners(); if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } if (object.indexOwners !== undefined && object.indexOwners !== null) { message.indexOwners = CapabilityOwners.fromPartial(object.indexOwners); @@ -82,13 +82,13 @@ export const GenesisOwners = { }; function createBaseGenesisState(): GenesisState { return { - index: Long.UZERO, + index: BigInt(0), owners: [], }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).uint64(message.index); } for (const v of message.owners) { @@ -96,15 +96,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = reader.uint64() as Long; + message.index = reader.uint64(); break; case 2: message.owners.push(GenesisOwners.decode(reader, reader.uint32())); @@ -118,13 +118,13 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { const obj = createBaseGenesisState(); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); if (Array.isArray(object?.owners)) obj.owners = object.owners.map((e: any) => GenesisOwners.fromJSON(e)); return obj; }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); if (message.owners) { obj.owners = message.owners.map((e) => (e ? GenesisOwners.toJSON(e) : undefined)); } else { @@ -132,10 +132,10 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } message.owners = object.owners?.map((e) => GenesisOwners.fromPartial(e)) || []; return message; diff --git a/src/cosmos/client.ts b/src/cosmos/client.ts new file mode 100644 index 0000000..a9f0b6e --- /dev/null +++ b/src/cosmos/client.ts @@ -0,0 +1,103 @@ +/* eslint-disable */ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; +import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; +import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; +import * as cosmosConsensusV1TxRegistry from "./consensus/v1/tx.registry"; +import * as cosmosCrisisV1beta1TxRegistry from "./crisis/v1beta1/tx.registry"; +import * as cosmosDistributionV1beta1TxRegistry from "./distribution/v1beta1/tx.registry"; +import * as cosmosEvidenceV1beta1TxRegistry from "./evidence/v1beta1/tx.registry"; +import * as cosmosFeegrantV1beta1TxRegistry from "./feegrant/v1beta1/tx.registry"; +import * as cosmosGovV1TxRegistry from "./gov/v1/tx.registry"; +import * as cosmosGovV1beta1TxRegistry from "./gov/v1beta1/tx.registry"; +import * as cosmosGroupV1TxRegistry from "./group/v1/tx.registry"; +import * as cosmosMintV1beta1TxRegistry from "./mint/v1beta1/tx.registry"; +import * as cosmosNftV1beta1TxRegistry from "./nft/v1beta1/tx.registry"; +import * as cosmosSlashingV1beta1TxRegistry from "./slashing/v1beta1/tx.registry"; +import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; +import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; +import * as cosmosVestingV1beta1TxRegistry from "./vesting/v1beta1/tx.registry"; +import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; +import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; +import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; +import * as cosmosConsensusV1TxAmino from "./consensus/v1/tx.amino"; +import * as cosmosCrisisV1beta1TxAmino from "./crisis/v1beta1/tx.amino"; +import * as cosmosDistributionV1beta1TxAmino from "./distribution/v1beta1/tx.amino"; +import * as cosmosEvidenceV1beta1TxAmino from "./evidence/v1beta1/tx.amino"; +import * as cosmosFeegrantV1beta1TxAmino from "./feegrant/v1beta1/tx.amino"; +import * as cosmosGovV1TxAmino from "./gov/v1/tx.amino"; +import * as cosmosGovV1beta1TxAmino from "./gov/v1beta1/tx.amino"; +import * as cosmosGroupV1TxAmino from "./group/v1/tx.amino"; +import * as cosmosMintV1beta1TxAmino from "./mint/v1beta1/tx.amino"; +import * as cosmosNftV1beta1TxAmino from "./nft/v1beta1/tx.amino"; +import * as cosmosSlashingV1beta1TxAmino from "./slashing/v1beta1/tx.amino"; +import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; +import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; +import * as cosmosVestingV1beta1TxAmino from "./vesting/v1beta1/tx.amino"; +export const cosmosAminoConverters = { + ...cosmosAuthV1beta1TxAmino.AminoConverter, + ...cosmosAuthzV1beta1TxAmino.AminoConverter, + ...cosmosBankV1beta1TxAmino.AminoConverter, + ...cosmosConsensusV1TxAmino.AminoConverter, + ...cosmosCrisisV1beta1TxAmino.AminoConverter, + ...cosmosDistributionV1beta1TxAmino.AminoConverter, + ...cosmosEvidenceV1beta1TxAmino.AminoConverter, + ...cosmosFeegrantV1beta1TxAmino.AminoConverter, + ...cosmosGovV1TxAmino.AminoConverter, + ...cosmosGovV1beta1TxAmino.AminoConverter, + ...cosmosGroupV1TxAmino.AminoConverter, + ...cosmosMintV1beta1TxAmino.AminoConverter, + ...cosmosNftV1beta1TxAmino.AminoConverter, + ...cosmosSlashingV1beta1TxAmino.AminoConverter, + ...cosmosStakingV1beta1TxAmino.AminoConverter, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter, + ...cosmosVestingV1beta1TxAmino.AminoConverter, +}; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...cosmosAuthV1beta1TxRegistry.registry, + ...cosmosAuthzV1beta1TxRegistry.registry, + ...cosmosBankV1beta1TxRegistry.registry, + ...cosmosConsensusV1TxRegistry.registry, + ...cosmosCrisisV1beta1TxRegistry.registry, + ...cosmosDistributionV1beta1TxRegistry.registry, + ...cosmosEvidenceV1beta1TxRegistry.registry, + ...cosmosFeegrantV1beta1TxRegistry.registry, + ...cosmosGovV1TxRegistry.registry, + ...cosmosGovV1beta1TxRegistry.registry, + ...cosmosGroupV1TxRegistry.registry, + ...cosmosMintV1beta1TxRegistry.registry, + ...cosmosNftV1beta1TxRegistry.registry, + ...cosmosSlashingV1beta1TxRegistry.registry, + ...cosmosStakingV1beta1TxRegistry.registry, + ...cosmosUpgradeV1beta1TxRegistry.registry, + ...cosmosVestingV1beta1TxRegistry.registry, +]; +export const getSigningCosmosClientOptions = (): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...cosmosProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...cosmosAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningCosmosClient = async ({ + rpcEndpoint, + signer, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +}) => { + const { registry, aminoTypes } = getSigningCosmosClientOptions(); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes, + }); + return client; +}; diff --git a/src/cosmos/consensus/module/v1/module.ts b/src/cosmos/consensus/module/v1/module.ts index 4041503..c3102e6 100644 --- a/src/cosmos/consensus/module/v1/module.ts +++ b/src/cosmos/consensus/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.consensus.module.v1"; /** Module is the config object of the consensus module. */ export interface Module { @@ -13,14 +13,14 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -46,7 +46,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.authority = object.authority ?? ""; return message; diff --git a/src/cosmos/consensus/v1/query.ts b/src/cosmos/consensus/v1/query.ts index ccaf649..ae57885 100644 --- a/src/cosmos/consensus/v1/query.ts +++ b/src/cosmos/consensus/v1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { ConsensusParams } from "../../../tendermint/types/params"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.consensus.v1"; /** QueryParamsRequest defines the request type for querying x/consensus parameters. */ export interface QueryParamsRequest {} @@ -18,11 +18,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -43,7 +43,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -54,14 +54,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { ConsensusParams.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -88,7 +88,7 @@ export const QueryParamsResponse = { (obj.params = message.params ? ConsensusParams.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = ConsensusParams.fromPartial(object.params); @@ -110,6 +110,6 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.consensus.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/consensus/v1/tx.amino.ts b/src/cosmos/consensus/v1/tx.amino.ts new file mode 100644 index 0000000..1589491 --- /dev/null +++ b/src/cosmos/consensus/v1/tx.amino.ts @@ -0,0 +1,77 @@ +//@ts-nocheck +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgUpdateParams } from "./tx"; +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: { + authority: string; + block: { + max_bytes: string; + max_gas: string; + }; + evidence: { + max_age_num_blocks: string; + max_age_duration: { + seconds: string; + nanos: number; + }; + max_bytes: string; + }; + validator: { + pub_key_types: string[]; + }; + }; +} +export const AminoConverter = { + "/cosmos.consensus.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: ({ + authority, + block, + evidence, + validator, + }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + block: { + max_bytes: block.maxBytes.toString(), + max_gas: block.maxGas.toString(), + }, + evidence: { + max_age_num_blocks: evidence.maxAgeNumBlocks.toString(), + max_age_duration: (evidence.maxAgeDuration * 1_000_000_000).toString(), + max_bytes: evidence.maxBytes.toString(), + }, + validator: { + pub_key_types: validator.pubKeyTypes, + }, + }; + }, + fromAmino: ({ + authority, + block, + evidence, + validator, + }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + block: { + maxBytes: BigInt(block.max_bytes), + maxGas: BigInt(block.max_gas), + }, + evidence: { + maxAgeNumBlocks: BigInt(evidence.max_age_num_blocks), + maxAgeDuration: { + seconds: BigInt(Math.floor(parseInt(evidence.max_age_duration) / 1_000_000_000)), + nanos: parseInt(evidence.max_age_duration) % 1_000_000_000, + }, + maxBytes: BigInt(evidence.max_bytes), + }, + validator: { + pubKeyTypes: validator.pub_key_types, + }, + }; + }, + }, +}; diff --git a/src/cosmos/consensus/v1/tx.registry.ts b/src/cosmos/consensus/v1/tx.registry.ts new file mode 100644 index 0000000..c2e44a6 --- /dev/null +++ b/src/cosmos/consensus/v1/tx.registry.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.consensus.v1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/consensus/v1/tx.ts b/src/cosmos/consensus/v1/tx.ts index 1ea495b..fb3bf5e 100644 --- a/src/cosmos/consensus/v1/tx.ts +++ b/src/cosmos/consensus/v1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { BlockParams, EvidenceParams, ValidatorParams } from "../../../tendermint/types/params"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.consensus.v1"; /** MsgUpdateParams is the Msg/UpdateParams request type. */ export interface MsgUpdateParams { @@ -32,7 +32,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -47,8 +47,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -92,7 +92,7 @@ export const MsgUpdateParams = { (obj.validator = message.validator ? ValidatorParams.toJSON(message.validator) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.block !== undefined && object.block !== null) { @@ -111,11 +111,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -136,7 +136,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -160,6 +160,6 @@ export class MsgClientImpl implements Msg { UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.consensus.v1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/crisis/module/v1/module.ts b/src/cosmos/crisis/module/v1/module.ts index 8c403ae..c6a3d21 100644 --- a/src/cosmos/crisis/module/v1/module.ts +++ b/src/cosmos/crisis/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.crisis.module.v1"; /** Module is the config object of the crisis module. */ export interface Module { @@ -16,7 +16,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.feeCollectorName !== "") { writer.uint32(10).string(message.feeCollectorName); } @@ -25,8 +25,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -57,7 +57,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.feeCollectorName = object.feeCollectorName ?? ""; message.authority = object.authority ?? ""; diff --git a/src/cosmos/crisis/v1beta1/genesis.ts b/src/cosmos/crisis/v1beta1/genesis.ts index dc459c2..1a8c641 100644 --- a/src/cosmos/crisis/v1beta1/genesis.ts +++ b/src/cosmos/crisis/v1beta1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.crisis.v1beta1"; /** GenesisState defines the crisis module's genesis state. */ export interface GenesisState { @@ -17,14 +17,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.constantFee !== undefined) { Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -51,7 +51,7 @@ export const GenesisState = { (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.constantFee !== undefined && object.constantFee !== null) { message.constantFee = Coin.fromPartial(object.constantFee); diff --git a/src/cosmos/crisis/v1beta1/tx.amino.ts b/src/cosmos/crisis/v1beta1/tx.amino.ts new file mode 100644 index 0000000..0a1eed7 --- /dev/null +++ b/src/cosmos/crisis/v1beta1/tx.amino.ts @@ -0,0 +1,69 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; +export interface MsgVerifyInvariantAminoType extends AminoMsg { + type: "cosmos-sdk/MsgVerifyInvariant"; + value: { + sender: string; + invariant_module_name: string; + invariant_route: string; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/crisis/MsgUpdateParams"; + value: { + authority: string; + constant_fee: { + denom: string; + amount: string; + }; + }; +} +export const AminoConverter = { + "/cosmos.crisis.v1beta1.MsgVerifyInvariant": { + aminoType: "cosmos-sdk/MsgVerifyInvariant", + toAmino: ({ + sender, + invariantModuleName, + invariantRoute, + }: MsgVerifyInvariant): MsgVerifyInvariantAminoType["value"] => { + return { + sender, + invariant_module_name: invariantModuleName, + invariant_route: invariantRoute, + }; + }, + fromAmino: ({ + sender, + invariant_module_name, + invariant_route, + }: MsgVerifyInvariantAminoType["value"]): MsgVerifyInvariant => { + return { + sender, + invariantModuleName: invariant_module_name, + invariantRoute: invariant_route, + }; + }, + }, + "/cosmos.crisis.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/crisis/MsgUpdateParams", + toAmino: ({ authority, constantFee }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + constant_fee: { + denom: constantFee.denom, + amount: constantFee.amount, + }, + }; + }, + fromAmino: ({ authority, constant_fee }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + constantFee: { + denom: constant_fee.denom, + amount: constant_fee.amount, + }, + }; + }, + }, +}; diff --git a/src/cosmos/crisis/v1beta1/tx.registry.ts b/src/cosmos/crisis/v1beta1/tx.registry.ts new file mode 100644 index 0000000..9ad0841 --- /dev/null +++ b/src/cosmos/crisis/v1beta1/tx.registry.ts @@ -0,0 +1,85 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.crisis.v1beta1.MsgVerifyInvariant", MsgVerifyInvariant], + ["/cosmos.crisis.v1beta1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + verifyInvariant(value: MsgVerifyInvariant) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", + value: MsgVerifyInvariant.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + verifyInvariant(value: MsgVerifyInvariant) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + verifyInvariant(value: MsgVerifyInvariant) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", + value: MsgVerifyInvariant.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + verifyInvariant(value: any) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", + value: MsgVerifyInvariant.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + verifyInvariant(value: MsgVerifyInvariant) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", + value: MsgVerifyInvariant.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/crisis/v1beta1/tx.ts b/src/cosmos/crisis/v1beta1/tx.ts index 057fdfe..19abe64 100644 --- a/src/cosmos/crisis/v1beta1/tx.ts +++ b/src/cosmos/crisis/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.crisis.v1beta1"; /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariant { @@ -40,7 +40,7 @@ function createBaseMsgVerifyInvariant(): MsgVerifyInvariant { }; } export const MsgVerifyInvariant = { - encode(message: MsgVerifyInvariant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgVerifyInvariant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -52,8 +52,8 @@ export const MsgVerifyInvariant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVerifyInvariant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVerifyInvariant(); while (reader.pos < end) { @@ -89,7 +89,7 @@ export const MsgVerifyInvariant = { message.invariantRoute !== undefined && (obj.invariantRoute = message.invariantRoute); return obj; }, - fromPartial, I>>(object: I): MsgVerifyInvariant { + fromPartial(object: Partial): MsgVerifyInvariant { const message = createBaseMsgVerifyInvariant(); message.sender = object.sender ?? ""; message.invariantModuleName = object.invariantModuleName ?? ""; @@ -101,11 +101,11 @@ function createBaseMsgVerifyInvariantResponse(): MsgVerifyInvariantResponse { return {}; } export const MsgVerifyInvariantResponse = { - encode(_: MsgVerifyInvariantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgVerifyInvariantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariantResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVerifyInvariantResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVerifyInvariantResponse(); while (reader.pos < end) { @@ -126,7 +126,7 @@ export const MsgVerifyInvariantResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgVerifyInvariantResponse { + fromPartial(_: Partial): MsgVerifyInvariantResponse { const message = createBaseMsgVerifyInvariantResponse(); return message; }, @@ -138,7 +138,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -147,8 +147,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -180,7 +180,7 @@ export const MsgUpdateParams = { (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.constantFee !== undefined && object.constantFee !== null) { @@ -193,11 +193,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -218,7 +218,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -245,11 +245,11 @@ export class MsgClientImpl implements Msg { VerifyInvariant(request: MsgVerifyInvariant): Promise { const data = MsgVerifyInvariant.encode(request).finish(); const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); - return promise.then((data) => MsgVerifyInvariantResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgVerifyInvariantResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/crypto/ed25519/keys.ts b/src/cosmos/crypto/ed25519/keys.ts index 9bf262e..3ca930e 100644 --- a/src/cosmos/crypto/ed25519/keys.ts +++ b/src/cosmos/crypto/ed25519/keys.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.crypto.ed25519"; /** * PubKey is an ed25519 public key for handling Tendermint keys in SDK. @@ -25,14 +25,14 @@ function createBasePubKey(): PubKey { }; } export const PubKey = { - encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePubKey(); while (reader.pos < end) { @@ -59,7 +59,7 @@ export const PubKey = { (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): PubKey { + fromPartial(object: Partial): PubKey { const message = createBasePubKey(); message.key = object.key ?? new Uint8Array(); return message; @@ -71,14 +71,14 @@ function createBasePrivKey(): PrivKey { }; } export const PrivKey = { - encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrivKey(); while (reader.pos < end) { @@ -105,7 +105,7 @@ export const PrivKey = { (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): PrivKey { + fromPartial(object: Partial): PrivKey { const message = createBasePrivKey(); message.key = object.key ?? new Uint8Array(); return message; diff --git a/src/cosmos/crypto/hd/v1/hd.ts b/src/cosmos/crypto/hd/v1/hd.ts index 6de815b..cb4a523 100644 --- a/src/cosmos/crypto/hd/v1/hd.ts +++ b/src/cosmos/crypto/hd/v1/hd.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.crypto.hd.v1"; /** BIP44Params is used as path field in ledger item in Record. */ export interface BIP44Params { @@ -28,7 +28,7 @@ function createBaseBIP44Params(): BIP44Params { }; } export const BIP44Params = { - encode(message: BIP44Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BIP44Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.purpose !== 0) { writer.uint32(8).uint32(message.purpose); } @@ -46,8 +46,8 @@ export const BIP44Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BIP44Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BIP44Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBIP44Params(); while (reader.pos < end) { @@ -93,7 +93,7 @@ export const BIP44Params = { message.addressIndex !== undefined && (obj.addressIndex = Math.round(message.addressIndex)); return obj; }, - fromPartial, I>>(object: I): BIP44Params { + fromPartial(object: Partial): BIP44Params { const message = createBaseBIP44Params(); message.purpose = object.purpose ?? 0; message.coinType = object.coinType ?? 0; diff --git a/src/cosmos/crypto/keyring/v1/record.ts b/src/cosmos/crypto/keyring/v1/record.ts index 644d5c4..ab309f6 100644 --- a/src/cosmos/crypto/keyring/v1/record.ts +++ b/src/cosmos/crypto/keyring/v1/record.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Any } from "../../../../google/protobuf/any"; import { BIP44Params } from "../../hd/v1/hd"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.crypto.keyring.v1"; /** Record is used for representing a key in the keyring. */ export interface Record { @@ -45,7 +45,7 @@ function createBaseRecord(): Record { }; } export const Record = { - encode(message: Record, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -66,8 +66,8 @@ export const Record = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord(); while (reader.pos < end) { @@ -122,7 +122,7 @@ export const Record = { (obj.offline = message.offline ? Record_Offline.toJSON(message.offline) : undefined); return obj; }, - fromPartial, I>>(object: I): Record { + fromPartial(object: Partial): Record { const message = createBaseRecord(); message.name = object.name ?? ""; if (object.pubKey !== undefined && object.pubKey !== null) { @@ -149,14 +149,14 @@ function createBaseRecord_Local(): Record_Local { }; } export const Record_Local = { - encode(message: Record_Local, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Record_Local, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.privKey !== undefined) { Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Local { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Local(); while (reader.pos < end) { @@ -183,7 +183,7 @@ export const Record_Local = { (obj.privKey = message.privKey ? Any.toJSON(message.privKey) : undefined); return obj; }, - fromPartial, I>>(object: I): Record_Local { + fromPartial(object: Partial): Record_Local { const message = createBaseRecord_Local(); if (object.privKey !== undefined && object.privKey !== null) { message.privKey = Any.fromPartial(object.privKey); @@ -197,14 +197,14 @@ function createBaseRecord_Ledger(): Record_Ledger { }; } export const Record_Ledger = { - encode(message: Record_Ledger, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Record_Ledger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== undefined) { BIP44Params.encode(message.path, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Ledger { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Ledger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Ledger(); while (reader.pos < end) { @@ -230,7 +230,7 @@ export const Record_Ledger = { message.path !== undefined && (obj.path = message.path ? BIP44Params.toJSON(message.path) : undefined); return obj; }, - fromPartial, I>>(object: I): Record_Ledger { + fromPartial(object: Partial): Record_Ledger { const message = createBaseRecord_Ledger(); if (object.path !== undefined && object.path !== null) { message.path = BIP44Params.fromPartial(object.path); @@ -242,11 +242,11 @@ function createBaseRecord_Multi(): Record_Multi { return {}; } export const Record_Multi = { - encode(_: Record_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Record_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Multi(); while (reader.pos < end) { @@ -267,7 +267,7 @@ export const Record_Multi = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Record_Multi { + fromPartial(_: Partial): Record_Multi { const message = createBaseRecord_Multi(); return message; }, @@ -276,11 +276,11 @@ function createBaseRecord_Offline(): Record_Offline { return {}; } export const Record_Offline = { - encode(_: Record_Offline, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Record_Offline, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Record_Offline { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Record_Offline { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRecord_Offline(); while (reader.pos < end) { @@ -301,7 +301,7 @@ export const Record_Offline = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Record_Offline { + fromPartial(_: Partial): Record_Offline { const message = createBaseRecord_Offline(); return message; }, diff --git a/src/cosmos/crypto/multisig/keys.ts b/src/cosmos/crypto/multisig/keys.ts index 063f9ef..5075fb9 100644 --- a/src/cosmos/crypto/multisig/keys.ts +++ b/src/cosmos/crypto/multisig/keys.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.crypto.multisig"; /** * LegacyAminoPubKey specifies a public key type @@ -19,7 +19,7 @@ function createBaseLegacyAminoPubKey(): LegacyAminoPubKey { }; } export const LegacyAminoPubKey = { - encode(message: LegacyAminoPubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: LegacyAminoPubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.threshold !== 0) { writer.uint32(8).uint32(message.threshold); } @@ -28,8 +28,8 @@ export const LegacyAminoPubKey = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LegacyAminoPubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LegacyAminoPubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLegacyAminoPubKey(); while (reader.pos < end) { @@ -65,7 +65,7 @@ export const LegacyAminoPubKey = { } return obj; }, - fromPartial, I>>(object: I): LegacyAminoPubKey { + fromPartial(object: Partial): LegacyAminoPubKey { const message = createBaseLegacyAminoPubKey(); message.threshold = object.threshold ?? 0; message.publicKeys = object.publicKeys?.map((e) => Any.fromPartial(e)) || []; diff --git a/src/cosmos/crypto/multisig/v1beta1/multisig.ts b/src/cosmos/crypto/multisig/v1beta1/multisig.ts index f1ce45a..33bdb62 100644 --- a/src/cosmos/crypto/multisig/v1beta1/multisig.ts +++ b/src/cosmos/crypto/multisig/v1beta1/multisig.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { bytesFromBase64, base64FromBytes, DeepPartial, Exact, isSet } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes, isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; /** * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. @@ -26,14 +26,14 @@ function createBaseMultiSignature(): MultiSignature { }; } export const MultiSignature = { - encode(message: MultiSignature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MultiSignature, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signatures) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MultiSignature { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMultiSignature(); while (reader.pos < end) { @@ -64,7 +64,7 @@ export const MultiSignature = { } return obj; }, - fromPartial, I>>(object: I): MultiSignature { + fromPartial(object: Partial): MultiSignature { const message = createBaseMultiSignature(); message.signatures = object.signatures?.map((e) => e) || []; return message; @@ -77,7 +77,7 @@ function createBaseCompactBitArray(): CompactBitArray { }; } export const CompactBitArray = { - encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CompactBitArray, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.extraBitsStored !== 0) { writer.uint32(8).uint32(message.extraBitsStored); } @@ -86,8 +86,8 @@ export const CompactBitArray = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CompactBitArray { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompactBitArray(); while (reader.pos < end) { @@ -119,7 +119,7 @@ export const CompactBitArray = { (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): CompactBitArray { + fromPartial(object: Partial): CompactBitArray { const message = createBaseCompactBitArray(); message.extraBitsStored = object.extraBitsStored ?? 0; message.elems = object.elems ?? new Uint8Array(); diff --git a/src/cosmos/crypto/secp256k1/keys.ts b/src/cosmos/crypto/secp256k1/keys.ts index 0f6c099..bdbe8eb 100644 --- a/src/cosmos/crypto/secp256k1/keys.ts +++ b/src/cosmos/crypto/secp256k1/keys.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.crypto.secp256k1"; /** * PubKey defines a secp256k1 public key @@ -22,14 +22,14 @@ function createBasePubKey(): PubKey { }; } export const PubKey = { - encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PubKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PubKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePubKey(); while (reader.pos < end) { @@ -56,7 +56,7 @@ export const PubKey = { (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): PubKey { + fromPartial(object: Partial): PubKey { const message = createBasePubKey(); message.key = object.key ?? new Uint8Array(); return message; @@ -68,14 +68,14 @@ function createBasePrivKey(): PrivKey { }; } export const PrivKey = { - encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PrivKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrivKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrivKey(); while (reader.pos < end) { @@ -102,7 +102,7 @@ export const PrivKey = { (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): PrivKey { + fromPartial(object: Partial): PrivKey { const message = createBasePrivKey(); message.key = object.key ?? new Uint8Array(); return message; diff --git a/src/cosmos/distribution/module/v1/module.ts b/src/cosmos/distribution/module/v1/module.ts index 2e1c672..8c523bf 100644 --- a/src/cosmos/distribution/module/v1/module.ts +++ b/src/cosmos/distribution/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.distribution.module.v1"; /** Module is the config object of the distribution module. */ export interface Module { @@ -15,7 +15,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.feeCollectorName !== "") { writer.uint32(10).string(message.feeCollectorName); } @@ -24,8 +24,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -56,7 +56,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.feeCollectorName = object.feeCollectorName ?? ""; message.authority = object.authority ?? ""; diff --git a/src/cosmos/distribution/v1beta1/distribution.ts b/src/cosmos/distribution/v1beta1/distribution.ts index f1e4ea1..cd817ba 100644 --- a/src/cosmos/distribution/v1beta1/distribution.ts +++ b/src/cosmos/distribution/v1beta1/distribution.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { DecCoin, Coin } from "../../base/v1beta1/coin"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.distribution.v1beta1"; /** Params defines the set of params for the distribution module. */ export interface Params { @@ -45,7 +45,7 @@ export interface ValidatorHistoricalRewards { */ export interface ValidatorCurrentRewards { rewards: DecCoin[]; - period: Long; + period: bigint; } /** * ValidatorAccumulatedCommission represents accumulated commission @@ -68,7 +68,7 @@ export interface ValidatorOutstandingRewards { * for delegations which are withdrawn after a slash has occurred. */ export interface ValidatorSlashEvent { - validatorPeriod: Long; + validatorPeriod: bigint; fraction: string; } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ @@ -105,9 +105,9 @@ export interface CommunityPoolSpendProposal { * thus sdk.Dec is used. */ export interface DelegatorStartingInfo { - previousPeriod: Long; + previousPeriod: bigint; stake: string; - height: Long; + height: bigint; } /** * DelegationDelegatorReward represents the properties @@ -134,7 +134,7 @@ export interface CommunityPoolSpendProposalWithDeposit { * Since: cosmos-sdk 0.47-lsm */ export interface TokenizeShareRecordReward { - recordId: Long; + recordId: bigint; reward: DecCoin[]; } function createBaseParams(): Params { @@ -146,7 +146,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.communityTax !== "") { writer.uint32(10).string(message.communityTax); } @@ -161,8 +161,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -203,7 +203,7 @@ export const Params = { message.withdrawAddrEnabled !== undefined && (obj.withdrawAddrEnabled = message.withdrawAddrEnabled); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.communityTax = object.communityTax ?? ""; message.baseProposerReward = object.baseProposerReward ?? ""; @@ -219,7 +219,7 @@ function createBaseValidatorHistoricalRewards(): ValidatorHistoricalRewards { }; } export const ValidatorHistoricalRewards = { - encode(message: ValidatorHistoricalRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorHistoricalRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.cumulativeRewardRatio) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -228,8 +228,8 @@ export const ValidatorHistoricalRewards = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorHistoricalRewards(); while (reader.pos < end) { @@ -267,9 +267,7 @@ export const ValidatorHistoricalRewards = { message.referenceCount !== undefined && (obj.referenceCount = Math.round(message.referenceCount)); return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorHistoricalRewards { + fromPartial(object: Partial): ValidatorHistoricalRewards { const message = createBaseValidatorHistoricalRewards(); message.cumulativeRewardRatio = object.cumulativeRewardRatio?.map((e) => DecCoin.fromPartial(e)) || []; message.referenceCount = object.referenceCount ?? 0; @@ -279,21 +277,21 @@ export const ValidatorHistoricalRewards = { function createBaseValidatorCurrentRewards(): ValidatorCurrentRewards { return { rewards: [], - period: Long.UZERO, + period: BigInt(0), }; } export const ValidatorCurrentRewards = { - encode(message: ValidatorCurrentRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorCurrentRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (!message.period.isZero()) { + if (message.period !== BigInt(0)) { writer.uint32(16).uint64(message.period); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorCurrentRewards(); while (reader.pos < end) { @@ -303,7 +301,7 @@ export const ValidatorCurrentRewards = { message.rewards.push(DecCoin.decode(reader, reader.uint32())); break; case 2: - message.period = reader.uint64() as Long; + message.period = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -315,7 +313,7 @@ export const ValidatorCurrentRewards = { fromJSON(object: any): ValidatorCurrentRewards { const obj = createBaseValidatorCurrentRewards(); if (Array.isArray(object?.rewards)) obj.rewards = object.rewards.map((e: any) => DecCoin.fromJSON(e)); - if (isSet(object.period)) obj.period = Long.fromValue(object.period); + if (isSet(object.period)) obj.period = BigInt(object.period.toString()); return obj; }, toJSON(message: ValidatorCurrentRewards): unknown { @@ -325,14 +323,14 @@ export const ValidatorCurrentRewards = { } else { obj.rewards = []; } - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ValidatorCurrentRewards { + fromPartial(object: Partial): ValidatorCurrentRewards { const message = createBaseValidatorCurrentRewards(); message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; if (object.period !== undefined && object.period !== null) { - message.period = Long.fromValue(object.period); + message.period = BigInt(object.period.toString()); } return message; }, @@ -343,14 +341,17 @@ function createBaseValidatorAccumulatedCommission(): ValidatorAccumulatedCommiss }; } export const ValidatorAccumulatedCommission = { - encode(message: ValidatorAccumulatedCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorAccumulatedCommission, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.commission) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorAccumulatedCommission(); while (reader.pos < end) { @@ -381,9 +382,7 @@ export const ValidatorAccumulatedCommission = { } return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorAccumulatedCommission { + fromPartial(object: Partial): ValidatorAccumulatedCommission { const message = createBaseValidatorAccumulatedCommission(); message.commission = object.commission?.map((e) => DecCoin.fromPartial(e)) || []; return message; @@ -395,14 +394,14 @@ function createBaseValidatorOutstandingRewards(): ValidatorOutstandingRewards { }; } export const ValidatorOutstandingRewards = { - encode(message: ValidatorOutstandingRewards, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorOutstandingRewards, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewards { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewards { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorOutstandingRewards(); while (reader.pos < end) { @@ -432,9 +431,7 @@ export const ValidatorOutstandingRewards = { } return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorOutstandingRewards { + fromPartial(object: Partial): ValidatorOutstandingRewards { const message = createBaseValidatorOutstandingRewards(); message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; return message; @@ -442,13 +439,13 @@ export const ValidatorOutstandingRewards = { }; function createBaseValidatorSlashEvent(): ValidatorSlashEvent { return { - validatorPeriod: Long.UZERO, + validatorPeriod: BigInt(0), fraction: "", }; } export const ValidatorSlashEvent = { - encode(message: ValidatorSlashEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.validatorPeriod.isZero()) { + encode(message: ValidatorSlashEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorPeriod !== BigInt(0)) { writer.uint32(8).uint64(message.validatorPeriod); } if (message.fraction !== "") { @@ -456,15 +453,15 @@ export const ValidatorSlashEvent = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSlashEvent(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.validatorPeriod = reader.uint64() as Long; + message.validatorPeriod = reader.uint64(); break; case 2: message.fraction = reader.string(); @@ -478,21 +475,21 @@ export const ValidatorSlashEvent = { }, fromJSON(object: any): ValidatorSlashEvent { const obj = createBaseValidatorSlashEvent(); - if (isSet(object.validatorPeriod)) obj.validatorPeriod = Long.fromValue(object.validatorPeriod); + if (isSet(object.validatorPeriod)) obj.validatorPeriod = BigInt(object.validatorPeriod.toString()); if (isSet(object.fraction)) obj.fraction = String(object.fraction); return obj; }, toJSON(message: ValidatorSlashEvent): unknown { const obj: any = {}; message.validatorPeriod !== undefined && - (obj.validatorPeriod = (message.validatorPeriod || Long.UZERO).toString()); + (obj.validatorPeriod = (message.validatorPeriod || BigInt(0)).toString()); message.fraction !== undefined && (obj.fraction = message.fraction); return obj; }, - fromPartial, I>>(object: I): ValidatorSlashEvent { + fromPartial(object: Partial): ValidatorSlashEvent { const message = createBaseValidatorSlashEvent(); if (object.validatorPeriod !== undefined && object.validatorPeriod !== null) { - message.validatorPeriod = Long.fromValue(object.validatorPeriod); + message.validatorPeriod = BigInt(object.validatorPeriod.toString()); } message.fraction = object.fraction ?? ""; return message; @@ -504,14 +501,14 @@ function createBaseValidatorSlashEvents(): ValidatorSlashEvents { }; } export const ValidatorSlashEvents = { - encode(message: ValidatorSlashEvents, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorSlashEvents, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorSlashEvents) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEvents { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEvents { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSlashEvents(); while (reader.pos < end) { @@ -544,7 +541,7 @@ export const ValidatorSlashEvents = { } return obj; }, - fromPartial, I>>(object: I): ValidatorSlashEvents { + fromPartial(object: Partial): ValidatorSlashEvents { const message = createBaseValidatorSlashEvents(); message.validatorSlashEvents = object.validatorSlashEvents?.map((e) => ValidatorSlashEvent.fromPartial(e)) || []; @@ -557,14 +554,14 @@ function createBaseFeePool(): FeePool { }; } export const FeePool = { - encode(message: FeePool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FeePool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.communityPool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FeePool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FeePool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFeePool(); while (reader.pos < end) { @@ -595,7 +592,7 @@ export const FeePool = { } return obj; }, - fromPartial, I>>(object: I): FeePool { + fromPartial(object: Partial): FeePool { const message = createBaseFeePool(); message.communityPool = object.communityPool?.map((e) => DecCoin.fromPartial(e)) || []; return message; @@ -610,7 +607,7 @@ function createBaseCommunityPoolSpendProposal(): CommunityPoolSpendProposal { }; } export const CommunityPoolSpendProposal = { - encode(message: CommunityPoolSpendProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CommunityPoolSpendProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -625,8 +622,8 @@ export const CommunityPoolSpendProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommunityPoolSpendProposal(); while (reader.pos < end) { @@ -671,9 +668,7 @@ export const CommunityPoolSpendProposal = { } return obj; }, - fromPartial, I>>( - object: I, - ): CommunityPoolSpendProposal { + fromPartial(object: Partial): CommunityPoolSpendProposal { const message = createBaseCommunityPoolSpendProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -684,39 +679,39 @@ export const CommunityPoolSpendProposal = { }; function createBaseDelegatorStartingInfo(): DelegatorStartingInfo { return { - previousPeriod: Long.UZERO, + previousPeriod: BigInt(0), stake: "", - height: Long.UZERO, + height: BigInt(0), }; } export const DelegatorStartingInfo = { - encode(message: DelegatorStartingInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.previousPeriod.isZero()) { + encode(message: DelegatorStartingInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.previousPeriod !== BigInt(0)) { writer.uint32(8).uint64(message.previousPeriod); } if (message.stake !== "") { writer.uint32(18).string(message.stake); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).uint64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorStartingInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.previousPeriod = reader.uint64() as Long; + message.previousPeriod = reader.uint64(); break; case 2: message.stake = reader.string(); break; case 3: - message.height = reader.uint64() as Long; + message.height = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -727,27 +722,27 @@ export const DelegatorStartingInfo = { }, fromJSON(object: any): DelegatorStartingInfo { const obj = createBaseDelegatorStartingInfo(); - if (isSet(object.previousPeriod)) obj.previousPeriod = Long.fromValue(object.previousPeriod); + if (isSet(object.previousPeriod)) obj.previousPeriod = BigInt(object.previousPeriod.toString()); if (isSet(object.stake)) obj.stake = String(object.stake); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); return obj; }, toJSON(message: DelegatorStartingInfo): unknown { const obj: any = {}; message.previousPeriod !== undefined && - (obj.previousPeriod = (message.previousPeriod || Long.UZERO).toString()); + (obj.previousPeriod = (message.previousPeriod || BigInt(0)).toString()); message.stake !== undefined && (obj.stake = message.stake); - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): DelegatorStartingInfo { + fromPartial(object: Partial): DelegatorStartingInfo { const message = createBaseDelegatorStartingInfo(); if (object.previousPeriod !== undefined && object.previousPeriod !== null) { - message.previousPeriod = Long.fromValue(object.previousPeriod); + message.previousPeriod = BigInt(object.previousPeriod.toString()); } message.stake = object.stake ?? ""; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } return message; }, @@ -759,7 +754,7 @@ function createBaseDelegationDelegatorReward(): DelegationDelegatorReward { }; } export const DelegationDelegatorReward = { - encode(message: DelegationDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelegationDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -768,8 +763,8 @@ export const DelegationDelegatorReward = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegationDelegatorReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegationDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegationDelegatorReward(); while (reader.pos < end) { @@ -804,9 +799,7 @@ export const DelegationDelegatorReward = { } return obj; }, - fromPartial, I>>( - object: I, - ): DelegationDelegatorReward { + fromPartial(object: Partial): DelegationDelegatorReward { const message = createBaseDelegationDelegatorReward(); message.validatorAddress = object.validatorAddress ?? ""; message.reward = object.reward?.map((e) => DecCoin.fromPartial(e)) || []; @@ -825,8 +818,8 @@ function createBaseCommunityPoolSpendProposalWithDeposit(): CommunityPoolSpendPr export const CommunityPoolSpendProposalWithDeposit = { encode( message: CommunityPoolSpendProposalWithDeposit, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -844,8 +837,8 @@ export const CommunityPoolSpendProposalWithDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommunityPoolSpendProposalWithDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommunityPoolSpendProposalWithDeposit(); while (reader.pos < end) { @@ -891,9 +884,7 @@ export const CommunityPoolSpendProposalWithDeposit = { message.deposit !== undefined && (obj.deposit = message.deposit); return obj; }, - fromPartial, I>>( - object: I, - ): CommunityPoolSpendProposalWithDeposit { + fromPartial(object: Partial): CommunityPoolSpendProposalWithDeposit { const message = createBaseCommunityPoolSpendProposalWithDeposit(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -905,13 +896,13 @@ export const CommunityPoolSpendProposalWithDeposit = { }; function createBaseTokenizeShareRecordReward(): TokenizeShareRecordReward { return { - recordId: Long.UZERO, + recordId: BigInt(0), reward: [], }; } export const TokenizeShareRecordReward = { - encode(message: TokenizeShareRecordReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.recordId.isZero()) { + encode(message: TokenizeShareRecordReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.recordId !== BigInt(0)) { writer.uint32(8).uint64(message.recordId); } for (const v of message.reward) { @@ -919,15 +910,15 @@ export const TokenizeShareRecordReward = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TokenizeShareRecordReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TokenizeShareRecordReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTokenizeShareRecordReward(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.recordId = reader.uint64() as Long; + message.recordId = reader.uint64(); break; case 2: message.reward.push(DecCoin.decode(reader, reader.uint32())); @@ -941,13 +932,13 @@ export const TokenizeShareRecordReward = { }, fromJSON(object: any): TokenizeShareRecordReward { const obj = createBaseTokenizeShareRecordReward(); - if (isSet(object.recordId)) obj.recordId = Long.fromValue(object.recordId); + if (isSet(object.recordId)) obj.recordId = BigInt(object.recordId.toString()); if (Array.isArray(object?.reward)) obj.reward = object.reward.map((e: any) => DecCoin.fromJSON(e)); return obj; }, toJSON(message: TokenizeShareRecordReward): unknown { const obj: any = {}; - message.recordId !== undefined && (obj.recordId = (message.recordId || Long.UZERO).toString()); + message.recordId !== undefined && (obj.recordId = (message.recordId || BigInt(0)).toString()); if (message.reward) { obj.reward = message.reward.map((e) => (e ? DecCoin.toJSON(e) : undefined)); } else { @@ -955,12 +946,10 @@ export const TokenizeShareRecordReward = { } return obj; }, - fromPartial, I>>( - object: I, - ): TokenizeShareRecordReward { + fromPartial(object: Partial): TokenizeShareRecordReward { const message = createBaseTokenizeShareRecordReward(); if (object.recordId !== undefined && object.recordId !== null) { - message.recordId = Long.fromValue(object.recordId); + message.recordId = BigInt(object.recordId.toString()); } message.reward = object.reward?.map((e) => DecCoin.fromPartial(e)) || []; return message; diff --git a/src/cosmos/distribution/v1beta1/genesis.ts b/src/cosmos/distribution/v1beta1/genesis.ts index 8a457cc..70dd332 100644 --- a/src/cosmos/distribution/v1beta1/genesis.ts +++ b/src/cosmos/distribution/v1beta1/genesis.ts @@ -9,8 +9,8 @@ import { Params, FeePool, } from "./distribution"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.distribution.v1beta1"; /** * DelegatorWithdrawInfo is the address for where distributions rewards are @@ -48,7 +48,7 @@ export interface ValidatorHistoricalRewardsRecord { /** validator_address is the address of the validator. */ validatorAddress: string; /** period defines the period the historical rewards apply to. */ - period: Long; + period: bigint; /** rewards defines the historical rewards of a validator. */ rewards: ValidatorHistoricalRewards; } @@ -73,9 +73,9 @@ export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ validatorAddress: string; /** height defines the block height at which the slash event occurred. */ - height: Long; + height: bigint; /** period is the period of the slash event. */ - period: Long; + period: bigint; /** validator_slash_event describes the slash event. */ validatorSlashEvent: ValidatorSlashEvent; } @@ -109,7 +109,7 @@ function createBaseDelegatorWithdrawInfo(): DelegatorWithdrawInfo { }; } export const DelegatorWithdrawInfo = { - encode(message: DelegatorWithdrawInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelegatorWithdrawInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -118,8 +118,8 @@ export const DelegatorWithdrawInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorWithdrawInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorWithdrawInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorWithdrawInfo(); while (reader.pos < end) { @@ -150,7 +150,7 @@ export const DelegatorWithdrawInfo = { message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); return obj; }, - fromPartial, I>>(object: I): DelegatorWithdrawInfo { + fromPartial(object: Partial): DelegatorWithdrawInfo { const message = createBaseDelegatorWithdrawInfo(); message.delegatorAddress = object.delegatorAddress ?? ""; message.withdrawAddress = object.withdrawAddress ?? ""; @@ -164,7 +164,10 @@ function createBaseValidatorOutstandingRewardsRecord(): ValidatorOutstandingRewa }; } export const ValidatorOutstandingRewardsRecord = { - encode(message: ValidatorOutstandingRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorOutstandingRewardsRecord, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -173,8 +176,8 @@ export const ValidatorOutstandingRewardsRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorOutstandingRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorOutstandingRewardsRecord(); while (reader.pos < end) { @@ -210,9 +213,7 @@ export const ValidatorOutstandingRewardsRecord = { } return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorOutstandingRewardsRecord { + fromPartial(object: Partial): ValidatorOutstandingRewardsRecord { const message = createBaseValidatorOutstandingRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; message.outstandingRewards = object.outstandingRewards?.map((e) => DecCoin.fromPartial(e)) || []; @@ -228,8 +229,8 @@ function createBaseValidatorAccumulatedCommissionRecord(): ValidatorAccumulatedC export const ValidatorAccumulatedCommissionRecord = { encode( message: ValidatorAccumulatedCommissionRecord, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -238,8 +239,8 @@ export const ValidatorAccumulatedCommissionRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorAccumulatedCommissionRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorAccumulatedCommissionRecord(); while (reader.pos < end) { @@ -274,9 +275,7 @@ export const ValidatorAccumulatedCommissionRecord = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorAccumulatedCommissionRecord { + fromPartial(object: Partial): ValidatorAccumulatedCommissionRecord { const message = createBaseValidatorAccumulatedCommissionRecord(); message.validatorAddress = object.validatorAddress ?? ""; if (object.accumulated !== undefined && object.accumulated !== null) { @@ -288,16 +287,19 @@ export const ValidatorAccumulatedCommissionRecord = { function createBaseValidatorHistoricalRewardsRecord(): ValidatorHistoricalRewardsRecord { return { validatorAddress: "", - period: Long.UZERO, + period: BigInt(0), rewards: ValidatorHistoricalRewards.fromPartial({}), }; } export const ValidatorHistoricalRewardsRecord = { - encode(message: ValidatorHistoricalRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ValidatorHistoricalRewardsRecord, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } - if (!message.period.isZero()) { + if (message.period !== BigInt(0)) { writer.uint32(16).uint64(message.period); } if (message.rewards !== undefined) { @@ -305,8 +307,8 @@ export const ValidatorHistoricalRewardsRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorHistoricalRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorHistoricalRewardsRecord(); while (reader.pos < end) { @@ -316,7 +318,7 @@ export const ValidatorHistoricalRewardsRecord = { message.validatorAddress = reader.string(); break; case 2: - message.period = reader.uint64() as Long; + message.period = reader.uint64(); break; case 3: message.rewards = ValidatorHistoricalRewards.decode(reader, reader.uint32()); @@ -331,25 +333,23 @@ export const ValidatorHistoricalRewardsRecord = { fromJSON(object: any): ValidatorHistoricalRewardsRecord { const obj = createBaseValidatorHistoricalRewardsRecord(); if (isSet(object.validatorAddress)) obj.validatorAddress = String(object.validatorAddress); - if (isSet(object.period)) obj.period = Long.fromValue(object.period); + if (isSet(object.period)) obj.period = BigInt(object.period.toString()); if (isSet(object.rewards)) obj.rewards = ValidatorHistoricalRewards.fromJSON(object.rewards); return obj; }, toJSON(message: ValidatorHistoricalRewardsRecord): unknown { const obj: any = {}; message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); message.rewards !== undefined && (obj.rewards = message.rewards ? ValidatorHistoricalRewards.toJSON(message.rewards) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorHistoricalRewardsRecord { + fromPartial(object: Partial): ValidatorHistoricalRewardsRecord { const message = createBaseValidatorHistoricalRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; if (object.period !== undefined && object.period !== null) { - message.period = Long.fromValue(object.period); + message.period = BigInt(object.period.toString()); } if (object.rewards !== undefined && object.rewards !== null) { message.rewards = ValidatorHistoricalRewards.fromPartial(object.rewards); @@ -364,7 +364,7 @@ function createBaseValidatorCurrentRewardsRecord(): ValidatorCurrentRewardsRecor }; } export const ValidatorCurrentRewardsRecord = { - encode(message: ValidatorCurrentRewardsRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorCurrentRewardsRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -373,8 +373,8 @@ export const ValidatorCurrentRewardsRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorCurrentRewardsRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorCurrentRewardsRecord(); while (reader.pos < end) { @@ -406,9 +406,7 @@ export const ValidatorCurrentRewardsRecord = { (obj.rewards = message.rewards ? ValidatorCurrentRewards.toJSON(message.rewards) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorCurrentRewardsRecord { + fromPartial(object: Partial): ValidatorCurrentRewardsRecord { const message = createBaseValidatorCurrentRewardsRecord(); message.validatorAddress = object.validatorAddress ?? ""; if (object.rewards !== undefined && object.rewards !== null) { @@ -425,7 +423,7 @@ function createBaseDelegatorStartingInfoRecord(): DelegatorStartingInfoRecord { }; } export const DelegatorStartingInfoRecord = { - encode(message: DelegatorStartingInfoRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelegatorStartingInfoRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -437,8 +435,8 @@ export const DelegatorStartingInfoRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorStartingInfoRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorStartingInfoRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorStartingInfoRecord(); while (reader.pos < end) { @@ -477,9 +475,7 @@ export const DelegatorStartingInfoRecord = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): DelegatorStartingInfoRecord { + fromPartial(object: Partial): DelegatorStartingInfoRecord { const message = createBaseDelegatorStartingInfoRecord(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -492,20 +488,20 @@ export const DelegatorStartingInfoRecord = { function createBaseValidatorSlashEventRecord(): ValidatorSlashEventRecord { return { validatorAddress: "", - height: Long.UZERO, - period: Long.UZERO, + height: BigInt(0), + period: BigInt(0), validatorSlashEvent: ValidatorSlashEvent.fromPartial({}), }; } export const ValidatorSlashEventRecord = { - encode(message: ValidatorSlashEventRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorSlashEventRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(16).uint64(message.height); } - if (!message.period.isZero()) { + if (message.period !== BigInt(0)) { writer.uint32(24).uint64(message.period); } if (message.validatorSlashEvent !== undefined) { @@ -513,8 +509,8 @@ export const ValidatorSlashEventRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSlashEventRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSlashEventRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSlashEventRecord(); while (reader.pos < end) { @@ -524,10 +520,10 @@ export const ValidatorSlashEventRecord = { message.validatorAddress = reader.string(); break; case 2: - message.height = reader.uint64() as Long; + message.height = reader.uint64(); break; case 3: - message.period = reader.uint64() as Long; + message.period = reader.uint64(); break; case 4: message.validatorSlashEvent = ValidatorSlashEvent.decode(reader, reader.uint32()); @@ -542,8 +538,8 @@ export const ValidatorSlashEventRecord = { fromJSON(object: any): ValidatorSlashEventRecord { const obj = createBaseValidatorSlashEventRecord(); if (isSet(object.validatorAddress)) obj.validatorAddress = String(object.validatorAddress); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); - if (isSet(object.period)) obj.period = Long.fromValue(object.period); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); + if (isSet(object.period)) obj.period = BigInt(object.period.toString()); if (isSet(object.validatorSlashEvent)) obj.validatorSlashEvent = ValidatorSlashEvent.fromJSON(object.validatorSlashEvent); return obj; @@ -551,24 +547,22 @@ export const ValidatorSlashEventRecord = { toJSON(message: ValidatorSlashEventRecord): unknown { const obj: any = {}; message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); - message.period !== undefined && (obj.period = (message.period || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.period !== undefined && (obj.period = (message.period || BigInt(0)).toString()); message.validatorSlashEvent !== undefined && (obj.validatorSlashEvent = message.validatorSlashEvent ? ValidatorSlashEvent.toJSON(message.validatorSlashEvent) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): ValidatorSlashEventRecord { + fromPartial(object: Partial): ValidatorSlashEventRecord { const message = createBaseValidatorSlashEventRecord(); message.validatorAddress = object.validatorAddress ?? ""; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.period !== undefined && object.period !== null) { - message.period = Long.fromValue(object.period); + message.period = BigInt(object.period.toString()); } if (object.validatorSlashEvent !== undefined && object.validatorSlashEvent !== null) { message.validatorSlashEvent = ValidatorSlashEvent.fromPartial(object.validatorSlashEvent); @@ -591,7 +585,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -624,8 +618,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -764,7 +758,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); diff --git a/src/cosmos/distribution/v1beta1/query.ts b/src/cosmos/distribution/v1beta1/query.ts index 71a5124..619ac3a 100644 --- a/src/cosmos/distribution/v1beta1/query.ts +++ b/src/cosmos/distribution/v1beta1/query.ts @@ -9,8 +9,8 @@ import { TokenizeShareRecordReward, } from "./distribution"; import { DecCoin } from "../../base/v1beta1/coin"; -import { Long, DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.distribution.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -72,9 +72,9 @@ export interface QueryValidatorSlashesRequest { /** validator_address defines the validator address to query for. */ validatorAddress: string; /** starting_height defines the optional starting height to query the slashes. */ - startingHeight: Long; + startingHeight: bigint; /** starting_height defines the optional ending height to query the slashes. */ - endingHeight: Long; + endingHeight: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -194,11 +194,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -219,7 +219,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -230,14 +230,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -263,7 +263,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -279,15 +279,15 @@ function createBaseQueryValidatorDistributionInfoRequest(): QueryValidatorDistri export const QueryValidatorDistributionInfoRequest = { encode( message: QueryValidatorDistributionInfoRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDistributionInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorDistributionInfoRequest(); while (reader.pos < end) { @@ -313,9 +313,7 @@ export const QueryValidatorDistributionInfoRequest = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorDistributionInfoRequest { + fromPartial(object: Partial): QueryValidatorDistributionInfoRequest { const message = createBaseQueryValidatorDistributionInfoRequest(); message.validatorAddress = object.validatorAddress ?? ""; return message; @@ -331,8 +329,8 @@ function createBaseQueryValidatorDistributionInfoResponse(): QueryValidatorDistr export const QueryValidatorDistributionInfoResponse = { encode( message: QueryValidatorDistributionInfoResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.operatorAddress !== "") { writer.uint32(10).string(message.operatorAddress); } @@ -344,8 +342,8 @@ export const QueryValidatorDistributionInfoResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDistributionInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorDistributionInfoResponse(); while (reader.pos < end) { @@ -391,8 +389,8 @@ export const QueryValidatorDistributionInfoResponse = { } return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryValidatorDistributionInfoResponse { const message = createBaseQueryValidatorDistributionInfoResponse(); message.operatorAddress = object.operatorAddress ?? ""; @@ -409,15 +407,15 @@ function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOuts export const QueryValidatorOutstandingRewardsRequest = { encode( message: QueryValidatorOutstandingRewardsRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorOutstandingRewardsRequest(); while (reader.pos < end) { @@ -443,8 +441,8 @@ export const QueryValidatorOutstandingRewardsRequest = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryValidatorOutstandingRewardsRequest { const message = createBaseQueryValidatorOutstandingRewardsRequest(); message.validatorAddress = object.validatorAddress ?? ""; @@ -459,15 +457,15 @@ function createBaseQueryValidatorOutstandingRewardsResponse(): QueryValidatorOut export const QueryValidatorOutstandingRewardsResponse = { encode( message: QueryValidatorOutstandingRewardsResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.rewards !== undefined) { ValidatorOutstandingRewards.encode(message.rewards, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorOutstandingRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorOutstandingRewardsResponse(); while (reader.pos < end) { @@ -494,8 +492,8 @@ export const QueryValidatorOutstandingRewardsResponse = { (obj.rewards = message.rewards ? ValidatorOutstandingRewards.toJSON(message.rewards) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryValidatorOutstandingRewardsResponse { const message = createBaseQueryValidatorOutstandingRewardsResponse(); if (object.rewards !== undefined && object.rewards !== null) { @@ -510,14 +508,17 @@ function createBaseQueryValidatorCommissionRequest(): QueryValidatorCommissionRe }; } export const QueryValidatorCommissionRequest = { - encode(message: QueryValidatorCommissionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorCommissionRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorCommissionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorCommissionRequest(); while (reader.pos < end) { @@ -543,9 +544,7 @@ export const QueryValidatorCommissionRequest = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorCommissionRequest { + fromPartial(object: Partial): QueryValidatorCommissionRequest { const message = createBaseQueryValidatorCommissionRequest(); message.validatorAddress = object.validatorAddress ?? ""; return message; @@ -557,14 +556,17 @@ function createBaseQueryValidatorCommissionResponse(): QueryValidatorCommissionR }; } export const QueryValidatorCommissionResponse = { - encode(message: QueryValidatorCommissionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorCommissionResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.commission !== undefined) { ValidatorAccumulatedCommission.encode(message.commission, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorCommissionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorCommissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorCommissionResponse(); while (reader.pos < end) { @@ -593,9 +595,7 @@ export const QueryValidatorCommissionResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorCommissionResponse { + fromPartial(object: Partial): QueryValidatorCommissionResponse { const message = createBaseQueryValidatorCommissionResponse(); if (object.commission !== undefined && object.commission !== null) { message.commission = ValidatorAccumulatedCommission.fromPartial(object.commission); @@ -606,20 +606,20 @@ export const QueryValidatorCommissionResponse = { function createBaseQueryValidatorSlashesRequest(): QueryValidatorSlashesRequest { return { validatorAddress: "", - startingHeight: Long.UZERO, - endingHeight: Long.UZERO, + startingHeight: BigInt(0), + endingHeight: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryValidatorSlashesRequest = { - encode(message: QueryValidatorSlashesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryValidatorSlashesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } - if (!message.startingHeight.isZero()) { + if (message.startingHeight !== BigInt(0)) { writer.uint32(16).uint64(message.startingHeight); } - if (!message.endingHeight.isZero()) { + if (message.endingHeight !== BigInt(0)) { writer.uint32(24).uint64(message.endingHeight); } if (message.pagination !== undefined) { @@ -627,8 +627,8 @@ export const QueryValidatorSlashesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorSlashesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorSlashesRequest(); while (reader.pos < end) { @@ -638,10 +638,10 @@ export const QueryValidatorSlashesRequest = { message.validatorAddress = reader.string(); break; case 2: - message.startingHeight = reader.uint64() as Long; + message.startingHeight = reader.uint64(); break; case 3: - message.endingHeight = reader.uint64() as Long; + message.endingHeight = reader.uint64(); break; case 4: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -656,8 +656,8 @@ export const QueryValidatorSlashesRequest = { fromJSON(object: any): QueryValidatorSlashesRequest { const obj = createBaseQueryValidatorSlashesRequest(); if (isSet(object.validatorAddress)) obj.validatorAddress = String(object.validatorAddress); - if (isSet(object.startingHeight)) obj.startingHeight = Long.fromValue(object.startingHeight); - if (isSet(object.endingHeight)) obj.endingHeight = Long.fromValue(object.endingHeight); + if (isSet(object.startingHeight)) obj.startingHeight = BigInt(object.startingHeight.toString()); + if (isSet(object.endingHeight)) obj.endingHeight = BigInt(object.endingHeight.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, @@ -665,23 +665,20 @@ export const QueryValidatorSlashesRequest = { const obj: any = {}; message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); message.startingHeight !== undefined && - (obj.startingHeight = (message.startingHeight || Long.UZERO).toString()); - message.endingHeight !== undefined && - (obj.endingHeight = (message.endingHeight || Long.UZERO).toString()); + (obj.startingHeight = (message.startingHeight || BigInt(0)).toString()); + message.endingHeight !== undefined && (obj.endingHeight = (message.endingHeight || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorSlashesRequest { + fromPartial(object: Partial): QueryValidatorSlashesRequest { const message = createBaseQueryValidatorSlashesRequest(); message.validatorAddress = object.validatorAddress ?? ""; if (object.startingHeight !== undefined && object.startingHeight !== null) { - message.startingHeight = Long.fromValue(object.startingHeight); + message.startingHeight = BigInt(object.startingHeight.toString()); } if (object.endingHeight !== undefined && object.endingHeight !== null) { - message.endingHeight = Long.fromValue(object.endingHeight); + message.endingHeight = BigInt(object.endingHeight.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -696,7 +693,7 @@ function createBaseQueryValidatorSlashesResponse(): QueryValidatorSlashesRespons }; } export const QueryValidatorSlashesResponse = { - encode(message: QueryValidatorSlashesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryValidatorSlashesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.slashes) { ValidatorSlashEvent.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -705,8 +702,8 @@ export const QueryValidatorSlashesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorSlashesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorSlashesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorSlashesResponse(); while (reader.pos < end) { @@ -743,9 +740,7 @@ export const QueryValidatorSlashesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorSlashesResponse { + fromPartial(object: Partial): QueryValidatorSlashesResponse { const message = createBaseQueryValidatorSlashesResponse(); message.slashes = object.slashes?.map((e) => ValidatorSlashEvent.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -761,7 +756,7 @@ function createBaseQueryDelegationRewardsRequest(): QueryDelegationRewardsReques }; } export const QueryDelegationRewardsRequest = { - encode(message: QueryDelegationRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDelegationRewardsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -770,8 +765,8 @@ export const QueryDelegationRewardsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationRewardsRequest(); while (reader.pos < end) { @@ -802,9 +797,7 @@ export const QueryDelegationRewardsRequest = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegationRewardsRequest { + fromPartial(object: Partial): QueryDelegationRewardsRequest { const message = createBaseQueryDelegationRewardsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -817,14 +810,17 @@ function createBaseQueryDelegationRewardsResponse(): QueryDelegationRewardsRespo }; } export const QueryDelegationRewardsResponse = { - encode(message: QueryDelegationRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationRewardsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.rewards) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationRewardsResponse(); while (reader.pos < end) { @@ -854,9 +850,7 @@ export const QueryDelegationRewardsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegationRewardsResponse { + fromPartial(object: Partial): QueryDelegationRewardsResponse { const message = createBaseQueryDelegationRewardsResponse(); message.rewards = object.rewards?.map((e) => DecCoin.fromPartial(e)) || []; return message; @@ -868,14 +862,17 @@ function createBaseQueryDelegationTotalRewardsRequest(): QueryDelegationTotalRew }; } export const QueryDelegationTotalRewardsRequest = { - encode(message: QueryDelegationTotalRewardsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationTotalRewardsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationTotalRewardsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationTotalRewardsRequest(); while (reader.pos < end) { @@ -901,9 +898,7 @@ export const QueryDelegationTotalRewardsRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegationTotalRewardsRequest { + fromPartial(object: Partial): QueryDelegationTotalRewardsRequest { const message = createBaseQueryDelegationTotalRewardsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -916,7 +911,10 @@ function createBaseQueryDelegationTotalRewardsResponse(): QueryDelegationTotalRe }; } export const QueryDelegationTotalRewardsResponse = { - encode(message: QueryDelegationTotalRewardsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegationTotalRewardsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.rewards) { DelegationDelegatorReward.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -925,8 +923,8 @@ export const QueryDelegationTotalRewardsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationTotalRewardsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationTotalRewardsResponse(); while (reader.pos < end) { @@ -966,9 +964,7 @@ export const QueryDelegationTotalRewardsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegationTotalRewardsResponse { + fromPartial(object: Partial): QueryDelegationTotalRewardsResponse { const message = createBaseQueryDelegationTotalRewardsResponse(); message.rewards = object.rewards?.map((e) => DelegationDelegatorReward.fromPartial(e)) || []; message.total = object.total?.map((e) => DecCoin.fromPartial(e)) || []; @@ -981,14 +977,17 @@ function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRe }; } export const QueryDelegatorValidatorsRequest = { - encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsRequest(); while (reader.pos < end) { @@ -1014,9 +1013,7 @@ export const QueryDelegatorValidatorsRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorValidatorsRequest { + fromPartial(object: Partial): QueryDelegatorValidatorsRequest { const message = createBaseQueryDelegatorValidatorsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -1028,14 +1025,17 @@ function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsR }; } export const QueryDelegatorValidatorsResponse = { - encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.validators) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsResponse(); while (reader.pos < end) { @@ -1065,9 +1065,7 @@ export const QueryDelegatorValidatorsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorValidatorsResponse { + fromPartial(object: Partial): QueryDelegatorValidatorsResponse { const message = createBaseQueryDelegatorValidatorsResponse(); message.validators = object.validators?.map((e) => e) || []; return message; @@ -1081,15 +1079,15 @@ function createBaseQueryDelegatorWithdrawAddressRequest(): QueryDelegatorWithdra export const QueryDelegatorWithdrawAddressRequest = { encode( message: QueryDelegatorWithdrawAddressRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorWithdrawAddressRequest(); while (reader.pos < end) { @@ -1115,9 +1113,7 @@ export const QueryDelegatorWithdrawAddressRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorWithdrawAddressRequest { + fromPartial(object: Partial): QueryDelegatorWithdrawAddressRequest { const message = createBaseQueryDelegatorWithdrawAddressRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -1131,15 +1127,15 @@ function createBaseQueryDelegatorWithdrawAddressResponse(): QueryDelegatorWithdr export const QueryDelegatorWithdrawAddressResponse = { encode( message: QueryDelegatorWithdrawAddressResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.withdrawAddress !== "") { writer.uint32(10).string(message.withdrawAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorWithdrawAddressResponse(); while (reader.pos < end) { @@ -1165,9 +1161,7 @@ export const QueryDelegatorWithdrawAddressResponse = { message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorWithdrawAddressResponse { + fromPartial(object: Partial): QueryDelegatorWithdrawAddressResponse { const message = createBaseQueryDelegatorWithdrawAddressResponse(); message.withdrawAddress = object.withdrawAddress ?? ""; return message; @@ -1177,11 +1171,11 @@ function createBaseQueryCommunityPoolRequest(): QueryCommunityPoolRequest { return {}; } export const QueryCommunityPoolRequest = { - encode(_: QueryCommunityPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryCommunityPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCommunityPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCommunityPoolRequest(); while (reader.pos < end) { @@ -1202,7 +1196,7 @@ export const QueryCommunityPoolRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryCommunityPoolRequest { + fromPartial(_: Partial): QueryCommunityPoolRequest { const message = createBaseQueryCommunityPoolRequest(); return message; }, @@ -1213,14 +1207,14 @@ function createBaseQueryCommunityPoolResponse(): QueryCommunityPoolResponse { }; } export const QueryCommunityPoolResponse = { - encode(message: QueryCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pool) { DecCoin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCommunityPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCommunityPoolResponse(); while (reader.pos < end) { @@ -1250,9 +1244,7 @@ export const QueryCommunityPoolResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryCommunityPoolResponse { + fromPartial(object: Partial): QueryCommunityPoolResponse { const message = createBaseQueryCommunityPoolResponse(); message.pool = object.pool?.map((e) => DecCoin.fromPartial(e)) || []; return message; @@ -1266,15 +1258,15 @@ function createBaseQueryTokenizeShareRecordRewardRequest(): QueryTokenizeShareRe export const QueryTokenizeShareRecordRewardRequest = { encode( message: QueryTokenizeShareRecordRewardRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.ownerAddress !== "") { writer.uint32(10).string(message.ownerAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordRewardRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordRewardRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordRewardRequest(); while (reader.pos < end) { @@ -1300,9 +1292,7 @@ export const QueryTokenizeShareRecordRewardRequest = { message.ownerAddress !== undefined && (obj.ownerAddress = message.ownerAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTokenizeShareRecordRewardRequest { + fromPartial(object: Partial): QueryTokenizeShareRecordRewardRequest { const message = createBaseQueryTokenizeShareRecordRewardRequest(); message.ownerAddress = object.ownerAddress ?? ""; return message; @@ -1317,8 +1307,8 @@ function createBaseQueryTokenizeShareRecordRewardResponse(): QueryTokenizeShareR export const QueryTokenizeShareRecordRewardResponse = { encode( message: QueryTokenizeShareRecordRewardResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.rewards) { TokenizeShareRecordReward.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1327,8 +1317,8 @@ export const QueryTokenizeShareRecordRewardResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordRewardResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordRewardResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordRewardResponse(); while (reader.pos < end) { @@ -1368,8 +1358,8 @@ export const QueryTokenizeShareRecordRewardResponse = { } return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryTokenizeShareRecordRewardResponse { const message = createBaseQueryTokenizeShareRecordRewardResponse(); message.rewards = object.rewards?.map((e) => TokenizeShareRecordReward.fromPartial(e)) || []; @@ -1438,14 +1428,14 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } ValidatorDistributionInfo( request: QueryValidatorDistributionInfoRequest, ): Promise { const data = QueryValidatorDistributionInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorDistributionInfo", data); - return promise.then((data) => QueryValidatorDistributionInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorDistributionInfoResponse.decode(new BinaryReader(data))); } ValidatorOutstandingRewards( request: QueryValidatorOutstandingRewardsRequest, @@ -1456,52 +1446,52 @@ export class QueryClientImpl implements Query { "ValidatorOutstandingRewards", data, ); - return promise.then((data) => QueryValidatorOutstandingRewardsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorOutstandingRewardsResponse.decode(new BinaryReader(data))); } ValidatorCommission(request: QueryValidatorCommissionRequest): Promise { const data = QueryValidatorCommissionRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorCommission", data); - return promise.then((data) => QueryValidatorCommissionResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorCommissionResponse.decode(new BinaryReader(data))); } ValidatorSlashes(request: QueryValidatorSlashesRequest): Promise { const data = QueryValidatorSlashesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorSlashes", data); - return promise.then((data) => QueryValidatorSlashesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorSlashesResponse.decode(new BinaryReader(data))); } DelegationRewards(request: QueryDelegationRewardsRequest): Promise { const data = QueryDelegationRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationRewards", data); - return promise.then((data) => QueryDelegationRewardsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegationRewardsResponse.decode(new BinaryReader(data))); } DelegationTotalRewards( request: QueryDelegationTotalRewardsRequest, ): Promise { const data = QueryDelegationTotalRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegationTotalRewards", data); - return promise.then((data) => QueryDelegationTotalRewardsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegationTotalRewardsResponse.decode(new BinaryReader(data))); } DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { const data = QueryDelegatorValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorValidators", data); - return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new BinaryReader(data))); } DelegatorWithdrawAddress( request: QueryDelegatorWithdrawAddressRequest, ): Promise { const data = QueryDelegatorWithdrawAddressRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "DelegatorWithdrawAddress", data); - return promise.then((data) => QueryDelegatorWithdrawAddressResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorWithdrawAddressResponse.decode(new BinaryReader(data))); } CommunityPool(request: QueryCommunityPoolRequest = {}): Promise { const data = QueryCommunityPoolRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "CommunityPool", data); - return promise.then((data) => QueryCommunityPoolResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCommunityPoolResponse.decode(new BinaryReader(data))); } TokenizeShareRecordReward( request: QueryTokenizeShareRecordRewardRequest, ): Promise { const data = QueryTokenizeShareRecordRewardRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "TokenizeShareRecordReward", data); - return promise.then((data) => QueryTokenizeShareRecordRewardResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTokenizeShareRecordRewardResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/distribution/v1beta1/tx.amino.ts b/src/cosmos/distribution/v1beta1/tx.amino.ts new file mode 100644 index 0000000..99a1021 --- /dev/null +++ b/src/cosmos/distribution/v1beta1/tx.amino.ts @@ -0,0 +1,254 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { + MsgSetWithdrawAddress, + MsgWithdrawDelegatorReward, + MsgWithdrawValidatorCommission, + MsgFundCommunityPool, + MsgUpdateParams, + MsgCommunityPoolSpend, + MsgWithdrawTokenizeShareRecordReward, + MsgWithdrawAllTokenizeShareRecordReward, +} from "./tx"; +export interface MsgSetWithdrawAddressAminoType extends AminoMsg { + type: "cosmos-sdk/MsgModifyWithdrawAddress"; + value: { + delegator_address: string; + withdraw_address: string; + }; +} +export interface MsgWithdrawDelegatorRewardAminoType extends AminoMsg { + type: "cosmos-sdk/MsgWithdrawDelegationReward"; + value: { + delegator_address: string; + validator_address: string; + }; +} +export interface MsgWithdrawValidatorCommissionAminoType extends AminoMsg { + type: "cosmos-sdk/MsgWithdrawValidatorCommission"; + value: { + validator_address: string; + }; +} +export interface MsgFundCommunityPoolAminoType extends AminoMsg { + type: "cosmos-sdk/MsgFundCommunityPool"; + value: { + amount: { + denom: string; + amount: string; + }[]; + depositor: string; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/distribution/MsgUpdateParams"; + value: { + authority: string; + params: { + community_tax: string; + base_proposer_reward: string; + bonus_proposer_reward: string; + withdraw_addr_enabled: boolean; + }; + }; +} +export interface MsgCommunityPoolSpendAminoType extends AminoMsg { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend"; + value: { + authority: string; + recipient: string; + amount: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgWithdrawTokenizeShareRecordRewardAminoType extends AminoMsg { + type: "cosmos-sdk/MsgWithdrawTokenizeShareRecordReward"; + value: { + owner_address: string; + record_id: string; + }; +} +export interface MsgWithdrawAllTokenizeShareRecordRewardAminoType extends AminoMsg { + type: "cosmos-sdk/MsgWithdrawAllTokenizeShareRecordReward"; + value: { + owner_address: string; + }; +} +export const AminoConverter = { + "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { + aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", + toAmino: ({ + delegatorAddress, + withdrawAddress, + }: MsgSetWithdrawAddress): MsgSetWithdrawAddressAminoType["value"] => { + return { + delegator_address: delegatorAddress, + withdraw_address: withdrawAddress, + }; + }, + fromAmino: ({ + delegator_address, + withdraw_address, + }: MsgSetWithdrawAddressAminoType["value"]): MsgSetWithdrawAddress => { + return { + delegatorAddress: delegator_address, + withdrawAddress: withdraw_address, + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward": { + aminoType: "cosmos-sdk/MsgWithdrawDelegationReward", + toAmino: ({ + delegatorAddress, + validatorAddress, + }: MsgWithdrawDelegatorReward): MsgWithdrawDelegatorRewardAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + }; + }, + fromAmino: ({ + delegator_address, + validator_address, + }: MsgWithdrawDelegatorRewardAminoType["value"]): MsgWithdrawDelegatorReward => { + return { + delegatorAddress: delegator_address, + validatorAddress: validator_address, + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission": { + aminoType: "cosmos-sdk/MsgWithdrawValidatorCommission", + toAmino: ({ + validatorAddress, + }: MsgWithdrawValidatorCommission): MsgWithdrawValidatorCommissionAminoType["value"] => { + return { + validator_address: validatorAddress, + }; + }, + fromAmino: ({ + validator_address, + }: MsgWithdrawValidatorCommissionAminoType["value"]): MsgWithdrawValidatorCommission => { + return { + validatorAddress: validator_address, + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgFundCommunityPool": { + aminoType: "cosmos-sdk/MsgFundCommunityPool", + toAmino: ({ amount, depositor }: MsgFundCommunityPool): MsgFundCommunityPoolAminoType["value"] => { + return { + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + depositor, + }; + }, + fromAmino: ({ amount, depositor }: MsgFundCommunityPoolAminoType["value"]): MsgFundCommunityPool => { + return { + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + depositor, + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + community_tax: params.communityTax, + base_proposer_reward: params.baseProposerReward, + bonus_proposer_reward: params.bonusProposerReward, + withdraw_addr_enabled: params.withdrawAddrEnabled, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + communityTax: params.community_tax, + baseProposerReward: params.base_proposer_reward, + bonusProposerReward: params.bonus_proposer_reward, + withdrawAddrEnabled: params.withdraw_addr_enabled, + }, + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend": { + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + toAmino: ({ + authority, + recipient, + amount, + }: MsgCommunityPoolSpend): MsgCommunityPoolSpendAminoType["value"] => { + return { + authority, + recipient, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ + authority, + recipient, + amount, + }: MsgCommunityPoolSpendAminoType["value"]): MsgCommunityPoolSpend => { + return { + authority, + recipient, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward": { + aminoType: "cosmos-sdk/MsgWithdrawTokenizeShareRecordReward", + toAmino: ({ + ownerAddress, + recordId, + }: MsgWithdrawTokenizeShareRecordReward): MsgWithdrawTokenizeShareRecordRewardAminoType["value"] => { + return { + owner_address: ownerAddress, + record_id: recordId.toString(), + }; + }, + fromAmino: ({ + owner_address, + record_id, + }: MsgWithdrawTokenizeShareRecordRewardAminoType["value"]): MsgWithdrawTokenizeShareRecordReward => { + return { + ownerAddress: owner_address, + recordId: BigInt(record_id), + }; + }, + }, + "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward": { + aminoType: "cosmos-sdk/MsgWithdrawAllTokenizeShareRecordReward", + toAmino: ({ + ownerAddress, + }: MsgWithdrawAllTokenizeShareRecordReward): MsgWithdrawAllTokenizeShareRecordRewardAminoType["value"] => { + return { + owner_address: ownerAddress, + }; + }, + fromAmino: ({ + owner_address, + }: MsgWithdrawAllTokenizeShareRecordRewardAminoType["value"]): MsgWithdrawAllTokenizeShareRecordReward => { + return { + ownerAddress: owner_address, + }; + }, + }, +}; diff --git a/src/cosmos/distribution/v1beta1/tx.registry.ts b/src/cosmos/distribution/v1beta1/tx.registry.ts new file mode 100644 index 0000000..24a6477 --- /dev/null +++ b/src/cosmos/distribution/v1beta1/tx.registry.ts @@ -0,0 +1,283 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgSetWithdrawAddress, + MsgWithdrawDelegatorReward, + MsgWithdrawValidatorCommission, + MsgFundCommunityPool, + MsgUpdateParams, + MsgCommunityPoolSpend, + MsgWithdrawTokenizeShareRecordReward, + MsgWithdrawAllTokenizeShareRecordReward, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], + ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], + ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], + ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], + ["/cosmos.distribution.v1beta1.MsgUpdateParams", MsgUpdateParams], + ["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", MsgCommunityPoolSpend], + ["/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward", MsgWithdrawTokenizeShareRecordReward], + [ + "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward", + MsgWithdrawAllTokenizeShareRecordReward, + ], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.encode(value).finish(), + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.encode(value).finish(), + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.encode(value).finish(), + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(value).finish(), + }; + }, + withdrawTokenizeShareRecordReward(value: MsgWithdrawTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward", + value: MsgWithdrawTokenizeShareRecordReward.encode(value).finish(), + }; + }, + withdrawAllTokenizeShareRecordReward(value: MsgWithdrawAllTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward", + value: MsgWithdrawAllTokenizeShareRecordReward.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value, + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value, + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value, + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value, + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value, + }; + }, + withdrawTokenizeShareRecordReward(value: MsgWithdrawTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward", + value, + }; + }, + withdrawAllTokenizeShareRecordReward(value: MsgWithdrawAllTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward", + value, + }; + }, + }, + toJSON: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.toJSON(value), + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.toJSON(value), + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.toJSON(value), + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.toJSON(value), + }; + }, + withdrawTokenizeShareRecordReward(value: MsgWithdrawTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward", + value: MsgWithdrawTokenizeShareRecordReward.toJSON(value), + }; + }, + withdrawAllTokenizeShareRecordReward(value: MsgWithdrawAllTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward", + value: MsgWithdrawAllTokenizeShareRecordReward.toJSON(value), + }; + }, + }, + fromJSON: { + setWithdrawAddress(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.fromJSON(value), + }; + }, + withdrawDelegatorReward(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.fromJSON(value), + }; + }, + withdrawValidatorCommission(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.fromJSON(value), + }; + }, + fundCommunityPool(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + communityPoolSpend(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.fromJSON(value), + }; + }, + withdrawTokenizeShareRecordReward(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward", + value: MsgWithdrawTokenizeShareRecordReward.fromJSON(value), + }; + }, + withdrawAllTokenizeShareRecordReward(value: any) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward", + value: MsgWithdrawAllTokenizeShareRecordReward.fromJSON(value), + }; + }, + }, + fromPartial: { + setWithdrawAddress(value: MsgSetWithdrawAddress) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + value: MsgSetWithdrawAddress.fromPartial(value), + }; + }, + withdrawDelegatorReward(value: MsgWithdrawDelegatorReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + value: MsgWithdrawDelegatorReward.fromPartial(value), + }; + }, + withdrawValidatorCommission(value: MsgWithdrawValidatorCommission) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + value: MsgWithdrawValidatorCommission.fromPartial(value), + }; + }, + fundCommunityPool(value: MsgFundCommunityPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + value: MsgFundCommunityPool.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.fromPartial(value), + }; + }, + withdrawTokenizeShareRecordReward(value: MsgWithdrawTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward", + value: MsgWithdrawTokenizeShareRecordReward.fromPartial(value), + }; + }, + withdrawAllTokenizeShareRecordReward(value: MsgWithdrawAllTokenizeShareRecordReward) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward", + value: MsgWithdrawAllTokenizeShareRecordReward.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/distribution/v1beta1/tx.ts b/src/cosmos/distribution/v1beta1/tx.ts index d2b1b88..778bb4e 100644 --- a/src/cosmos/distribution/v1beta1/tx.ts +++ b/src/cosmos/distribution/v1beta1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; import { Params } from "./distribution"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.distribution.v1beta1"; /** * MsgSetWithdrawAddress sets the withdraw address for @@ -107,7 +107,7 @@ export interface MsgCommunityPoolSpendResponse {} */ export interface MsgWithdrawTokenizeShareRecordReward { ownerAddress: string; - recordId: Long; + recordId: bigint; } /** * MsgWithdrawTokenizeShareRecordReward defines the Msg/WithdrawTokenizeShareRecordReward response type. @@ -137,7 +137,7 @@ function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { }; } export const MsgSetWithdrawAddress = { - encode(message: MsgSetWithdrawAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSetWithdrawAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -146,8 +146,8 @@ export const MsgSetWithdrawAddress = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetWithdrawAddress(); while (reader.pos < end) { @@ -178,7 +178,7 @@ export const MsgSetWithdrawAddress = { message.withdrawAddress !== undefined && (obj.withdrawAddress = message.withdrawAddress); return obj; }, - fromPartial, I>>(object: I): MsgSetWithdrawAddress { + fromPartial(object: Partial): MsgSetWithdrawAddress { const message = createBaseMsgSetWithdrawAddress(); message.delegatorAddress = object.delegatorAddress ?? ""; message.withdrawAddress = object.withdrawAddress ?? ""; @@ -189,11 +189,11 @@ function createBaseMsgSetWithdrawAddressResponse(): MsgSetWithdrawAddressRespons return {}; } export const MsgSetWithdrawAddressResponse = { - encode(_: MsgSetWithdrawAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgSetWithdrawAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetWithdrawAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSetWithdrawAddressResponse(); while (reader.pos < end) { @@ -214,9 +214,7 @@ export const MsgSetWithdrawAddressResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgSetWithdrawAddressResponse { + fromPartial(_: Partial): MsgSetWithdrawAddressResponse { const message = createBaseMsgSetWithdrawAddressResponse(); return message; }, @@ -228,7 +226,7 @@ function createBaseMsgWithdrawDelegatorReward(): MsgWithdrawDelegatorReward { }; } export const MsgWithdrawDelegatorReward = { - encode(message: MsgWithdrawDelegatorReward, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgWithdrawDelegatorReward, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -237,8 +235,8 @@ export const MsgWithdrawDelegatorReward = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawDelegatorReward(); while (reader.pos < end) { @@ -269,9 +267,7 @@ export const MsgWithdrawDelegatorReward = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): MsgWithdrawDelegatorReward { + fromPartial(object: Partial): MsgWithdrawDelegatorReward { const message = createBaseMsgWithdrawDelegatorReward(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -284,14 +280,17 @@ function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRew }; } export const MsgWithdrawDelegatorRewardResponse = { - encode(message: MsgWithdrawDelegatorRewardResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgWithdrawDelegatorRewardResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawDelegatorRewardResponse(); while (reader.pos < end) { @@ -321,9 +320,7 @@ export const MsgWithdrawDelegatorRewardResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): MsgWithdrawDelegatorRewardResponse { + fromPartial(object: Partial): MsgWithdrawDelegatorRewardResponse { const message = createBaseMsgWithdrawDelegatorRewardResponse(); message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -335,14 +332,17 @@ function createBaseMsgWithdrawValidatorCommission(): MsgWithdrawValidatorCommiss }; } export const MsgWithdrawValidatorCommission = { - encode(message: MsgWithdrawValidatorCommission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgWithdrawValidatorCommission, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawValidatorCommission(); while (reader.pos < end) { @@ -368,9 +368,7 @@ export const MsgWithdrawValidatorCommission = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): MsgWithdrawValidatorCommission { + fromPartial(object: Partial): MsgWithdrawValidatorCommission { const message = createBaseMsgWithdrawValidatorCommission(); message.validatorAddress = object.validatorAddress ?? ""; return message; @@ -384,15 +382,15 @@ function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidato export const MsgWithdrawValidatorCommissionResponse = { encode( message: MsgWithdrawValidatorCommissionResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawValidatorCommissionResponse(); while (reader.pos < end) { @@ -422,8 +420,8 @@ export const MsgWithdrawValidatorCommissionResponse = { } return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): MsgWithdrawValidatorCommissionResponse { const message = createBaseMsgWithdrawValidatorCommissionResponse(); message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; @@ -437,7 +435,7 @@ function createBaseMsgFundCommunityPool(): MsgFundCommunityPool { }; } export const MsgFundCommunityPool = { - encode(message: MsgFundCommunityPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgFundCommunityPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -446,8 +444,8 @@ export const MsgFundCommunityPool = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgFundCommunityPool(); while (reader.pos < end) { @@ -482,7 +480,7 @@ export const MsgFundCommunityPool = { message.depositor !== undefined && (obj.depositor = message.depositor); return obj; }, - fromPartial, I>>(object: I): MsgFundCommunityPool { + fromPartial(object: Partial): MsgFundCommunityPool { const message = createBaseMsgFundCommunityPool(); message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; message.depositor = object.depositor ?? ""; @@ -493,11 +491,11 @@ function createBaseMsgFundCommunityPoolResponse(): MsgFundCommunityPoolResponse return {}; } export const MsgFundCommunityPoolResponse = { - encode(_: MsgFundCommunityPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgFundCommunityPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgFundCommunityPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgFundCommunityPoolResponse(); while (reader.pos < end) { @@ -518,9 +516,7 @@ export const MsgFundCommunityPoolResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgFundCommunityPoolResponse { + fromPartial(_: Partial): MsgFundCommunityPoolResponse { const message = createBaseMsgFundCommunityPoolResponse(); return message; }, @@ -532,7 +528,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -541,8 +537,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -573,7 +569,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -586,11 +582,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -611,7 +607,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -624,7 +620,7 @@ function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { }; } export const MsgCommunityPoolSpend = { - encode(message: MsgCommunityPoolSpend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCommunityPoolSpend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -636,8 +632,8 @@ export const MsgCommunityPoolSpend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCommunityPoolSpend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCommunityPoolSpend(); while (reader.pos < end) { @@ -677,7 +673,7 @@ export const MsgCommunityPoolSpend = { } return obj; }, - fromPartial, I>>(object: I): MsgCommunityPoolSpend { + fromPartial(object: Partial): MsgCommunityPoolSpend { const message = createBaseMsgCommunityPoolSpend(); message.authority = object.authority ?? ""; message.recipient = object.recipient ?? ""; @@ -689,11 +685,11 @@ function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendRespons return {}; } export const MsgCommunityPoolSpendResponse = { - encode(_: MsgCommunityPoolSpendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgCommunityPoolSpendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCommunityPoolSpendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCommunityPoolSpendResponse(); while (reader.pos < end) { @@ -714,9 +710,7 @@ export const MsgCommunityPoolSpendResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgCommunityPoolSpendResponse { + fromPartial(_: Partial): MsgCommunityPoolSpendResponse { const message = createBaseMsgCommunityPoolSpendResponse(); return message; }, @@ -724,24 +718,24 @@ export const MsgCommunityPoolSpendResponse = { function createBaseMsgWithdrawTokenizeShareRecordReward(): MsgWithdrawTokenizeShareRecordReward { return { ownerAddress: "", - recordId: Long.UZERO, + recordId: BigInt(0), }; } export const MsgWithdrawTokenizeShareRecordReward = { encode( message: MsgWithdrawTokenizeShareRecordReward, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.ownerAddress !== "") { writer.uint32(10).string(message.ownerAddress); } - if (!message.recordId.isZero()) { + if (message.recordId !== BigInt(0)) { writer.uint32(16).uint64(message.recordId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawTokenizeShareRecordReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawTokenizeShareRecordReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawTokenizeShareRecordReward(); while (reader.pos < end) { @@ -751,7 +745,7 @@ export const MsgWithdrawTokenizeShareRecordReward = { message.ownerAddress = reader.string(); break; case 2: - message.recordId = reader.uint64() as Long; + message.recordId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -763,22 +757,20 @@ export const MsgWithdrawTokenizeShareRecordReward = { fromJSON(object: any): MsgWithdrawTokenizeShareRecordReward { const obj = createBaseMsgWithdrawTokenizeShareRecordReward(); if (isSet(object.ownerAddress)) obj.ownerAddress = String(object.ownerAddress); - if (isSet(object.recordId)) obj.recordId = Long.fromValue(object.recordId); + if (isSet(object.recordId)) obj.recordId = BigInt(object.recordId.toString()); return obj; }, toJSON(message: MsgWithdrawTokenizeShareRecordReward): unknown { const obj: any = {}; message.ownerAddress !== undefined && (obj.ownerAddress = message.ownerAddress); - message.recordId !== undefined && (obj.recordId = (message.recordId || Long.UZERO).toString()); + message.recordId !== undefined && (obj.recordId = (message.recordId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgWithdrawTokenizeShareRecordReward { + fromPartial(object: Partial): MsgWithdrawTokenizeShareRecordReward { const message = createBaseMsgWithdrawTokenizeShareRecordReward(); message.ownerAddress = object.ownerAddress ?? ""; if (object.recordId !== undefined && object.recordId !== null) { - message.recordId = Long.fromValue(object.recordId); + message.recordId = BigInt(object.recordId.toString()); } return message; }, @@ -789,12 +781,12 @@ function createBaseMsgWithdrawTokenizeShareRecordRewardResponse(): MsgWithdrawTo export const MsgWithdrawTokenizeShareRecordRewardResponse = { encode( _: MsgWithdrawTokenizeShareRecordRewardResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawTokenizeShareRecordRewardResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawTokenizeShareRecordRewardResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawTokenizeShareRecordRewardResponse(); while (reader.pos < end) { @@ -815,8 +807,8 @@ export const MsgWithdrawTokenizeShareRecordRewardResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, + fromPartial( + _: Partial, ): MsgWithdrawTokenizeShareRecordRewardResponse { const message = createBaseMsgWithdrawTokenizeShareRecordRewardResponse(); return message; @@ -830,15 +822,15 @@ function createBaseMsgWithdrawAllTokenizeShareRecordReward(): MsgWithdrawAllToke export const MsgWithdrawAllTokenizeShareRecordReward = { encode( message: MsgWithdrawAllTokenizeShareRecordReward, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.ownerAddress !== "") { writer.uint32(10).string(message.ownerAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawAllTokenizeShareRecordReward { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawAllTokenizeShareRecordReward { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawAllTokenizeShareRecordReward(); while (reader.pos < end) { @@ -864,8 +856,8 @@ export const MsgWithdrawAllTokenizeShareRecordReward = { message.ownerAddress !== undefined && (obj.ownerAddress = message.ownerAddress); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): MsgWithdrawAllTokenizeShareRecordReward { const message = createBaseMsgWithdrawAllTokenizeShareRecordReward(); message.ownerAddress = object.ownerAddress ?? ""; @@ -878,12 +870,12 @@ function createBaseMsgWithdrawAllTokenizeShareRecordRewardResponse(): MsgWithdra export const MsgWithdrawAllTokenizeShareRecordRewardResponse = { encode( _: MsgWithdrawAllTokenizeShareRecordRewardResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawAllTokenizeShareRecordRewardResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawAllTokenizeShareRecordRewardResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawAllTokenizeShareRecordRewardResponse(); while (reader.pos < end) { @@ -904,8 +896,8 @@ export const MsgWithdrawAllTokenizeShareRecordRewardResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, + fromPartial( + _: Partial, ): MsgWithdrawAllTokenizeShareRecordRewardResponse { const message = createBaseMsgWithdrawAllTokenizeShareRecordRewardResponse(); return message; @@ -984,34 +976,34 @@ export class MsgClientImpl implements Msg { SetWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "SetWithdrawAddress", data); - return promise.then((data) => MsgSetWithdrawAddressResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSetWithdrawAddressResponse.decode(new BinaryReader(data))); } WithdrawDelegatorReward(request: MsgWithdrawDelegatorReward): Promise { const data = MsgWithdrawDelegatorReward.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawDelegatorReward", data); - return promise.then((data) => MsgWithdrawDelegatorRewardResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgWithdrawDelegatorRewardResponse.decode(new BinaryReader(data))); } WithdrawValidatorCommission( request: MsgWithdrawValidatorCommission, ): Promise { const data = MsgWithdrawValidatorCommission.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "WithdrawValidatorCommission", data); - return promise.then((data) => MsgWithdrawValidatorCommissionResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgWithdrawValidatorCommissionResponse.decode(new BinaryReader(data))); } FundCommunityPool(request: MsgFundCommunityPool): Promise { const data = MsgFundCommunityPool.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); - return promise.then((data) => MsgFundCommunityPoolResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgFundCommunityPoolResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } CommunityPoolSpend(request: MsgCommunityPoolSpend): Promise { const data = MsgCommunityPoolSpend.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data); - return promise.then((data) => MsgCommunityPoolSpendResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCommunityPoolSpendResponse.decode(new BinaryReader(data))); } WithdrawTokenizeShareRecordReward( request: MsgWithdrawTokenizeShareRecordReward, @@ -1022,7 +1014,9 @@ export class MsgClientImpl implements Msg { "WithdrawTokenizeShareRecordReward", data, ); - return promise.then((data) => MsgWithdrawTokenizeShareRecordRewardResponse.decode(new _m0.Reader(data))); + return promise.then((data) => + MsgWithdrawTokenizeShareRecordRewardResponse.decode(new BinaryReader(data)), + ); } WithdrawAllTokenizeShareRecordReward( request: MsgWithdrawAllTokenizeShareRecordReward, @@ -1034,7 +1028,7 @@ export class MsgClientImpl implements Msg { data, ); return promise.then((data) => - MsgWithdrawAllTokenizeShareRecordRewardResponse.decode(new _m0.Reader(data)), + MsgWithdrawAllTokenizeShareRecordRewardResponse.decode(new BinaryReader(data)), ); } } diff --git a/src/cosmos/evidence/module/v1/module.ts b/src/cosmos/evidence/module/v1/module.ts index 1886d89..17ddf05 100644 --- a/src/cosmos/evidence/module/v1/module.ts +++ b/src/cosmos/evidence/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.evidence.module.v1"; /** Module is the config object of the evidence module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/evidence/v1beta1/evidence.ts b/src/cosmos/evidence/v1beta1/evidence.ts index e22e18e..5b3dce8 100644 --- a/src/cosmos/evidence/v1beta1/evidence.ts +++ b/src/cosmos/evidence/v1beta1/evidence.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.evidence.v1beta1"; /** * Equivocation implements the Evidence interface and defines evidence of double @@ -9,31 +9,31 @@ export const protobufPackage = "cosmos.evidence.v1beta1"; */ export interface Equivocation { /** height is the equivocation height. */ - height: Long; + height: bigint; /** time is the equivocation time. */ time: Timestamp; /** power is the equivocation validator power. */ - power: Long; + power: bigint; /** consensus_address is the equivocation validator consensus address. */ consensusAddress: string; } function createBaseEquivocation(): Equivocation { return { - height: Long.ZERO, + height: BigInt(0), time: Timestamp.fromPartial({}), - power: Long.ZERO, + power: BigInt(0), consensusAddress: "", }; } export const Equivocation = { - encode(message: Equivocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: Equivocation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(18).fork()).ldelim(); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(24).int64(message.power); } if (message.consensusAddress !== "") { @@ -41,21 +41,21 @@ export const Equivocation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Equivocation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Equivocation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEquivocation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 2: message.time = Timestamp.decode(reader, reader.uint32()); break; case 3: - message.power = reader.int64() as Long; + message.power = reader.int64(); break; case 4: message.consensusAddress = reader.string(); @@ -69,30 +69,30 @@ export const Equivocation = { }, fromJSON(object: any): Equivocation { const obj = createBaseEquivocation(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); - if (isSet(object.power)) obj.power = Long.fromValue(object.power); + if (isSet(object.power)) obj.power = BigInt(object.power.toString()); if (isSet(object.consensusAddress)) obj.consensusAddress = String(object.consensusAddress); return obj; }, toJSON(message: Equivocation): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); message.consensusAddress !== undefined && (obj.consensusAddress = message.consensusAddress); return obj; }, - fromPartial, I>>(object: I): Equivocation { + fromPartial(object: Partial): Equivocation { const message = createBaseEquivocation(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); } if (object.power !== undefined && object.power !== null) { - message.power = Long.fromValue(object.power); + message.power = BigInt(object.power.toString()); } message.consensusAddress = object.consensusAddress ?? ""; return message; diff --git a/src/cosmos/evidence/v1beta1/genesis.ts b/src/cosmos/evidence/v1beta1/genesis.ts index 1331af8..92233d3 100644 --- a/src/cosmos/evidence/v1beta1/genesis.ts +++ b/src/cosmos/evidence/v1beta1/genesis.ts @@ -1,7 +1,6 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; export const protobufPackage = "cosmos.evidence.v1beta1"; /** GenesisState defines the evidence module's genesis state. */ export interface GenesisState { @@ -14,14 +13,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -51,7 +50,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || []; return message; diff --git a/src/cosmos/evidence/v1beta1/query.ts b/src/cosmos/evidence/v1beta1/query.ts index b95ec18..6688836 100644 --- a/src/cosmos/evidence/v1beta1/query.ts +++ b/src/cosmos/evidence/v1beta1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.evidence.v1beta1"; /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequest { @@ -49,7 +49,7 @@ function createBaseQueryEvidenceRequest(): QueryEvidenceRequest { }; } export const QueryEvidenceRequest = { - encode(message: QueryEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryEvidenceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.evidenceHash.length !== 0) { writer.uint32(10).bytes(message.evidenceHash); } @@ -58,8 +58,8 @@ export const QueryEvidenceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEvidenceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEvidenceRequest(); while (reader.pos < end) { @@ -93,7 +93,7 @@ export const QueryEvidenceRequest = { message.hash !== undefined && (obj.hash = message.hash); return obj; }, - fromPartial, I>>(object: I): QueryEvidenceRequest { + fromPartial(object: Partial): QueryEvidenceRequest { const message = createBaseQueryEvidenceRequest(); message.evidenceHash = object.evidenceHash ?? new Uint8Array(); message.hash = object.hash ?? ""; @@ -106,14 +106,14 @@ function createBaseQueryEvidenceResponse(): QueryEvidenceResponse { }; } export const QueryEvidenceResponse = { - encode(message: QueryEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.evidence !== undefined) { Any.encode(message.evidence, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEvidenceResponse(); while (reader.pos < end) { @@ -140,7 +140,7 @@ export const QueryEvidenceResponse = { (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryEvidenceResponse { + fromPartial(object: Partial): QueryEvidenceResponse { const message = createBaseQueryEvidenceResponse(); if (object.evidence !== undefined && object.evidence !== null) { message.evidence = Any.fromPartial(object.evidence); @@ -154,14 +154,14 @@ function createBaseQueryAllEvidenceRequest(): QueryAllEvidenceRequest { }; } export const QueryAllEvidenceRequest = { - encode(message: QueryAllEvidenceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllEvidenceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllEvidenceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllEvidenceRequest(); while (reader.pos < end) { @@ -188,7 +188,7 @@ export const QueryAllEvidenceRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAllEvidenceRequest { + fromPartial(object: Partial): QueryAllEvidenceRequest { const message = createBaseQueryAllEvidenceRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -203,7 +203,7 @@ function createBaseQueryAllEvidenceResponse(): QueryAllEvidenceResponse { }; } export const QueryAllEvidenceResponse = { - encode(message: QueryAllEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -212,8 +212,8 @@ export const QueryAllEvidenceResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllEvidenceResponse(); while (reader.pos < end) { @@ -249,9 +249,7 @@ export const QueryAllEvidenceResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllEvidenceResponse { + fromPartial(object: Partial): QueryAllEvidenceResponse { const message = createBaseQueryAllEvidenceResponse(); message.evidence = object.evidence?.map((e) => Any.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -277,7 +275,7 @@ export class QueryClientImpl implements Query { Evidence(request: QueryEvidenceRequest): Promise { const data = QueryEvidenceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "Evidence", data); - return promise.then((data) => QueryEvidenceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryEvidenceResponse.decode(new BinaryReader(data))); } AllEvidence( request: QueryAllEvidenceRequest = { @@ -286,6 +284,6 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryAllEvidenceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.evidence.v1beta1.Query", "AllEvidence", data); - return promise.then((data) => QueryAllEvidenceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllEvidenceResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/evidence/v1beta1/tx.amino.ts b/src/cosmos/evidence/v1beta1/tx.amino.ts new file mode 100644 index 0000000..40ec28d --- /dev/null +++ b/src/cosmos/evidence/v1beta1/tx.amino.ts @@ -0,0 +1,36 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgSubmitEvidence } from "./tx"; +export interface MsgSubmitEvidenceAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSubmitEvidence"; + value: { + submitter: string; + evidence: { + type_url: string; + value: Uint8Array; + }; + }; +} +export const AminoConverter = { + "/cosmos.evidence.v1beta1.MsgSubmitEvidence": { + aminoType: "cosmos-sdk/MsgSubmitEvidence", + toAmino: ({ submitter, evidence }: MsgSubmitEvidence): MsgSubmitEvidenceAminoType["value"] => { + return { + submitter, + evidence: { + type_url: evidence.typeUrl, + value: evidence.value, + }, + }; + }, + fromAmino: ({ submitter, evidence }: MsgSubmitEvidenceAminoType["value"]): MsgSubmitEvidence => { + return { + submitter, + evidence: { + typeUrl: evidence.type_url, + value: evidence.value, + }, + }; + }, + }, +}; diff --git a/src/cosmos/evidence/v1beta1/tx.registry.ts b/src/cosmos/evidence/v1beta1/tx.registry.ts new file mode 100644 index 0000000..b0b7e2b --- /dev/null +++ b/src/cosmos/evidence/v1beta1/tx.registry.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSubmitEvidence } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.evidence.v1beta1.MsgSubmitEvidence", MsgSubmitEvidence], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + submitEvidence(value: MsgSubmitEvidence) { + return { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", + value: MsgSubmitEvidence.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + submitEvidence(value: MsgSubmitEvidence) { + return { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", + value, + }; + }, + }, + toJSON: { + submitEvidence(value: MsgSubmitEvidence) { + return { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", + value: MsgSubmitEvidence.toJSON(value), + }; + }, + }, + fromJSON: { + submitEvidence(value: any) { + return { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", + value: MsgSubmitEvidence.fromJSON(value), + }; + }, + }, + fromPartial: { + submitEvidence(value: MsgSubmitEvidence) { + return { + typeUrl: "/cosmos.evidence.v1beta1.MsgSubmitEvidence", + value: MsgSubmitEvidence.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/evidence/v1beta1/tx.ts b/src/cosmos/evidence/v1beta1/tx.ts index c66a20c..b3b63c2 100644 --- a/src/cosmos/evidence/v1beta1/tx.ts +++ b/src/cosmos/evidence/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.evidence.v1beta1"; /** * MsgSubmitEvidence represents a message that supports submitting arbitrary @@ -25,7 +25,7 @@ function createBaseMsgSubmitEvidence(): MsgSubmitEvidence { }; } export const MsgSubmitEvidence = { - encode(message: MsgSubmitEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSubmitEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.submitter !== "") { writer.uint32(10).string(message.submitter); } @@ -34,8 +34,8 @@ export const MsgSubmitEvidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitEvidence(); while (reader.pos < end) { @@ -67,7 +67,7 @@ export const MsgSubmitEvidence = { (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgSubmitEvidence { + fromPartial(object: Partial): MsgSubmitEvidence { const message = createBaseMsgSubmitEvidence(); message.submitter = object.submitter ?? ""; if (object.evidence !== undefined && object.evidence !== null) { @@ -82,14 +82,14 @@ function createBaseMsgSubmitEvidenceResponse(): MsgSubmitEvidenceResponse { }; } export const MsgSubmitEvidenceResponse = { - encode(message: MsgSubmitEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSubmitEvidenceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitEvidenceResponse(); while (reader.pos < end) { @@ -116,9 +116,7 @@ export const MsgSubmitEvidenceResponse = { (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): MsgSubmitEvidenceResponse { + fromPartial(object: Partial): MsgSubmitEvidenceResponse { const message = createBaseMsgSubmitEvidenceResponse(); message.hash = object.hash ?? new Uint8Array(); return message; @@ -141,6 +139,6 @@ export class MsgClientImpl implements Msg { SubmitEvidence(request: MsgSubmitEvidence): Promise { const data = MsgSubmitEvidence.encode(request).finish(); const promise = this.rpc.request("cosmos.evidence.v1beta1.Msg", "SubmitEvidence", data); - return promise.then((data) => MsgSubmitEvidenceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSubmitEvidenceResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/feegrant/module/v1/module.ts b/src/cosmos/feegrant/module/v1/module.ts index 1e2a5db..cda04f3 100644 --- a/src/cosmos/feegrant/module/v1/module.ts +++ b/src/cosmos/feegrant/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.feegrant.module.v1"; /** Module is the config object of the feegrant module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/feegrant/v1beta1/feegrant.ts b/src/cosmos/feegrant/v1beta1/feegrant.ts index 13feb33..2b19953 100644 --- a/src/cosmos/feegrant/v1beta1/feegrant.ts +++ b/src/cosmos/feegrant/v1beta1/feegrant.ts @@ -3,8 +3,8 @@ import { Coin } from "../../base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration } from "../../../google/protobuf/duration"; import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, fromJsonTimestamp, fromTimestamp, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.feegrant.v1beta1"; /** * BasicAllowance implements Allowance with a one-time grant of coins @@ -69,7 +69,7 @@ function createBaseBasicAllowance(): BasicAllowance { }; } export const BasicAllowance = { - encode(message: BasicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BasicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -78,8 +78,8 @@ export const BasicAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BasicAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BasicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBasicAllowance(); while (reader.pos < end) { @@ -115,7 +115,7 @@ export const BasicAllowance = { message.expiration !== undefined && (obj.expiration = fromTimestamp(message.expiration).toISOString()); return obj; }, - fromPartial, I>>(object: I): BasicAllowance { + fromPartial(object: Partial): BasicAllowance { const message = createBaseBasicAllowance(); message.spendLimit = object.spendLimit?.map((e) => Coin.fromPartial(e)) || []; if (object.expiration !== undefined && object.expiration !== null) { @@ -134,7 +134,7 @@ function createBasePeriodicAllowance(): PeriodicAllowance { }; } export const PeriodicAllowance = { - encode(message: PeriodicAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PeriodicAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.basic !== undefined) { BasicAllowance.encode(message.basic, writer.uint32(10).fork()).ldelim(); } @@ -152,8 +152,8 @@ export const PeriodicAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePeriodicAllowance(); while (reader.pos < end) { @@ -211,7 +211,7 @@ export const PeriodicAllowance = { message.periodReset !== undefined && (obj.periodReset = fromTimestamp(message.periodReset).toISOString()); return obj; }, - fromPartial, I>>(object: I): PeriodicAllowance { + fromPartial(object: Partial): PeriodicAllowance { const message = createBasePeriodicAllowance(); if (object.basic !== undefined && object.basic !== null) { message.basic = BasicAllowance.fromPartial(object.basic); @@ -234,7 +234,7 @@ function createBaseAllowedMsgAllowance(): AllowedMsgAllowance { }; } export const AllowedMsgAllowance = { - encode(message: AllowedMsgAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AllowedMsgAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowance !== undefined) { Any.encode(message.allowance, writer.uint32(10).fork()).ldelim(); } @@ -243,8 +243,8 @@ export const AllowedMsgAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowedMsgAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowedMsgAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowedMsgAllowance(); while (reader.pos < end) { @@ -281,7 +281,7 @@ export const AllowedMsgAllowance = { } return obj; }, - fromPartial, I>>(object: I): AllowedMsgAllowance { + fromPartial(object: Partial): AllowedMsgAllowance { const message = createBaseAllowedMsgAllowance(); if (object.allowance !== undefined && object.allowance !== null) { message.allowance = Any.fromPartial(object.allowance); @@ -298,7 +298,7 @@ function createBaseGrant(): Grant { }; } export const Grant = { - encode(message: Grant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Grant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -310,8 +310,8 @@ export const Grant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Grant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Grant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGrant(); while (reader.pos < end) { @@ -348,7 +348,7 @@ export const Grant = { (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); return obj; }, - fromPartial, I>>(object: I): Grant { + fromPartial(object: Partial): Grant { const message = createBaseGrant(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; diff --git a/src/cosmos/feegrant/v1beta1/genesis.ts b/src/cosmos/feegrant/v1beta1/genesis.ts index 4ddf1e1..3ba7a43 100644 --- a/src/cosmos/feegrant/v1beta1/genesis.ts +++ b/src/cosmos/feegrant/v1beta1/genesis.ts @@ -1,7 +1,6 @@ /* eslint-disable */ import { Grant } from "./feegrant"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; export const protobufPackage = "cosmos.feegrant.v1beta1"; /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisState { @@ -13,14 +12,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -51,7 +50,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; return message; diff --git a/src/cosmos/feegrant/v1beta1/query.ts b/src/cosmos/feegrant/v1beta1/query.ts index 2ac771a..e5e1c83 100644 --- a/src/cosmos/feegrant/v1beta1/query.ts +++ b/src/cosmos/feegrant/v1beta1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { Grant } from "./feegrant"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.feegrant.v1beta1"; /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequest { @@ -57,7 +57,7 @@ function createBaseQueryAllowanceRequest(): QueryAllowanceRequest { }; } export const QueryAllowanceRequest = { - encode(message: QueryAllowanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllowanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -66,8 +66,8 @@ export const QueryAllowanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowanceRequest(); while (reader.pos < end) { @@ -98,7 +98,7 @@ export const QueryAllowanceRequest = { message.grantee !== undefined && (obj.grantee = message.grantee); return obj; }, - fromPartial, I>>(object: I): QueryAllowanceRequest { + fromPartial(object: Partial): QueryAllowanceRequest { const message = createBaseQueryAllowanceRequest(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -111,14 +111,14 @@ function createBaseQueryAllowanceResponse(): QueryAllowanceResponse { }; } export const QueryAllowanceResponse = { - encode(message: QueryAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowance !== undefined) { Grant.encode(message.allowance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowanceResponse(); while (reader.pos < end) { @@ -145,7 +145,7 @@ export const QueryAllowanceResponse = { (obj.allowance = message.allowance ? Grant.toJSON(message.allowance) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAllowanceResponse { + fromPartial(object: Partial): QueryAllowanceResponse { const message = createBaseQueryAllowanceResponse(); if (object.allowance !== undefined && object.allowance !== null) { message.allowance = Grant.fromPartial(object.allowance); @@ -160,7 +160,7 @@ function createBaseQueryAllowancesRequest(): QueryAllowancesRequest { }; } export const QueryAllowancesRequest = { - encode(message: QueryAllowancesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllowancesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.grantee !== "") { writer.uint32(10).string(message.grantee); } @@ -169,8 +169,8 @@ export const QueryAllowancesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesRequest(); while (reader.pos < end) { @@ -202,7 +202,7 @@ export const QueryAllowancesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAllowancesRequest { + fromPartial(object: Partial): QueryAllowancesRequest { const message = createBaseQueryAllowancesRequest(); message.grantee = object.grantee ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -218,7 +218,7 @@ function createBaseQueryAllowancesResponse(): QueryAllowancesResponse { }; } export const QueryAllowancesResponse = { - encode(message: QueryAllowancesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllowancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -227,8 +227,8 @@ export const QueryAllowancesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesResponse(); while (reader.pos < end) { @@ -265,7 +265,7 @@ export const QueryAllowancesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAllowancesResponse { + fromPartial(object: Partial): QueryAllowancesResponse { const message = createBaseQueryAllowancesResponse(); message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -281,7 +281,10 @@ function createBaseQueryAllowancesByGranterRequest(): QueryAllowancesByGranterRe }; } export const QueryAllowancesByGranterRequest = { - encode(message: QueryAllowancesByGranterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowancesByGranterRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -290,8 +293,8 @@ export const QueryAllowancesByGranterRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesByGranterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesByGranterRequest(); while (reader.pos < end) { @@ -323,9 +326,7 @@ export const QueryAllowancesByGranterRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllowancesByGranterRequest { + fromPartial(object: Partial): QueryAllowancesByGranterRequest { const message = createBaseQueryAllowancesByGranterRequest(); message.granter = object.granter ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -341,7 +342,10 @@ function createBaseQueryAllowancesByGranterResponse(): QueryAllowancesByGranterR }; } export const QueryAllowancesByGranterResponse = { - encode(message: QueryAllowancesByGranterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowancesByGranterResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.allowances) { Grant.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -350,8 +354,8 @@ export const QueryAllowancesByGranterResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowancesByGranterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowancesByGranterResponse(); while (reader.pos < end) { @@ -388,9 +392,7 @@ export const QueryAllowancesByGranterResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllowancesByGranterResponse { + fromPartial(object: Partial): QueryAllowancesByGranterResponse { const message = createBaseQueryAllowancesByGranterResponse(); message.allowances = object.allowances?.map((e) => Grant.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -423,16 +425,16 @@ export class QueryClientImpl implements Query { Allowance(request: QueryAllowanceRequest): Promise { const data = QueryAllowanceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowance", data); - return promise.then((data) => QueryAllowanceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllowanceResponse.decode(new BinaryReader(data))); } Allowances(request: QueryAllowancesRequest): Promise { const data = QueryAllowancesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "Allowances", data); - return promise.then((data) => QueryAllowancesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllowancesResponse.decode(new BinaryReader(data))); } AllowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { const data = QueryAllowancesByGranterRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Query", "AllowancesByGranter", data); - return promise.then((data) => QueryAllowancesByGranterResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllowancesByGranterResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/feegrant/v1beta1/tx.amino.ts b/src/cosmos/feegrant/v1beta1/tx.amino.ts new file mode 100644 index 0000000..67efc1c --- /dev/null +++ b/src/cosmos/feegrant/v1beta1/tx.amino.ts @@ -0,0 +1,61 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; +export interface MsgGrantAllowanceAminoType extends AminoMsg { + type: "cosmos-sdk/MsgGrantAllowance"; + value: { + granter: string; + grantee: string; + allowance: { + type_url: string; + value: Uint8Array; + }; + }; +} +export interface MsgRevokeAllowanceAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRevokeAllowance"; + value: { + granter: string; + grantee: string; + }; +} +export const AminoConverter = { + "/cosmos.feegrant.v1beta1.MsgGrantAllowance": { + aminoType: "cosmos-sdk/MsgGrantAllowance", + toAmino: ({ granter, grantee, allowance }: MsgGrantAllowance): MsgGrantAllowanceAminoType["value"] => { + return { + granter, + grantee, + allowance: { + type_url: allowance.typeUrl, + value: allowance.value, + }, + }; + }, + fromAmino: ({ granter, grantee, allowance }: MsgGrantAllowanceAminoType["value"]): MsgGrantAllowance => { + return { + granter, + grantee, + allowance: { + typeUrl: allowance.type_url, + value: allowance.value, + }, + }; + }, + }, + "/cosmos.feegrant.v1beta1.MsgRevokeAllowance": { + aminoType: "cosmos-sdk/MsgRevokeAllowance", + toAmino: ({ granter, grantee }: MsgRevokeAllowance): MsgRevokeAllowanceAminoType["value"] => { + return { + granter, + grantee, + }; + }, + fromAmino: ({ granter, grantee }: MsgRevokeAllowanceAminoType["value"]): MsgRevokeAllowance => { + return { + granter, + grantee, + }; + }, + }, +}; diff --git a/src/cosmos/feegrant/v1beta1/tx.registry.ts b/src/cosmos/feegrant/v1beta1/tx.registry.ts new file mode 100644 index 0000000..27b8579 --- /dev/null +++ b/src/cosmos/feegrant/v1beta1/tx.registry.ts @@ -0,0 +1,85 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], + ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.encode(value).finish(), + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value, + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value, + }; + }, + }, + toJSON: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.toJSON(value), + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.toJSON(value), + }; + }, + }, + fromJSON: { + grantAllowance(value: any) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.fromJSON(value), + }; + }, + revokeAllowance(value: any) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.fromJSON(value), + }; + }, + }, + fromPartial: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value: MsgGrantAllowance.fromPartial(value), + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + value: MsgRevokeAllowance.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/feegrant/v1beta1/tx.ts b/src/cosmos/feegrant/v1beta1/tx.ts index 072f36b..41802bb 100644 --- a/src/cosmos/feegrant/v1beta1/tx.ts +++ b/src/cosmos/feegrant/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.feegrant.v1beta1"; /** * MsgGrantAllowance adds permission for Grantee to spend up to Allowance @@ -34,7 +34,7 @@ function createBaseMsgGrantAllowance(): MsgGrantAllowance { }; } export const MsgGrantAllowance = { - encode(message: MsgGrantAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgGrantAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -46,8 +46,8 @@ export const MsgGrantAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrantAllowance(); while (reader.pos < end) { @@ -84,7 +84,7 @@ export const MsgGrantAllowance = { (obj.allowance = message.allowance ? Any.toJSON(message.allowance) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgGrantAllowance { + fromPartial(object: Partial): MsgGrantAllowance { const message = createBaseMsgGrantAllowance(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -98,11 +98,11 @@ function createBaseMsgGrantAllowanceResponse(): MsgGrantAllowanceResponse { return {}; } export const MsgGrantAllowanceResponse = { - encode(_: MsgGrantAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgGrantAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgGrantAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgGrantAllowanceResponse(); while (reader.pos < end) { @@ -123,7 +123,7 @@ export const MsgGrantAllowanceResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgGrantAllowanceResponse { + fromPartial(_: Partial): MsgGrantAllowanceResponse { const message = createBaseMsgGrantAllowanceResponse(); return message; }, @@ -135,7 +135,7 @@ function createBaseMsgRevokeAllowance(): MsgRevokeAllowance { }; } export const MsgRevokeAllowance = { - encode(message: MsgRevokeAllowance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRevokeAllowance, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.granter !== "") { writer.uint32(10).string(message.granter); } @@ -144,8 +144,8 @@ export const MsgRevokeAllowance = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowance { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevokeAllowance(); while (reader.pos < end) { @@ -176,7 +176,7 @@ export const MsgRevokeAllowance = { message.grantee !== undefined && (obj.grantee = message.grantee); return obj; }, - fromPartial, I>>(object: I): MsgRevokeAllowance { + fromPartial(object: Partial): MsgRevokeAllowance { const message = createBaseMsgRevokeAllowance(); message.granter = object.granter ?? ""; message.grantee = object.grantee ?? ""; @@ -187,11 +187,11 @@ function createBaseMsgRevokeAllowanceResponse(): MsgRevokeAllowanceResponse { return {}; } export const MsgRevokeAllowanceResponse = { - encode(_: MsgRevokeAllowanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRevokeAllowanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRevokeAllowanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRevokeAllowanceResponse(); while (reader.pos < end) { @@ -212,7 +212,7 @@ export const MsgRevokeAllowanceResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgRevokeAllowanceResponse { + fromPartial(_: Partial): MsgRevokeAllowanceResponse { const message = createBaseMsgRevokeAllowanceResponse(); return message; }, @@ -240,11 +240,11 @@ export class MsgClientImpl implements Msg { GrantAllowance(request: MsgGrantAllowance): Promise { const data = MsgGrantAllowance.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "GrantAllowance", data); - return promise.then((data) => MsgGrantAllowanceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgGrantAllowanceResponse.decode(new BinaryReader(data))); } RevokeAllowance(request: MsgRevokeAllowance): Promise { const data = MsgRevokeAllowance.encode(request).finish(); const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); - return promise.then((data) => MsgRevokeAllowanceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRevokeAllowanceResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/genutil/module/v1/module.ts b/src/cosmos/genutil/module/v1/module.ts index d677e6c..c31e7f6 100644 --- a/src/cosmos/genutil/module/v1/module.ts +++ b/src/cosmos/genutil/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.genutil.module.v1"; /** Module is the config object for the genutil module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/genutil/v1beta1/genesis.ts b/src/cosmos/genutil/v1beta1/genesis.ts index 47323aa..520f7e7 100644 --- a/src/cosmos/genutil/v1beta1/genesis.ts +++ b/src/cosmos/genutil/v1beta1/genesis.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.genutil.v1beta1"; /** GenesisState defines the raw genesis transaction in JSON. */ export interface GenesisState { @@ -13,14 +13,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.genTxs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -50,7 +50,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.genTxs = object.genTxs?.map((e) => e) || []; return message; diff --git a/src/cosmos/gov/module/v1/module.ts b/src/cosmos/gov/module/v1/module.ts index 403feaf..6dcc4d5 100644 --- a/src/cosmos/gov/module/v1/module.ts +++ b/src/cosmos/gov/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.gov.module.v1"; /** Module is the config object of the gov module. */ export interface Module { @@ -8,19 +8,19 @@ export interface Module { * max_metadata_len defines the maximum proposal metadata length. * Defaults to 255 if not explicitly set. */ - maxMetadataLen: Long; + maxMetadataLen: bigint; /** authority defines the custom module authority. If not set, defaults to the governance module. */ authority: string; } function createBaseModule(): Module { return { - maxMetadataLen: Long.UZERO, + maxMetadataLen: BigInt(0), authority: "", }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxMetadataLen.isZero()) { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxMetadataLen !== BigInt(0)) { writer.uint32(8).uint64(message.maxMetadataLen); } if (message.authority !== "") { @@ -28,15 +28,15 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxMetadataLen = reader.uint64() as Long; + message.maxMetadataLen = reader.uint64(); break; case 2: message.authority = reader.string(); @@ -50,21 +50,21 @@ export const Module = { }, fromJSON(object: any): Module { const obj = createBaseModule(); - if (isSet(object.maxMetadataLen)) obj.maxMetadataLen = Long.fromValue(object.maxMetadataLen); + if (isSet(object.maxMetadataLen)) obj.maxMetadataLen = BigInt(object.maxMetadataLen.toString()); if (isSet(object.authority)) obj.authority = String(object.authority); return obj; }, toJSON(message: Module): unknown { const obj: any = {}; message.maxMetadataLen !== undefined && - (obj.maxMetadataLen = (message.maxMetadataLen || Long.UZERO).toString()); + (obj.maxMetadataLen = (message.maxMetadataLen || BigInt(0)).toString()); message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); if (object.maxMetadataLen !== undefined && object.maxMetadataLen !== null) { - message.maxMetadataLen = Long.fromValue(object.maxMetadataLen); + message.maxMetadataLen = BigInt(object.maxMetadataLen.toString()); } message.authority = object.authority ?? ""; return message; diff --git a/src/cosmos/gov/v1/genesis.ts b/src/cosmos/gov/v1/genesis.ts index 14c22fd..bf92129 100644 --- a/src/cosmos/gov/v1/genesis.ts +++ b/src/cosmos/gov/v1/genesis.ts @@ -1,12 +1,12 @@ /* eslint-disable */ import { Deposit, Vote, Proposal, DepositParams, VotingParams, TallyParams, Params } from "./gov"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ - startingProposalId: Long; + startingProposalId: bigint; /** deposits defines all the deposits present at genesis. */ deposits: Deposit[]; /** votes defines all the votes present at genesis. */ @@ -40,7 +40,7 @@ export interface GenesisState { } function createBaseGenesisState(): GenesisState { return { - startingProposalId: Long.UZERO, + startingProposalId: BigInt(0), deposits: [], votes: [], proposals: [], @@ -51,8 +51,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.startingProposalId.isZero()) { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { writer.uint32(8).uint64(message.startingProposalId); } for (const v of message.deposits) { @@ -78,15 +78,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startingProposalId = reader.uint64() as Long; + message.startingProposalId = reader.uint64(); break; case 2: message.deposits.push(Deposit.decode(reader, reader.uint32())); @@ -118,7 +118,8 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { const obj = createBaseGenesisState(); - if (isSet(object.startingProposalId)) obj.startingProposalId = Long.fromValue(object.startingProposalId); + if (isSet(object.startingProposalId)) + obj.startingProposalId = BigInt(object.startingProposalId.toString()); if (Array.isArray(object?.deposits)) obj.deposits = object.deposits.map((e: any) => Deposit.fromJSON(e)); if (Array.isArray(object?.votes)) obj.votes = object.votes.map((e: any) => Vote.fromJSON(e)); if (Array.isArray(object?.proposals)) @@ -132,7 +133,7 @@ export const GenesisState = { toJSON(message: GenesisState): unknown { const obj: any = {}; message.startingProposalId !== undefined && - (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()); + (obj.startingProposalId = (message.startingProposalId || BigInt(0)).toString()); if (message.deposits) { obj.deposits = message.deposits.map((e) => (e ? Deposit.toJSON(e) : undefined)); } else { @@ -157,10 +158,10 @@ export const GenesisState = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.startingProposalId !== undefined && object.startingProposalId !== null) { - message.startingProposalId = Long.fromValue(object.startingProposalId); + message.startingProposalId = BigInt(object.startingProposalId.toString()); } message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; diff --git a/src/cosmos/gov/v1/gov.ts b/src/cosmos/gov/v1/gov.ts index 187a3ea..f6f16f6 100644 --- a/src/cosmos/gov/v1/gov.ts +++ b/src/cosmos/gov/v1/gov.ts @@ -3,8 +3,8 @@ import { Coin } from "../../base/v1beta1/coin"; import { Any } from "../../../google/protobuf/any"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration } from "../../../google/protobuf/duration"; -import { Long, isSet, DeepPartial, Exact, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1"; /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { @@ -149,7 +149,7 @@ export interface WeightedVoteOption { */ export interface Deposit { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** amount to be deposited by depositor. */ @@ -158,7 +158,7 @@ export interface Deposit { /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { /** id defines the unique id of the proposal. */ - id: Long; + id: bigint; /** messages are the arbitrary messages to be executed if the proposal passes. */ messages: Any[]; /** status defines the proposal status. */ @@ -217,7 +217,7 @@ export interface TallyResult { */ export interface Vote { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter address of the proposal. */ voter: string; /** options is the weighted vote options. */ @@ -298,7 +298,7 @@ function createBaseWeightedVoteOption(): WeightedVoteOption { }; } export const WeightedVoteOption = { - encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.option !== 0) { writer.uint32(8).int32(message.option); } @@ -307,8 +307,8 @@ export const WeightedVoteOption = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseWeightedVoteOption(); while (reader.pos < end) { @@ -339,7 +339,7 @@ export const WeightedVoteOption = { message.weight !== undefined && (obj.weight = message.weight); return obj; }, - fromPartial, I>>(object: I): WeightedVoteOption { + fromPartial(object: Partial): WeightedVoteOption { const message = createBaseWeightedVoteOption(); message.option = object.option ?? 0; message.weight = object.weight ?? ""; @@ -348,14 +348,14 @@ export const WeightedVoteOption = { }; function createBaseDeposit(): Deposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [], }; } export const Deposit = { - encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -366,15 +366,15 @@ export const Deposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -391,14 +391,14 @@ export const Deposit = { }, fromJSON(object: any): Deposit { const obj = createBaseDeposit(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.depositor)) obj.depositor = String(object.depositor); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); return obj; }, toJSON(message: Deposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); @@ -407,10 +407,10 @@ export const Deposit = { } return obj; }, - fromPartial, I>>(object: I): Deposit { + fromPartial(object: Partial): Deposit { const message = createBaseDeposit(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.depositor = object.depositor ?? ""; message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; @@ -419,7 +419,7 @@ export const Deposit = { }; function createBaseProposal(): Proposal { return { - id: Long.UZERO, + id: BigInt(0), messages: [], status: 0, finalTallyResult: TallyResult.fromPartial({}), @@ -435,8 +435,8 @@ function createBaseProposal(): Proposal { }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } for (const v of message.messages) { @@ -477,15 +477,15 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; + message.id = reader.uint64(); break; case 2: message.messages.push(Any.decode(reader, reader.uint32())); @@ -532,7 +532,7 @@ export const Proposal = { }, fromJSON(object: any): Proposal { const obj = createBaseProposal(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); if (Array.isArray(object?.messages)) obj.messages = object.messages.map((e: any) => Any.fromJSON(e)); if (isSet(object.status)) obj.status = proposalStatusFromJSON(object.status); if (isSet(object.finalTallyResult)) obj.finalTallyResult = TallyResult.fromJSON(object.finalTallyResult); @@ -550,7 +550,7 @@ export const Proposal = { }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); if (message.messages) { obj.messages = message.messages.map((e) => (e ? Any.toJSON(e) : undefined)); } else { @@ -579,10 +579,10 @@ export const Proposal = { message.proposer !== undefined && (obj.proposer = message.proposer); return obj; }, - fromPartial, I>>(object: I): Proposal { + fromPartial(object: Partial): Proposal { const message = createBaseProposal(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; message.status = object.status ?? 0; @@ -618,7 +618,7 @@ function createBaseTallyResult(): TallyResult { }; } export const TallyResult = { - encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yesCount !== "") { writer.uint32(10).string(message.yesCount); } @@ -633,8 +633,8 @@ export const TallyResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyResult(); while (reader.pos < end) { @@ -675,7 +675,7 @@ export const TallyResult = { message.noWithVetoCount !== undefined && (obj.noWithVetoCount = message.noWithVetoCount); return obj; }, - fromPartial, I>>(object: I): TallyResult { + fromPartial(object: Partial): TallyResult { const message = createBaseTallyResult(); message.yesCount = object.yesCount ?? ""; message.abstainCount = object.abstainCount ?? ""; @@ -686,15 +686,15 @@ export const TallyResult = { }; function createBaseVote(): Vote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", options: [], metadata: "", }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -708,15 +708,15 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -736,7 +736,7 @@ export const Vote = { }, fromJSON(object: any): Vote { const obj = createBaseVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (Array.isArray(object?.options)) obj.options = object.options.map((e: any) => WeightedVoteOption.fromJSON(e)); @@ -745,7 +745,7 @@ export const Vote = { }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { obj.options = message.options.map((e) => (e ? WeightedVoteOption.toJSON(e) : undefined)); @@ -755,10 +755,10 @@ export const Vote = { message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>(object: I): Vote { + fromPartial(object: Partial): Vote { const message = createBaseVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; @@ -773,7 +773,7 @@ function createBaseDepositParams(): DepositParams { }; } export const DepositParams = { - encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -782,8 +782,8 @@ export const DepositParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDepositParams(); while (reader.pos < end) { @@ -822,7 +822,7 @@ export const DepositParams = { : undefined); return obj; }, - fromPartial, I>>(object: I): DepositParams { + fromPartial(object: Partial): DepositParams { const message = createBaseDepositParams(); message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) { @@ -837,14 +837,14 @@ function createBaseVotingParams(): VotingParams { }; } export const VotingParams = { - encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVotingParams(); while (reader.pos < end) { @@ -871,7 +871,7 @@ export const VotingParams = { (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); return obj; }, - fromPartial, I>>(object: I): VotingParams { + fromPartial(object: Partial): VotingParams { const message = createBaseVotingParams(); if (object.votingPeriod !== undefined && object.votingPeriod !== null) { message.votingPeriod = Duration.fromPartial(object.votingPeriod); @@ -887,7 +887,7 @@ function createBaseTallyParams(): TallyParams { }; } export const TallyParams = { - encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.quorum !== "") { writer.uint32(10).string(message.quorum); } @@ -899,8 +899,8 @@ export const TallyParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyParams(); while (reader.pos < end) { @@ -936,7 +936,7 @@ export const TallyParams = { message.vetoThreshold !== undefined && (obj.vetoThreshold = message.vetoThreshold); return obj; }, - fromPartial, I>>(object: I): TallyParams { + fromPartial(object: Partial): TallyParams { const message = createBaseTallyParams(); message.quorum = object.quorum ?? ""; message.threshold = object.threshold ?? ""; @@ -959,7 +959,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -992,8 +992,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -1077,7 +1077,7 @@ export const Params = { message.burnVoteVeto !== undefined && (obj.burnVoteVeto = message.burnVoteVeto); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) { diff --git a/src/cosmos/gov/v1/query.ts b/src/cosmos/gov/v1/query.ts index 73b29f0..6c7e309 100644 --- a/src/cosmos/gov/v1/query.ts +++ b/src/cosmos/gov/v1/query.ts @@ -13,13 +13,13 @@ import { proposalStatusToJSON, } from "./gov"; import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponse { @@ -50,7 +50,7 @@ export interface QueryProposalsResponse { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter defines the voter address for the proposals. */ voter: string; } @@ -62,7 +62,7 @@ export interface QueryVoteResponse { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -111,7 +111,7 @@ export interface QueryParamsResponse { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -123,7 +123,7 @@ export interface QueryDepositResponse { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -137,7 +137,7 @@ export interface QueryDepositsResponse { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponse { @@ -146,25 +146,25 @@ export interface QueryTallyResultResponse { } function createBaseQueryProposalRequest(): QueryProposalRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -175,18 +175,18 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { const obj = createBaseQueryProposalRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryProposalRequest { + fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -197,14 +197,14 @@ function createBaseQueryProposalResponse(): QueryProposalResponse { }; } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalResponse(); while (reader.pos < end) { @@ -231,7 +231,7 @@ export const QueryProposalResponse = { (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalResponse { + fromPartial(object: Partial): QueryProposalResponse { const message = createBaseQueryProposalResponse(); if (object.proposal !== undefined && object.proposal !== null) { message.proposal = Proposal.fromPartial(object.proposal); @@ -248,7 +248,7 @@ function createBaseQueryProposalsRequest(): QueryProposalsRequest { }; } export const QueryProposalsRequest = { - encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalStatus !== 0) { writer.uint32(8).int32(message.proposalStatus); } @@ -263,8 +263,8 @@ export const QueryProposalsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsRequest(); while (reader.pos < end) { @@ -307,7 +307,7 @@ export const QueryProposalsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalsRequest { + fromPartial(object: Partial): QueryProposalsRequest { const message = createBaseQueryProposalsRequest(); message.proposalStatus = object.proposalStatus ?? 0; message.voter = object.voter ?? ""; @@ -325,7 +325,7 @@ function createBaseQueryProposalsResponse(): QueryProposalsResponse { }; } export const QueryProposalsResponse = { - encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -334,8 +334,8 @@ export const QueryProposalsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsResponse(); while (reader.pos < end) { @@ -372,7 +372,7 @@ export const QueryProposalsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalsResponse { + fromPartial(object: Partial): QueryProposalsResponse { const message = createBaseQueryProposalsResponse(); message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -383,13 +383,13 @@ export const QueryProposalsResponse = { }; function createBaseQueryVoteRequest(): QueryVoteRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", }; } export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -397,15 +397,15 @@ export const QueryVoteRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -419,20 +419,20 @@ export const QueryVoteRequest = { }, fromJSON(object: any): QueryVoteRequest { const obj = createBaseQueryVoteRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); return obj; }, toJSON(message: QueryVoteRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); return obj; }, - fromPartial, I>>(object: I): QueryVoteRequest { + fromPartial(object: Partial): QueryVoteRequest { const message = createBaseQueryVoteRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; return message; @@ -444,14 +444,14 @@ function createBaseQueryVoteResponse(): QueryVoteResponse { }; } export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteResponse(); while (reader.pos < end) { @@ -477,7 +477,7 @@ export const QueryVoteResponse = { message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryVoteResponse { + fromPartial(object: Partial): QueryVoteResponse { const message = createBaseQueryVoteResponse(); if (object.vote !== undefined && object.vote !== null) { message.vote = Vote.fromPartial(object.vote); @@ -487,13 +487,13 @@ export const QueryVoteResponse = { }; function createBaseQueryVotesRequest(): QueryVotesRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -501,15 +501,15 @@ export const QueryVotesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -523,21 +523,21 @@ export const QueryVotesRequest = { }, fromJSON(object: any): QueryVotesRequest { const obj = createBaseQueryVotesRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryVotesRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryVotesRequest { + fromPartial(object: Partial): QueryVotesRequest { const message = createBaseQueryVotesRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -552,7 +552,7 @@ function createBaseQueryVotesResponse(): QueryVotesResponse { }; } export const QueryVotesResponse = { - encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -561,8 +561,8 @@ export const QueryVotesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesResponse(); while (reader.pos < end) { @@ -598,7 +598,7 @@ export const QueryVotesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryVotesResponse { + fromPartial(object: Partial): QueryVotesResponse { const message = createBaseQueryVotesResponse(); message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -613,14 +613,14 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { }; } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.paramsType !== "") { writer.uint32(10).string(message.paramsType); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -646,7 +646,7 @@ export const QueryParamsRequest = { message.paramsType !== undefined && (obj.paramsType = message.paramsType); return obj; }, - fromPartial, I>>(object: I): QueryParamsRequest { + fromPartial(object: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); message.paramsType = object.paramsType ?? ""; return message; @@ -661,7 +661,7 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingParams !== undefined) { VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); } @@ -676,8 +676,8 @@ export const QueryParamsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -721,7 +721,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.votingParams !== undefined && object.votingParams !== null) { message.votingParams = VotingParams.fromPartial(object.votingParams); @@ -740,13 +740,13 @@ export const QueryParamsResponse = { }; function createBaseQueryDepositRequest(): QueryDepositRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", }; } export const QueryDepositRequest = { - encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -754,15 +754,15 @@ export const QueryDepositRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -776,20 +776,20 @@ export const QueryDepositRequest = { }, fromJSON(object: any): QueryDepositRequest { const obj = createBaseQueryDepositRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.depositor)) obj.depositor = String(object.depositor); return obj; }, toJSON(message: QueryDepositRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); return obj; }, - fromPartial, I>>(object: I): QueryDepositRequest { + fromPartial(object: Partial): QueryDepositRequest { const message = createBaseQueryDepositRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.depositor = object.depositor ?? ""; return message; @@ -801,14 +801,14 @@ function createBaseQueryDepositResponse(): QueryDepositResponse { }; } export const QueryDepositResponse = { - encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deposit !== undefined) { Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositResponse(); while (reader.pos < end) { @@ -835,7 +835,7 @@ export const QueryDepositResponse = { (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDepositResponse { + fromPartial(object: Partial): QueryDepositResponse { const message = createBaseQueryDepositResponse(); if (object.deposit !== undefined && object.deposit !== null) { message.deposit = Deposit.fromPartial(object.deposit); @@ -845,13 +845,13 @@ export const QueryDepositResponse = { }; function createBaseQueryDepositsRequest(): QueryDepositsRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryDepositsRequest = { - encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -859,15 +859,15 @@ export const QueryDepositsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -881,21 +881,21 @@ export const QueryDepositsRequest = { }, fromJSON(object: any): QueryDepositsRequest { const obj = createBaseQueryDepositsRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryDepositsRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDepositsRequest { + fromPartial(object: Partial): QueryDepositsRequest { const message = createBaseQueryDepositsRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -910,7 +910,7 @@ function createBaseQueryDepositsResponse(): QueryDepositsResponse { }; } export const QueryDepositsResponse = { - encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -919,8 +919,8 @@ export const QueryDepositsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsResponse(); while (reader.pos < end) { @@ -956,7 +956,7 @@ export const QueryDepositsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDepositsResponse { + fromPartial(object: Partial): QueryDepositsResponse { const message = createBaseQueryDepositsResponse(); message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -967,25 +967,25 @@ export const QueryDepositsResponse = { }; function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -996,18 +996,18 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { const obj = createBaseQueryTallyResultRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryTallyResultRequest { + fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -1018,14 +1018,14 @@ function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { }; } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { @@ -1052,9 +1052,7 @@ export const QueryTallyResultResponse = { (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTallyResultResponse { + fromPartial(object: Partial): QueryTallyResultResponse { const message = createBaseQueryTallyResultResponse(); if (object.tally !== undefined && object.tally !== null) { message.tally = TallyResult.fromPartial(object.tally); @@ -1097,41 +1095,41 @@ export class QueryClientImpl implements Query { Proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposal", data); - return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryProposalResponse.decode(new BinaryReader(data))); } Proposals(request: QueryProposalsRequest): Promise { const data = QueryProposalsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposals", data); - return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryProposalsResponse.decode(new BinaryReader(data))); } Vote(request: QueryVoteRequest): Promise { const data = QueryVoteRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Vote", data); - return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVoteResponse.decode(new BinaryReader(data))); } Votes(request: QueryVotesRequest): Promise { const data = QueryVotesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Votes", data); - return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVotesResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } Deposit(request: QueryDepositRequest): Promise { const data = QueryDepositRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposit", data); - return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositResponse.decode(new BinaryReader(data))); } Deposits(request: QueryDepositsRequest): Promise { const data = QueryDepositsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposits", data); - return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositsResponse.decode(new BinaryReader(data))); } TallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Query", "TallyResult", data); - return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTallyResultResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/gov/v1/tx.amino.ts b/src/cosmos/gov/v1/tx.amino.ts new file mode 100644 index 0000000..6d5738e --- /dev/null +++ b/src/cosmos/gov/v1/tx.amino.ts @@ -0,0 +1,296 @@ +//@ts-nocheck +/* eslint-disable */ +import { voteOptionFromJSON } from "./gov"; +import { AminoMsg } from "@cosmjs/amino"; +import { + MsgSubmitProposal, + MsgExecLegacyContent, + MsgVote, + MsgVoteWeighted, + MsgDeposit, + MsgUpdateParams, +} from "./tx"; +export interface MsgSubmitProposalAminoType extends AminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposal"; + value: { + messages: { + type_url: string; + value: Uint8Array; + }[]; + initial_deposit: { + denom: string; + amount: string; + }[]; + proposer: string; + metadata: string; + title: string; + summary: string; + }; +} +export interface MsgExecLegacyContentAminoType extends AminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContent"; + value: { + content: { + type_url: string; + value: Uint8Array; + }; + authority: string; + }; +} +export interface MsgVoteAminoType extends AminoMsg { + type: "cosmos-sdk/v1/MsgVote"; + value: { + proposal_id: string; + voter: string; + option: number; + metadata: string; + }; +} +export interface MsgVoteWeightedAminoType extends AminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeighted"; + value: { + proposal_id: string; + voter: string; + options: { + option: number; + weight: string; + }[]; + metadata: string; + }; +} +export interface MsgDepositAminoType extends AminoMsg { + type: "cosmos-sdk/v1/MsgDeposit"; + value: { + proposal_id: string; + depositor: string; + amount: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + value: { + authority: string; + params: { + min_deposit: { + denom: string; + amount: string; + }[]; + max_deposit_period: { + seconds: string; + nanos: number; + }; + voting_period: { + seconds: string; + nanos: number; + }; + quorum: string; + threshold: string; + veto_threshold: string; + min_initial_deposit_ratio: string; + burn_vote_quorum: boolean; + burn_proposal_deposit_prevote: boolean; + burn_vote_veto: boolean; + }; + }; +} +export const AminoConverter = { + "/cosmos.gov.v1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + toAmino: ({ + messages, + initialDeposit, + proposer, + metadata, + title, + summary, + }: MsgSubmitProposal): MsgSubmitProposalAminoType["value"] => { + return { + messages: messages.map((el0) => ({ + type_url: el0.typeUrl, + value: el0.value, + })), + initial_deposit: initialDeposit.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + proposer, + metadata, + title, + summary, + }; + }, + fromAmino: ({ + messages, + initial_deposit, + proposer, + metadata, + title, + summary, + }: MsgSubmitProposalAminoType["value"]): MsgSubmitProposal => { + return { + messages: messages.map((el0) => ({ + typeUrl: el0.type_url, + value: el0.value, + })), + initialDeposit: initial_deposit.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + proposer, + metadata, + title, + summary, + }; + }, + }, + "/cosmos.gov.v1.MsgExecLegacyContent": { + aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", + toAmino: ({ content, authority }: MsgExecLegacyContent): MsgExecLegacyContentAminoType["value"] => { + return { + content: { + type_url: content.typeUrl, + value: content.value, + }, + authority, + }; + }, + fromAmino: ({ content, authority }: MsgExecLegacyContentAminoType["value"]): MsgExecLegacyContent => { + return { + content: { + typeUrl: content.type_url, + value: content.value, + }, + authority, + }; + }, + }, + "/cosmos.gov.v1.MsgVote": { + aminoType: "cosmos-sdk/v1/MsgVote", + toAmino: ({ proposalId, voter, option, metadata }: MsgVote): MsgVoteAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + voter, + option, + metadata, + }; + }, + fromAmino: ({ proposal_id, voter, option, metadata }: MsgVoteAminoType["value"]): MsgVote => { + return { + proposalId: BigInt(proposal_id), + voter, + option: voteOptionFromJSON(option), + metadata, + }; + }, + }, + "/cosmos.gov.v1.MsgVoteWeighted": { + aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + toAmino: ({ + proposalId, + voter, + options, + metadata, + }: MsgVoteWeighted): MsgVoteWeightedAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + voter, + options: options.map((el0) => ({ + option: el0.option, + weight: el0.weight, + })), + metadata, + }; + }, + fromAmino: ({ + proposal_id, + voter, + options, + metadata, + }: MsgVoteWeightedAminoType["value"]): MsgVoteWeighted => { + return { + proposalId: BigInt(proposal_id), + voter, + options: options.map((el0) => ({ + option: voteOptionFromJSON(el0.option), + weight: el0.weight, + })), + metadata, + }; + }, + }, + "/cosmos.gov.v1.MsgDeposit": { + aminoType: "cosmos-sdk/v1/MsgDeposit", + toAmino: ({ proposalId, depositor, amount }: MsgDeposit): MsgDepositAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + depositor, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ proposal_id, depositor, amount }: MsgDepositAminoType["value"]): MsgDeposit => { + return { + proposalId: BigInt(proposal_id), + depositor, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/cosmos.gov.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/gov/v1/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + min_deposit: params.minDeposit.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + max_deposit_period: (params.maxDepositPeriod * 1_000_000_000).toString(), + voting_period: (params.votingPeriod * 1_000_000_000).toString(), + quorum: params.quorum, + threshold: params.threshold, + veto_threshold: params.vetoThreshold, + min_initial_deposit_ratio: params.minInitialDepositRatio, + burn_vote_quorum: params.burnVoteQuorum, + burn_proposal_deposit_prevote: params.burnProposalDepositPrevote, + burn_vote_veto: params.burnVoteVeto, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + minDeposit: params.min_deposit.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + maxDepositPeriod: { + seconds: BigInt(Math.floor(parseInt(params.max_deposit_period) / 1_000_000_000)), + nanos: parseInt(params.max_deposit_period) % 1_000_000_000, + }, + votingPeriod: { + seconds: BigInt(Math.floor(parseInt(params.voting_period) / 1_000_000_000)), + nanos: parseInt(params.voting_period) % 1_000_000_000, + }, + quorum: params.quorum, + threshold: params.threshold, + vetoThreshold: params.veto_threshold, + minInitialDepositRatio: params.min_initial_deposit_ratio, + burnVoteQuorum: params.burn_vote_quorum, + burnProposalDepositPrevote: params.burn_proposal_deposit_prevote, + burnVoteVeto: params.burn_vote_veto, + }, + }; + }, + }, +}; diff --git a/src/cosmos/gov/v1/tx.registry.ts b/src/cosmos/gov/v1/tx.registry.ts new file mode 100644 index 0000000..a1a79c3 --- /dev/null +++ b/src/cosmos/gov/v1/tx.registry.ts @@ -0,0 +1,216 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgSubmitProposal, + MsgExecLegacyContent, + MsgVote, + MsgVoteWeighted, + MsgDeposit, + MsgUpdateParams, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.gov.v1.MsgExecLegacyContent", MsgExecLegacyContent], + ["/cosmos.gov.v1.MsgVote", MsgVote], + ["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted], + ["/cosmos.gov.v1.MsgDeposit", MsgDeposit], + ["/cosmos.gov.v1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish(), + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.encode(value).finish(), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.encode(value).finish(), + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(value).finish(), + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value, + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value, + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value, + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value, + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.toJSON(value), + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.toJSON(value), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.toJSON(value), + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.toJSON(value), + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + submitProposal(value: any) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromJSON(value), + }; + }, + execLegacyContent(value: any) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.fromJSON(value), + }; + }, + vote(value: any) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.fromJSON(value), + }; + }, + voteWeighted(value: any) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.fromJSON(value), + }; + }, + deposit(value: any) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value), + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.fromPartial(value), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.fromPartial(value), + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.fromPartial(value), + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/gov/v1/tx.ts b/src/cosmos/gov/v1/tx.ts index 522a67d..779f5d9 100644 --- a/src/cosmos/gov/v1/tx.ts +++ b/src/cosmos/gov/v1/tx.ts @@ -2,8 +2,8 @@ import { Any } from "../../../google/protobuf/any"; import { Coin } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption, Params, voteOptionFromJSON, voteOptionToJSON } from "./gov"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -34,7 +34,7 @@ export interface MsgSubmitProposal { /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** * MsgExecLegacyContent is used to wrap the legacy content field into a message. @@ -51,7 +51,7 @@ export interface MsgExecLegacyContentResponse {} /** MsgVote defines a message to cast a vote. */ export interface MsgVote { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter address for the proposal. */ voter: string; /** option defines the vote option. */ @@ -64,7 +64,7 @@ export interface MsgVoteResponse {} /** MsgVoteWeighted defines a message to cast a vote. */ export interface MsgVoteWeighted { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter address for the proposal. */ voter: string; /** options defines the weighted vote options. */ @@ -77,7 +77,7 @@ export interface MsgVoteWeightedResponse {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** amount to be deposited by depositor. */ @@ -118,7 +118,7 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { }; } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -139,8 +139,8 @@ export const MsgSubmitProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { @@ -200,7 +200,7 @@ export const MsgSubmitProposal = { message.summary !== undefined && (obj.summary = message.summary); return obj; }, - fromPartial, I>>(object: I): MsgSubmitProposal { + fromPartial(object: Partial): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; message.initialDeposit = object.initialDeposit?.map((e) => Coin.fromPartial(e)) || []; @@ -213,25 +213,25 @@ export const MsgSubmitProposal = { }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -242,20 +242,18 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { const obj = createBaseMsgSubmitProposalResponse(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgSubmitProposalResponse { + fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -267,7 +265,7 @@ function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { }; } export const MsgExecLegacyContent = { - encode(message: MsgExecLegacyContent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { Any.encode(message.content, writer.uint32(10).fork()).ldelim(); } @@ -276,8 +274,8 @@ export const MsgExecLegacyContent = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecLegacyContent { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecLegacyContent(); while (reader.pos < end) { @@ -309,7 +307,7 @@ export const MsgExecLegacyContent = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): MsgExecLegacyContent { + fromPartial(object: Partial): MsgExecLegacyContent { const message = createBaseMsgExecLegacyContent(); if (object.content !== undefined && object.content !== null) { message.content = Any.fromPartial(object.content); @@ -322,11 +320,11 @@ function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse return {}; } export const MsgExecLegacyContentResponse = { - encode(_: MsgExecLegacyContentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecLegacyContentResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecLegacyContentResponse(); while (reader.pos < end) { @@ -347,24 +345,22 @@ export const MsgExecLegacyContentResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgExecLegacyContentResponse { + fromPartial(_: Partial): MsgExecLegacyContentResponse { const message = createBaseMsgExecLegacyContentResponse(); return message; }, }; function createBaseMsgVote(): MsgVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, metadata: "", }; } export const MsgVote = { - encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -378,15 +374,15 @@ export const MsgVote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -406,7 +402,7 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { const obj = createBaseMsgVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (isSet(object.option)) obj.option = voteOptionFromJSON(object.option); if (isSet(object.metadata)) obj.metadata = String(object.metadata); @@ -414,16 +410,16 @@ export const MsgVote = { }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>(object: I): MsgVote { + fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.option = object.option ?? 0; @@ -435,11 +431,11 @@ function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { @@ -460,22 +456,22 @@ export const MsgVoteResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgVoteResponse { + fromPartial(_: Partial): MsgVoteResponse { const message = createBaseMsgVoteResponse(); return message; }, }; function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", options: [], metadata: "", }; } export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -489,15 +485,15 @@ export const MsgVoteWeighted = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -517,7 +513,7 @@ export const MsgVoteWeighted = { }, fromJSON(object: any): MsgVoteWeighted { const obj = createBaseMsgVoteWeighted(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (Array.isArray(object?.options)) obj.options = object.options.map((e: any) => WeightedVoteOption.fromJSON(e)); @@ -526,7 +522,7 @@ export const MsgVoteWeighted = { }, toJSON(message: MsgVoteWeighted): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { obj.options = message.options.map((e) => (e ? WeightedVoteOption.toJSON(e) : undefined)); @@ -536,10 +532,10 @@ export const MsgVoteWeighted = { message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>(object: I): MsgVoteWeighted { + fromPartial(object: Partial): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; @@ -551,11 +547,11 @@ function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { return {}; } export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { @@ -576,21 +572,21 @@ export const MsgVoteWeightedResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgVoteWeightedResponse { + fromPartial(_: Partial): MsgVoteWeightedResponse { const message = createBaseMsgVoteWeightedResponse(); return message; }, }; function createBaseMsgDeposit(): MsgDeposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [], }; } export const MsgDeposit = { - encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -601,15 +597,15 @@ export const MsgDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -626,14 +622,14 @@ export const MsgDeposit = { }, fromJSON(object: any): MsgDeposit { const obj = createBaseMsgDeposit(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.depositor)) obj.depositor = String(object.depositor); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); return obj; }, toJSON(message: MsgDeposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); @@ -642,10 +638,10 @@ export const MsgDeposit = { } return obj; }, - fromPartial, I>>(object: I): MsgDeposit { + fromPartial(object: Partial): MsgDeposit { const message = createBaseMsgDeposit(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.depositor = object.depositor ?? ""; message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; @@ -656,11 +652,11 @@ function createBaseMsgDepositResponse(): MsgDepositResponse { return {}; } export const MsgDepositResponse = { - encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDepositResponse(); while (reader.pos < end) { @@ -681,7 +677,7 @@ export const MsgDepositResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgDepositResponse { + fromPartial(_: Partial): MsgDepositResponse { const message = createBaseMsgDepositResponse(); return message; }, @@ -693,7 +689,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -702,8 +698,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -734,7 +730,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -747,11 +743,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -772,7 +768,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -814,31 +810,31 @@ export class MsgClientImpl implements Msg { SubmitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "SubmitProposal", data); - return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSubmitProposalResponse.decode(new BinaryReader(data))); } ExecLegacyContent(request: MsgExecLegacyContent): Promise { const data = MsgExecLegacyContent.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "ExecLegacyContent", data); - return promise.then((data) => MsgExecLegacyContentResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgExecLegacyContentResponse.decode(new BinaryReader(data))); } Vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "Vote", data); - return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgVoteResponse.decode(new BinaryReader(data))); } VoteWeighted(request: MsgVoteWeighted): Promise { const data = MsgVoteWeighted.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "VoteWeighted", data); - return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgVoteWeightedResponse.decode(new BinaryReader(data))); } Deposit(request: MsgDeposit): Promise { const data = MsgDeposit.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "Deposit", data); - return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgDepositResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/gov/v1beta1/genesis.ts b/src/cosmos/gov/v1beta1/genesis.ts index ab48d7d..36e48bc 100644 --- a/src/cosmos/gov/v1beta1/genesis.ts +++ b/src/cosmos/gov/v1beta1/genesis.ts @@ -1,12 +1,12 @@ /* eslint-disable */ import { Deposit, Vote, Proposal, DepositParams, VotingParams, TallyParams } from "./gov"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1beta1"; /** GenesisState defines the gov module's genesis state. */ export interface GenesisState { /** starting_proposal_id is the ID of the starting proposal. */ - startingProposalId: Long; + startingProposalId: bigint; /** deposits defines all the deposits present at genesis. */ deposits: Deposit[]; /** votes defines all the votes present at genesis. */ @@ -22,7 +22,7 @@ export interface GenesisState { } function createBaseGenesisState(): GenesisState { return { - startingProposalId: Long.UZERO, + startingProposalId: BigInt(0), deposits: [], votes: [], proposals: [], @@ -32,8 +32,8 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.startingProposalId.isZero()) { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { writer.uint32(8).uint64(message.startingProposalId); } for (const v of message.deposits) { @@ -56,15 +56,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.startingProposalId = reader.uint64() as Long; + message.startingProposalId = reader.uint64(); break; case 2: message.deposits.push(Deposit.decode(reader, reader.uint32())); @@ -93,7 +93,8 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { const obj = createBaseGenesisState(); - if (isSet(object.startingProposalId)) obj.startingProposalId = Long.fromValue(object.startingProposalId); + if (isSet(object.startingProposalId)) + obj.startingProposalId = BigInt(object.startingProposalId.toString()); if (Array.isArray(object?.deposits)) obj.deposits = object.deposits.map((e: any) => Deposit.fromJSON(e)); if (Array.isArray(object?.votes)) obj.votes = object.votes.map((e: any) => Vote.fromJSON(e)); if (Array.isArray(object?.proposals)) @@ -106,7 +107,7 @@ export const GenesisState = { toJSON(message: GenesisState): unknown { const obj: any = {}; message.startingProposalId !== undefined && - (obj.startingProposalId = (message.startingProposalId || Long.UZERO).toString()); + (obj.startingProposalId = (message.startingProposalId || BigInt(0)).toString()); if (message.deposits) { obj.deposits = message.deposits.map((e) => (e ? Deposit.toJSON(e) : undefined)); } else { @@ -130,10 +131,10 @@ export const GenesisState = { (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.startingProposalId !== undefined && object.startingProposalId !== null) { - message.startingProposalId = Long.fromValue(object.startingProposalId); + message.startingProposalId = BigInt(object.startingProposalId.toString()); } message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; diff --git a/src/cosmos/gov/v1beta1/gov.ts b/src/cosmos/gov/v1beta1/gov.ts index c066678..08cc8d7 100644 --- a/src/cosmos/gov/v1beta1/gov.ts +++ b/src/cosmos/gov/v1beta1/gov.ts @@ -3,17 +3,8 @@ import { Coin } from "../../base/v1beta1/coin"; import { Any } from "../../../google/protobuf/any"; import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration } from "../../../google/protobuf/duration"; -import { - Long, - isSet, - DeepPartial, - Exact, - fromJsonTimestamp, - fromTimestamp, - bytesFromBase64, - base64FromBytes, -} from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1beta1"; /** VoteOption enumerates the valid vote options for a given governance proposal. */ export enum VoteOption { @@ -172,7 +163,7 @@ export interface TextProposal { */ export interface Deposit { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** amount to be deposited by depositor. */ @@ -181,7 +172,7 @@ export interface Deposit { /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** content is the proposal's content. */ content: Any; /** status defines the proposal status. */ @@ -220,7 +211,7 @@ export interface TallyResult { */ export interface Vote { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter address of the proposal. */ voter: string; /** @@ -274,7 +265,7 @@ function createBaseWeightedVoteOption(): WeightedVoteOption { }; } export const WeightedVoteOption = { - encode(message: WeightedVoteOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.option !== 0) { writer.uint32(8).int32(message.option); } @@ -283,8 +274,8 @@ export const WeightedVoteOption = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): WeightedVoteOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseWeightedVoteOption(); while (reader.pos < end) { @@ -315,7 +306,7 @@ export const WeightedVoteOption = { message.weight !== undefined && (obj.weight = message.weight); return obj; }, - fromPartial, I>>(object: I): WeightedVoteOption { + fromPartial(object: Partial): WeightedVoteOption { const message = createBaseWeightedVoteOption(); message.option = object.option ?? 0; message.weight = object.weight ?? ""; @@ -329,7 +320,7 @@ function createBaseTextProposal(): TextProposal { }; } export const TextProposal = { - encode(message: TextProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TextProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -338,8 +329,8 @@ export const TextProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TextProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TextProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTextProposal(); while (reader.pos < end) { @@ -370,7 +361,7 @@ export const TextProposal = { message.description !== undefined && (obj.description = message.description); return obj; }, - fromPartial, I>>(object: I): TextProposal { + fromPartial(object: Partial): TextProposal { const message = createBaseTextProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -379,14 +370,14 @@ export const TextProposal = { }; function createBaseDeposit(): Deposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [], }; } export const Deposit = { - encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -397,15 +388,15 @@ export const Deposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -422,14 +413,14 @@ export const Deposit = { }, fromJSON(object: any): Deposit { const obj = createBaseDeposit(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.depositor)) obj.depositor = String(object.depositor); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); return obj; }, toJSON(message: Deposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); @@ -438,10 +429,10 @@ export const Deposit = { } return obj; }, - fromPartial, I>>(object: I): Deposit { + fromPartial(object: Partial): Deposit { const message = createBaseDeposit(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.depositor = object.depositor ?? ""; message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; @@ -450,7 +441,7 @@ export const Deposit = { }; function createBaseProposal(): Proposal { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), content: Any.fromPartial({}), status: 0, finalTallyResult: TallyResult.fromPartial({}), @@ -462,8 +453,8 @@ function createBaseProposal(): Proposal { }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.content !== undefined) { @@ -492,15 +483,15 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.content = Any.decode(reader, reader.uint32()); @@ -535,7 +526,7 @@ export const Proposal = { }, fromJSON(object: any): Proposal { const obj = createBaseProposal(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.content)) obj.content = Any.fromJSON(object.content); if (isSet(object.status)) obj.status = proposalStatusFromJSON(object.status); if (isSet(object.finalTallyResult)) obj.finalTallyResult = TallyResult.fromJSON(object.finalTallyResult); @@ -549,7 +540,7 @@ export const Proposal = { }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); @@ -571,10 +562,10 @@ export const Proposal = { (obj.votingEndTime = fromTimestamp(message.votingEndTime).toISOString()); return obj; }, - fromPartial, I>>(object: I): Proposal { + fromPartial(object: Partial): Proposal { const message = createBaseProposal(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } if (object.content !== undefined && object.content !== null) { message.content = Any.fromPartial(object.content); @@ -608,7 +599,7 @@ function createBaseTallyResult(): TallyResult { }; } export const TallyResult = { - encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yes !== "") { writer.uint32(10).string(message.yes); } @@ -623,8 +614,8 @@ export const TallyResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyResult(); while (reader.pos < end) { @@ -665,7 +656,7 @@ export const TallyResult = { message.noWithVeto !== undefined && (obj.noWithVeto = message.noWithVeto); return obj; }, - fromPartial, I>>(object: I): TallyResult { + fromPartial(object: Partial): TallyResult { const message = createBaseTallyResult(); message.yes = object.yes ?? ""; message.abstain = object.abstain ?? ""; @@ -676,15 +667,15 @@ export const TallyResult = { }; function createBaseVote(): Vote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, options: [], }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -698,15 +689,15 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -726,7 +717,7 @@ export const Vote = { }, fromJSON(object: any): Vote { const obj = createBaseVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (isSet(object.option)) obj.option = voteOptionFromJSON(object.option); if (Array.isArray(object?.options)) @@ -735,7 +726,7 @@ export const Vote = { }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); if (message.options) { @@ -745,10 +736,10 @@ export const Vote = { } return obj; }, - fromPartial, I>>(object: I): Vote { + fromPartial(object: Partial): Vote { const message = createBaseVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.option = object.option ?? 0; @@ -763,7 +754,7 @@ function createBaseDepositParams(): DepositParams { }; } export const DepositParams = { - encode(message: DepositParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.minDeposit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -772,8 +763,8 @@ export const DepositParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DepositParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDepositParams(); while (reader.pos < end) { @@ -812,7 +803,7 @@ export const DepositParams = { : undefined); return obj; }, - fromPartial, I>>(object: I): DepositParams { + fromPartial(object: Partial): DepositParams { const message = createBaseDepositParams(); message.minDeposit = object.minDeposit?.map((e) => Coin.fromPartial(e)) || []; if (object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null) { @@ -827,14 +818,14 @@ function createBaseVotingParams(): VotingParams { }; } export const VotingParams = { - encode(message: VotingParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VotingParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVotingParams(); while (reader.pos < end) { @@ -861,7 +852,7 @@ export const VotingParams = { (obj.votingPeriod = message.votingPeriod ? Duration.toJSON(message.votingPeriod) : undefined); return obj; }, - fromPartial, I>>(object: I): VotingParams { + fromPartial(object: Partial): VotingParams { const message = createBaseVotingParams(); if (object.votingPeriod !== undefined && object.votingPeriod !== null) { message.votingPeriod = Duration.fromPartial(object.votingPeriod); @@ -877,7 +868,7 @@ function createBaseTallyParams(): TallyParams { }; } export const TallyParams = { - encode(message: TallyParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.quorum.length !== 0) { writer.uint32(10).bytes(message.quorum); } @@ -889,8 +880,8 @@ export const TallyParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyParams(); while (reader.pos < end) { @@ -933,7 +924,7 @@ export const TallyParams = { )); return obj; }, - fromPartial, I>>(object: I): TallyParams { + fromPartial(object: Partial): TallyParams { const message = createBaseTallyParams(); message.quorum = object.quorum ?? new Uint8Array(); message.threshold = object.threshold ?? new Uint8Array(); diff --git a/src/cosmos/gov/v1beta1/query.ts b/src/cosmos/gov/v1beta1/query.ts index 970bead..2444303 100644 --- a/src/cosmos/gov/v1beta1/query.ts +++ b/src/cosmos/gov/v1beta1/query.ts @@ -12,13 +12,13 @@ import { proposalStatusToJSON, } from "./gov"; import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1beta1"; /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponse { @@ -48,7 +48,7 @@ export interface QueryProposalsResponse { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter defines the voter address for the proposals. */ voter: string; } @@ -60,7 +60,7 @@ export interface QueryVoteResponse { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -91,7 +91,7 @@ export interface QueryParamsResponse { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -103,7 +103,7 @@ export interface QueryDepositResponse { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -117,7 +117,7 @@ export interface QueryDepositsResponse { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequest { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponse { @@ -126,25 +126,25 @@ export interface QueryTallyResultResponse { } function createBaseQueryProposalRequest(): QueryProposalRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -155,18 +155,18 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { const obj = createBaseQueryProposalRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryProposalRequest { + fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -177,14 +177,14 @@ function createBaseQueryProposalResponse(): QueryProposalResponse { }; } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalResponse(); while (reader.pos < end) { @@ -211,7 +211,7 @@ export const QueryProposalResponse = { (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalResponse { + fromPartial(object: Partial): QueryProposalResponse { const message = createBaseQueryProposalResponse(); if (object.proposal !== undefined && object.proposal !== null) { message.proposal = Proposal.fromPartial(object.proposal); @@ -228,7 +228,7 @@ function createBaseQueryProposalsRequest(): QueryProposalsRequest { }; } export const QueryProposalsRequest = { - encode(message: QueryProposalsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposalStatus !== 0) { writer.uint32(8).int32(message.proposalStatus); } @@ -243,8 +243,8 @@ export const QueryProposalsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsRequest(); while (reader.pos < end) { @@ -287,7 +287,7 @@ export const QueryProposalsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalsRequest { + fromPartial(object: Partial): QueryProposalsRequest { const message = createBaseQueryProposalsRequest(); message.proposalStatus = object.proposalStatus ?? 0; message.voter = object.voter ?? ""; @@ -305,7 +305,7 @@ function createBaseQueryProposalsResponse(): QueryProposalsResponse { }; } export const QueryProposalsResponse = { - encode(message: QueryProposalsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -314,8 +314,8 @@ export const QueryProposalsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsResponse(); while (reader.pos < end) { @@ -352,7 +352,7 @@ export const QueryProposalsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalsResponse { + fromPartial(object: Partial): QueryProposalsResponse { const message = createBaseQueryProposalsResponse(); message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -363,13 +363,13 @@ export const QueryProposalsResponse = { }; function createBaseQueryVoteRequest(): QueryVoteRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", }; } export const QueryVoteRequest = { - encode(message: QueryVoteRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -377,15 +377,15 @@ export const QueryVoteRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -399,20 +399,20 @@ export const QueryVoteRequest = { }, fromJSON(object: any): QueryVoteRequest { const obj = createBaseQueryVoteRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); return obj; }, toJSON(message: QueryVoteRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); return obj; }, - fromPartial, I>>(object: I): QueryVoteRequest { + fromPartial(object: Partial): QueryVoteRequest { const message = createBaseQueryVoteRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; return message; @@ -424,14 +424,14 @@ function createBaseQueryVoteResponse(): QueryVoteResponse { }; } export const QueryVoteResponse = { - encode(message: QueryVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteResponse(); while (reader.pos < end) { @@ -457,7 +457,7 @@ export const QueryVoteResponse = { message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryVoteResponse { + fromPartial(object: Partial): QueryVoteResponse { const message = createBaseQueryVoteResponse(); if (object.vote !== undefined && object.vote !== null) { message.vote = Vote.fromPartial(object.vote); @@ -467,13 +467,13 @@ export const QueryVoteResponse = { }; function createBaseQueryVotesRequest(): QueryVotesRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryVotesRequest = { - encode(message: QueryVotesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -481,15 +481,15 @@ export const QueryVotesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -503,21 +503,21 @@ export const QueryVotesRequest = { }, fromJSON(object: any): QueryVotesRequest { const obj = createBaseQueryVotesRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryVotesRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryVotesRequest { + fromPartial(object: Partial): QueryVotesRequest { const message = createBaseQueryVotesRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -532,7 +532,7 @@ function createBaseQueryVotesResponse(): QueryVotesResponse { }; } export const QueryVotesResponse = { - encode(message: QueryVotesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -541,8 +541,8 @@ export const QueryVotesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesResponse(); while (reader.pos < end) { @@ -578,7 +578,7 @@ export const QueryVotesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryVotesResponse { + fromPartial(object: Partial): QueryVotesResponse { const message = createBaseQueryVotesResponse(); message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -593,14 +593,14 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { }; } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.paramsType !== "") { writer.uint32(10).string(message.paramsType); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -626,7 +626,7 @@ export const QueryParamsRequest = { message.paramsType !== undefined && (obj.paramsType = message.paramsType); return obj; }, - fromPartial, I>>(object: I): QueryParamsRequest { + fromPartial(object: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); message.paramsType = object.paramsType ?? ""; return message; @@ -640,7 +640,7 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingParams !== undefined) { VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); } @@ -652,8 +652,8 @@ export const QueryParamsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -692,7 +692,7 @@ export const QueryParamsResponse = { (obj.tallyParams = message.tallyParams ? TallyParams.toJSON(message.tallyParams) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.votingParams !== undefined && object.votingParams !== null) { message.votingParams = VotingParams.fromPartial(object.votingParams); @@ -708,13 +708,13 @@ export const QueryParamsResponse = { }; function createBaseQueryDepositRequest(): QueryDepositRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", }; } export const QueryDepositRequest = { - encode(message: QueryDepositRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -722,15 +722,15 @@ export const QueryDepositRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -744,20 +744,20 @@ export const QueryDepositRequest = { }, fromJSON(object: any): QueryDepositRequest { const obj = createBaseQueryDepositRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.depositor)) obj.depositor = String(object.depositor); return obj; }, toJSON(message: QueryDepositRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); return obj; }, - fromPartial, I>>(object: I): QueryDepositRequest { + fromPartial(object: Partial): QueryDepositRequest { const message = createBaseQueryDepositRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.depositor = object.depositor ?? ""; return message; @@ -769,14 +769,14 @@ function createBaseQueryDepositResponse(): QueryDepositResponse { }; } export const QueryDepositResponse = { - encode(message: QueryDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deposit !== undefined) { Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositResponse(); while (reader.pos < end) { @@ -803,7 +803,7 @@ export const QueryDepositResponse = { (obj.deposit = message.deposit ? Deposit.toJSON(message.deposit) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDepositResponse { + fromPartial(object: Partial): QueryDepositResponse { const message = createBaseQueryDepositResponse(); if (object.deposit !== undefined && object.deposit !== null) { message.deposit = Deposit.fromPartial(object.deposit); @@ -813,13 +813,13 @@ export const QueryDepositResponse = { }; function createBaseQueryDepositsRequest(): QueryDepositsRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryDepositsRequest = { - encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -827,15 +827,15 @@ export const QueryDepositsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -849,21 +849,21 @@ export const QueryDepositsRequest = { }, fromJSON(object: any): QueryDepositsRequest { const obj = createBaseQueryDepositsRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryDepositsRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDepositsRequest { + fromPartial(object: Partial): QueryDepositsRequest { const message = createBaseQueryDepositsRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -878,7 +878,7 @@ function createBaseQueryDepositsResponse(): QueryDepositsResponse { }; } export const QueryDepositsResponse = { - encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -887,8 +887,8 @@ export const QueryDepositsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsResponse(); while (reader.pos < end) { @@ -924,7 +924,7 @@ export const QueryDepositsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDepositsResponse { + fromPartial(object: Partial): QueryDepositsResponse { const message = createBaseQueryDepositsResponse(); message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -935,25 +935,25 @@ export const QueryDepositsResponse = { }; function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -964,18 +964,18 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { const obj = createBaseQueryTallyResultRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryTallyResultRequest { + fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -986,14 +986,14 @@ function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { }; } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { @@ -1020,9 +1020,7 @@ export const QueryTallyResultResponse = { (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTallyResultResponse { + fromPartial(object: Partial): QueryTallyResultResponse { const message = createBaseQueryTallyResultResponse(); if (object.tally !== undefined && object.tally !== null) { message.tally = TallyResult.fromPartial(object.tally); @@ -1065,41 +1063,41 @@ export class QueryClientImpl implements Query { Proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposal", data); - return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryProposalResponse.decode(new BinaryReader(data))); } Proposals(request: QueryProposalsRequest): Promise { const data = QueryProposalsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Proposals", data); - return promise.then((data) => QueryProposalsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryProposalsResponse.decode(new BinaryReader(data))); } Vote(request: QueryVoteRequest): Promise { const data = QueryVoteRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Vote", data); - return promise.then((data) => QueryVoteResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVoteResponse.decode(new BinaryReader(data))); } Votes(request: QueryVotesRequest): Promise { const data = QueryVotesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Votes", data); - return promise.then((data) => QueryVotesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVotesResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } Deposit(request: QueryDepositRequest): Promise { const data = QueryDepositRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposit", data); - return promise.then((data) => QueryDepositResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositResponse.decode(new BinaryReader(data))); } Deposits(request: QueryDepositsRequest): Promise { const data = QueryDepositsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "Deposits", data); - return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositsResponse.decode(new BinaryReader(data))); } TallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Query", "TallyResult", data); - return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTallyResultResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/gov/v1beta1/tx.amino.ts b/src/cosmos/gov/v1beta1/tx.amino.ts new file mode 100644 index 0000000..e951a74 --- /dev/null +++ b/src/cosmos/gov/v1beta1/tx.amino.ts @@ -0,0 +1,150 @@ +/* eslint-disable */ +import { voteOptionFromJSON } from "./gov"; +import { AminoMsg } from "@cosmjs/amino"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export interface MsgSubmitProposalAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSubmitProposal"; + value: { + content: { + type_url: string; + value: Uint8Array; + }; + initial_deposit: { + denom: string; + amount: string; + }[]; + proposer: string; + }; +} +export interface MsgVoteAminoType extends AminoMsg { + type: "cosmos-sdk/MsgVote"; + value: { + proposal_id: string; + voter: string; + option: number; + }; +} +export interface MsgVoteWeightedAminoType extends AminoMsg { + type: "cosmos-sdk/MsgVoteWeighted"; + value: { + proposal_id: string; + voter: string; + options: { + option: number; + weight: string; + }[]; + }; +} +export interface MsgDepositAminoType extends AminoMsg { + type: "cosmos-sdk/MsgDeposit"; + value: { + proposal_id: string; + depositor: string; + amount: { + denom: string; + amount: string; + }[]; + }; +} +export const AminoConverter = { + "/cosmos.gov.v1beta1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/MsgSubmitProposal", + toAmino: ({ + content, + initialDeposit, + proposer, + }: MsgSubmitProposal): MsgSubmitProposalAminoType["value"] => { + return { + content: { + type_url: content.typeUrl, + value: content.value, + }, + initial_deposit: initialDeposit.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + proposer, + }; + }, + fromAmino: ({ + content, + initial_deposit, + proposer, + }: MsgSubmitProposalAminoType["value"]): MsgSubmitProposal => { + return { + content: { + typeUrl: content.type_url, + value: content.value, + }, + initialDeposit: initial_deposit.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + proposer, + }; + }, + }, + "/cosmos.gov.v1beta1.MsgVote": { + aminoType: "cosmos-sdk/MsgVote", + toAmino: ({ proposalId, voter, option }: MsgVote): MsgVoteAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + voter, + option, + }; + }, + fromAmino: ({ proposal_id, voter, option }: MsgVoteAminoType["value"]): MsgVote => { + return { + proposalId: BigInt(proposal_id), + voter, + option: voteOptionFromJSON(option), + }; + }, + }, + "/cosmos.gov.v1beta1.MsgVoteWeighted": { + aminoType: "cosmos-sdk/MsgVoteWeighted", + toAmino: ({ proposalId, voter, options }: MsgVoteWeighted): MsgVoteWeightedAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + voter, + options: options.map((el0) => ({ + option: el0.option, + weight: el0.weight, + })), + }; + }, + fromAmino: ({ proposal_id, voter, options }: MsgVoteWeightedAminoType["value"]): MsgVoteWeighted => { + return { + proposalId: BigInt(proposal_id), + voter, + options: options.map((el0) => ({ + option: voteOptionFromJSON(el0.option), + weight: el0.weight, + })), + }; + }, + }, + "/cosmos.gov.v1beta1.MsgDeposit": { + aminoType: "cosmos-sdk/MsgDeposit", + toAmino: ({ proposalId, depositor, amount }: MsgDeposit): MsgDepositAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + depositor, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ proposal_id, depositor, amount }: MsgDepositAminoType["value"]): MsgDeposit => { + return { + proposalId: BigInt(proposal_id), + depositor, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, +}; diff --git a/src/cosmos/gov/v1beta1/tx.registry.ts b/src/cosmos/gov/v1beta1/tx.registry.ts new file mode 100644 index 0000000..c7b79fd --- /dev/null +++ b/src/cosmos/gov/v1beta1/tx.registry.ts @@ -0,0 +1,147 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSubmitProposal, MsgVote, MsgVoteWeighted, MsgDeposit } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.gov.v1beta1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.gov.v1beta1.MsgVote", MsgVote], + ["/cosmos.gov.v1beta1.MsgVoteWeighted", MsgVoteWeighted], + ["/cosmos.gov.v1beta1.MsgDeposit", MsgDeposit], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish(), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.encode(value).finish(), + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(value).finish(), + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value, + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value, + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value, + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value, + }; + }, + }, + toJSON: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.toJSON(value), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.toJSON(value), + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.toJSON(value), + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.toJSON(value), + }; + }, + }, + fromJSON: { + submitProposal(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.fromJSON(value), + }; + }, + vote(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.fromJSON(value), + }; + }, + voteWeighted(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.fromJSON(value), + }; + }, + deposit(value: any) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.fromJSON(value), + }; + }, + }, + fromPartial: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVote", + value: MsgVote.fromPartial(value), + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", + value: MsgVoteWeighted.fromPartial(value), + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", + value: MsgDeposit.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/gov/v1beta1/tx.ts b/src/cosmos/gov/v1beta1/tx.ts index 7a10c2a..c34de50 100644 --- a/src/cosmos/gov/v1beta1/tx.ts +++ b/src/cosmos/gov/v1beta1/tx.ts @@ -2,8 +2,8 @@ import { Any } from "../../../google/protobuf/any"; import { Coin } from "../../base/v1beta1/coin"; import { VoteOption, WeightedVoteOption, voteOptionFromJSON, voteOptionToJSON } from "./gov"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.gov.v1beta1"; /** * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -20,12 +20,12 @@ export interface MsgSubmitProposal { /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter address for the proposal. */ voter: string; /** option defines the vote option. */ @@ -40,7 +40,7 @@ export interface MsgVoteResponse {} */ export interface MsgVoteWeighted { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter address for the proposal. */ voter: string; /** options defines the weighted vote options. */ @@ -55,7 +55,7 @@ export interface MsgVoteWeightedResponse {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { /** proposal_id defines the unique id of the proposal. */ - proposalId: Long; + proposalId: bigint; /** depositor defines the deposit addresses from the proposals. */ depositor: string; /** amount to be deposited by depositor. */ @@ -71,7 +71,7 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { }; } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.content !== undefined) { Any.encode(message.content, writer.uint32(10).fork()).ldelim(); } @@ -83,8 +83,8 @@ export const MsgSubmitProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { @@ -126,7 +126,7 @@ export const MsgSubmitProposal = { message.proposer !== undefined && (obj.proposer = message.proposer); return obj; }, - fromPartial, I>>(object: I): MsgSubmitProposal { + fromPartial(object: Partial): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); if (object.content !== undefined && object.content !== null) { message.content = Any.fromPartial(object.content); @@ -138,25 +138,25 @@ export const MsgSubmitProposal = { }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -167,34 +167,32 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { const obj = createBaseMsgSubmitProposalResponse(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgSubmitProposalResponse { + fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, }; function createBaseMsgVote(): MsgVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, }; } export const MsgVote = { - encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -205,15 +203,15 @@ export const MsgVote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -230,22 +228,22 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { const obj = createBaseMsgVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (isSet(object.option)) obj.option = voteOptionFromJSON(object.option); return obj; }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); return obj; }, - fromPartial, I>>(object: I): MsgVote { + fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.option = object.option ?? 0; @@ -256,11 +254,11 @@ function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { @@ -281,21 +279,21 @@ export const MsgVoteResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgVoteResponse { + fromPartial(_: Partial): MsgVoteResponse { const message = createBaseMsgVoteResponse(); return message; }, }; function createBaseMsgVoteWeighted(): MsgVoteWeighted { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", options: [], }; } export const MsgVoteWeighted = { - encode(message: MsgVoteWeighted, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -306,15 +304,15 @@ export const MsgVoteWeighted = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeighted { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeighted(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -331,7 +329,7 @@ export const MsgVoteWeighted = { }, fromJSON(object: any): MsgVoteWeighted { const obj = createBaseMsgVoteWeighted(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (Array.isArray(object?.options)) obj.options = object.options.map((e: any) => WeightedVoteOption.fromJSON(e)); @@ -339,7 +337,7 @@ export const MsgVoteWeighted = { }, toJSON(message: MsgVoteWeighted): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); if (message.options) { obj.options = message.options.map((e) => (e ? WeightedVoteOption.toJSON(e) : undefined)); @@ -348,10 +346,10 @@ export const MsgVoteWeighted = { } return obj; }, - fromPartial, I>>(object: I): MsgVoteWeighted { + fromPartial(object: Partial): MsgVoteWeighted { const message = createBaseMsgVoteWeighted(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.options = object.options?.map((e) => WeightedVoteOption.fromPartial(e)) || []; @@ -362,11 +360,11 @@ function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { return {}; } export const MsgVoteWeightedResponse = { - encode(_: MsgVoteWeightedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteWeightedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteWeightedResponse(); while (reader.pos < end) { @@ -387,21 +385,21 @@ export const MsgVoteWeightedResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgVoteWeightedResponse { + fromPartial(_: Partial): MsgVoteWeightedResponse { const message = createBaseMsgVoteWeightedResponse(); return message; }, }; function createBaseMsgDeposit(): MsgDeposit { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), depositor: "", amount: [], }; } export const MsgDeposit = { - encode(message: MsgDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.depositor !== "") { @@ -412,15 +410,15 @@ export const MsgDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDeposit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.depositor = reader.string(); @@ -437,14 +435,14 @@ export const MsgDeposit = { }, fromJSON(object: any): MsgDeposit { const obj = createBaseMsgDeposit(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.depositor)) obj.depositor = String(object.depositor); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); return obj; }, toJSON(message: MsgDeposit): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.depositor !== undefined && (obj.depositor = message.depositor); if (message.amount) { obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); @@ -453,10 +451,10 @@ export const MsgDeposit = { } return obj; }, - fromPartial, I>>(object: I): MsgDeposit { + fromPartial(object: Partial): MsgDeposit { const message = createBaseMsgDeposit(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.depositor = object.depositor ?? ""; message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; @@ -467,11 +465,11 @@ function createBaseMsgDepositResponse(): MsgDepositResponse { return {}; } export const MsgDepositResponse = { - encode(_: MsgDepositResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDepositResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDepositResponse(); while (reader.pos < end) { @@ -492,7 +490,7 @@ export const MsgDepositResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgDepositResponse { + fromPartial(_: Partial): MsgDepositResponse { const message = createBaseMsgDepositResponse(); return message; }, @@ -524,21 +522,21 @@ export class MsgClientImpl implements Msg { SubmitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "SubmitProposal", data); - return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSubmitProposalResponse.decode(new BinaryReader(data))); } Vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Vote", data); - return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgVoteResponse.decode(new BinaryReader(data))); } VoteWeighted(request: MsgVoteWeighted): Promise { const data = MsgVoteWeighted.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "VoteWeighted", data); - return promise.then((data) => MsgVoteWeightedResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgVoteWeightedResponse.decode(new BinaryReader(data))); } Deposit(request: MsgDeposit): Promise { const data = MsgDeposit.encode(request).finish(); const promise = this.rpc.request("cosmos.gov.v1beta1.Msg", "Deposit", data); - return promise.then((data) => MsgDepositResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgDepositResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/group/module/v1/module.ts b/src/cosmos/group/module/v1/module.ts index 3275ff3..2a92983 100644 --- a/src/cosmos/group/module/v1/module.ts +++ b/src/cosmos/group/module/v1/module.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Duration } from "../../../../google/protobuf/duration"; -import { Long, isSet, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.group.module.v1"; /** Module is the config object of the group module. */ export interface Module { @@ -14,26 +14,26 @@ export interface Module { * max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. * Defaults to 255 if not explicitly set. */ - maxMetadataLen: Long; + maxMetadataLen: bigint; } function createBaseModule(): Module { return { maxExecutionPeriod: Duration.fromPartial({}), - maxMetadataLen: Long.UZERO, + maxMetadataLen: BigInt(0), }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxExecutionPeriod !== undefined) { Duration.encode(message.maxExecutionPeriod, writer.uint32(10).fork()).ldelim(); } - if (!message.maxMetadataLen.isZero()) { + if (message.maxMetadataLen !== BigInt(0)) { writer.uint32(16).uint64(message.maxMetadataLen); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -43,7 +43,7 @@ export const Module = { message.maxExecutionPeriod = Duration.decode(reader, reader.uint32()); break; case 2: - message.maxMetadataLen = reader.uint64() as Long; + message.maxMetadataLen = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -56,7 +56,7 @@ export const Module = { const obj = createBaseModule(); if (isSet(object.maxExecutionPeriod)) obj.maxExecutionPeriod = Duration.fromJSON(object.maxExecutionPeriod); - if (isSet(object.maxMetadataLen)) obj.maxMetadataLen = Long.fromValue(object.maxMetadataLen); + if (isSet(object.maxMetadataLen)) obj.maxMetadataLen = BigInt(object.maxMetadataLen.toString()); return obj; }, toJSON(message: Module): unknown { @@ -66,16 +66,16 @@ export const Module = { ? Duration.toJSON(message.maxExecutionPeriod) : undefined); message.maxMetadataLen !== undefined && - (obj.maxMetadataLen = (message.maxMetadataLen || Long.UZERO).toString()); + (obj.maxMetadataLen = (message.maxMetadataLen || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); if (object.maxExecutionPeriod !== undefined && object.maxExecutionPeriod !== null) { message.maxExecutionPeriod = Duration.fromPartial(object.maxExecutionPeriod); } if (object.maxMetadataLen !== undefined && object.maxMetadataLen !== null) { - message.maxMetadataLen = Long.fromValue(object.maxMetadataLen); + message.maxMetadataLen = BigInt(object.maxMetadataLen.toString()); } return message; }, diff --git a/src/cosmos/group/v1/events.ts b/src/cosmos/group/v1/events.ts index b9c302c..a68f62e 100644 --- a/src/cosmos/group/v1/events.ts +++ b/src/cosmos/group/v1/events.ts @@ -8,18 +8,18 @@ import { proposalStatusFromJSON, proposalStatusToJSON, } from "./types"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.group.v1"; /** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroup { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } /** EventUpdateGroup is an event emitted when a group is updated. */ export interface EventUpdateGroup { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } /** EventCreateGroupPolicy is an event emitted when a group policy is created. */ export interface EventCreateGroupPolicy { @@ -34,22 +34,22 @@ export interface EventUpdateGroupPolicy { /** EventSubmitProposal is an event emitted when a proposal is created. */ export interface EventSubmitProposal { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ export interface EventWithdrawProposal { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** EventVote is an event emitted when a voter votes on a proposal. */ export interface EventVote { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** EventExec is an event emitted when a proposal is executed. */ export interface EventExec { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** result is the proposal execution result. */ result: ProposalExecutorResult; /** logs contains error logs in case the execution result is FAILURE. */ @@ -58,14 +58,14 @@ export interface EventExec { /** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroup { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** address is the account address of the group member. */ address: string; } /** EventProposalPruned is an event emitted when a proposal is pruned. */ export interface EventProposalPruned { /** proposal_id is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). */ status: ProposalStatus; /** tally_result is the proposal tally result (when applicable). */ @@ -73,25 +73,25 @@ export interface EventProposalPruned { } function createBaseEventCreateGroup(): EventCreateGroup { return { - groupId: Long.UZERO, + groupId: BigInt(0), }; } export const EventCreateGroup = { - encode(message: EventCreateGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: EventCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateGroup(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -102,43 +102,43 @@ export const EventCreateGroup = { }, fromJSON(object: any): EventCreateGroup { const obj = createBaseEventCreateGroup(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); return obj; }, toJSON(message: EventCreateGroup): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EventCreateGroup { + fromPartial(object: Partial): EventCreateGroup { const message = createBaseEventCreateGroup(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } return message; }, }; function createBaseEventUpdateGroup(): EventUpdateGroup { return { - groupId: Long.UZERO, + groupId: BigInt(0), }; } export const EventUpdateGroup = { - encode(message: EventUpdateGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: EventUpdateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateGroup(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -149,18 +149,18 @@ export const EventUpdateGroup = { }, fromJSON(object: any): EventUpdateGroup { const obj = createBaseEventUpdateGroup(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); return obj; }, toJSON(message: EventUpdateGroup): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EventUpdateGroup { + fromPartial(object: Partial): EventUpdateGroup { const message = createBaseEventUpdateGroup(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } return message; }, @@ -171,14 +171,14 @@ function createBaseEventCreateGroupPolicy(): EventCreateGroupPolicy { }; } export const EventCreateGroupPolicy = { - encode(message: EventCreateGroupPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EventCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateGroupPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventCreateGroupPolicy(); while (reader.pos < end) { @@ -204,7 +204,7 @@ export const EventCreateGroupPolicy = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): EventCreateGroupPolicy { + fromPartial(object: Partial): EventCreateGroupPolicy { const message = createBaseEventCreateGroupPolicy(); message.address = object.address ?? ""; return message; @@ -216,14 +216,14 @@ function createBaseEventUpdateGroupPolicy(): EventUpdateGroupPolicy { }; } export const EventUpdateGroupPolicy = { - encode(message: EventUpdateGroupPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EventUpdateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventUpdateGroupPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventUpdateGroupPolicy(); while (reader.pos < end) { @@ -249,7 +249,7 @@ export const EventUpdateGroupPolicy = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): EventUpdateGroupPolicy { + fromPartial(object: Partial): EventUpdateGroupPolicy { const message = createBaseEventUpdateGroupPolicy(); message.address = object.address ?? ""; return message; @@ -257,25 +257,25 @@ export const EventUpdateGroupPolicy = { }; function createBaseEventSubmitProposal(): EventSubmitProposal { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const EventSubmitProposal = { - encode(message: EventSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: EventSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSubmitProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -286,43 +286,43 @@ export const EventSubmitProposal = { }, fromJSON(object: any): EventSubmitProposal { const obj = createBaseEventSubmitProposal(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: EventSubmitProposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EventSubmitProposal { + fromPartial(object: Partial): EventSubmitProposal { const message = createBaseEventSubmitProposal(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, }; function createBaseEventWithdrawProposal(): EventWithdrawProposal { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const EventWithdrawProposal = { - encode(message: EventWithdrawProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: EventWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdrawProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventWithdrawProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -333,43 +333,43 @@ export const EventWithdrawProposal = { }, fromJSON(object: any): EventWithdrawProposal { const obj = createBaseEventWithdrawProposal(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: EventWithdrawProposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EventWithdrawProposal { + fromPartial(object: Partial): EventWithdrawProposal { const message = createBaseEventWithdrawProposal(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, }; function createBaseEventVote(): EventVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const EventVote = { - encode(message: EventVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: EventVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -380,32 +380,32 @@ export const EventVote = { }, fromJSON(object: any): EventVote { const obj = createBaseEventVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: EventVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EventVote { + fromPartial(object: Partial): EventVote { const message = createBaseEventVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, }; function createBaseEventExec(): EventExec { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), result: 0, logs: "", }; } export const EventExec = { - encode(message: EventExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: EventExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.result !== 0) { @@ -416,15 +416,15 @@ export const EventExec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventExec(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.result = reader.int32() as any; @@ -441,22 +441,22 @@ export const EventExec = { }, fromJSON(object: any): EventExec { const obj = createBaseEventExec(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.result)) obj.result = proposalExecutorResultFromJSON(object.result); if (isSet(object.logs)) obj.logs = String(object.logs); return obj; }, toJSON(message: EventExec): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.result !== undefined && (obj.result = proposalExecutorResultToJSON(message.result)); message.logs !== undefined && (obj.logs = message.logs); return obj; }, - fromPartial, I>>(object: I): EventExec { + fromPartial(object: Partial): EventExec { const message = createBaseEventExec(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.result = object.result ?? 0; message.logs = object.logs ?? ""; @@ -465,13 +465,13 @@ export const EventExec = { }; function createBaseEventLeaveGroup(): EventLeaveGroup { return { - groupId: Long.UZERO, + groupId: BigInt(0), address: "", }; } export const EventLeaveGroup = { - encode(message: EventLeaveGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: EventLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.address !== "") { @@ -479,15 +479,15 @@ export const EventLeaveGroup = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventLeaveGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventLeaveGroup(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 2: message.address = reader.string(); @@ -501,20 +501,20 @@ export const EventLeaveGroup = { }, fromJSON(object: any): EventLeaveGroup { const obj = createBaseEventLeaveGroup(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.address)) obj.address = String(object.address); return obj; }, toJSON(message: EventLeaveGroup): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): EventLeaveGroup { + fromPartial(object: Partial): EventLeaveGroup { const message = createBaseEventLeaveGroup(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.address = object.address ?? ""; return message; @@ -522,14 +522,14 @@ export const EventLeaveGroup = { }; function createBaseEventProposalPruned(): EventProposalPruned { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), status: 0, tallyResult: TallyResult.fromPartial({}), }; } export const EventProposalPruned = { - encode(message: EventProposalPruned, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: EventProposalPruned, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.status !== 0) { @@ -540,15 +540,15 @@ export const EventProposalPruned = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventProposalPruned { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventProposalPruned { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventProposalPruned(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.status = reader.int32() as any; @@ -565,23 +565,23 @@ export const EventProposalPruned = { }, fromJSON(object: any): EventProposalPruned { const obj = createBaseEventProposalPruned(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.status)) obj.status = proposalStatusFromJSON(object.status); if (isSet(object.tallyResult)) obj.tallyResult = TallyResult.fromJSON(object.tallyResult); return obj; }, toJSON(message: EventProposalPruned): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); message.tallyResult !== undefined && (obj.tallyResult = message.tallyResult ? TallyResult.toJSON(message.tallyResult) : undefined); return obj; }, - fromPartial, I>>(object: I): EventProposalPruned { + fromPartial(object: Partial): EventProposalPruned { const message = createBaseEventProposalPruned(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.status = object.status ?? 0; if (object.tallyResult !== undefined && object.tallyResult !== null) { diff --git a/src/cosmos/group/v1/genesis.ts b/src/cosmos/group/v1/genesis.ts index 3052a01..375af61 100644 --- a/src/cosmos/group/v1/genesis.ts +++ b/src/cosmos/group/v1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { GroupInfo, GroupMember, GroupPolicyInfo, Proposal, Vote } from "./types"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.group.v1"; /** GenesisState defines the group module's genesis state. */ export interface GenesisState { @@ -9,7 +9,7 @@ export interface GenesisState { * group_seq is the group table orm.Sequence, * it is used to get the next group ID. */ - groupSeq: Long; + groupSeq: bigint; /** groups is the list of groups info. */ groups: GroupInfo[]; /** group_members is the list of groups members. */ @@ -18,14 +18,14 @@ export interface GenesisState { * group_policy_seq is the group policy table orm.Sequence, * it is used to generate the next group policy account address. */ - groupPolicySeq: Long; + groupPolicySeq: bigint; /** group_policies is the list of group policies info. */ groupPolicies: GroupPolicyInfo[]; /** * proposal_seq is the proposal table orm.Sequence, * it is used to get the next proposal ID. */ - proposalSeq: Long; + proposalSeq: bigint; /** proposals is the list of proposals. */ proposals: Proposal[]; /** votes is the list of votes. */ @@ -33,19 +33,19 @@ export interface GenesisState { } function createBaseGenesisState(): GenesisState { return { - groupSeq: Long.UZERO, + groupSeq: BigInt(0), groups: [], groupMembers: [], - groupPolicySeq: Long.UZERO, + groupPolicySeq: BigInt(0), groupPolicies: [], - proposalSeq: Long.UZERO, + proposalSeq: BigInt(0), proposals: [], votes: [], }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupSeq.isZero()) { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupSeq !== BigInt(0)) { writer.uint32(8).uint64(message.groupSeq); } for (const v of message.groups) { @@ -54,13 +54,13 @@ export const GenesisState = { for (const v of message.groupMembers) { GroupMember.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (!message.groupPolicySeq.isZero()) { + if (message.groupPolicySeq !== BigInt(0)) { writer.uint32(32).uint64(message.groupPolicySeq); } for (const v of message.groupPolicies) { GroupPolicyInfo.encode(v!, writer.uint32(42).fork()).ldelim(); } - if (!message.proposalSeq.isZero()) { + if (message.proposalSeq !== BigInt(0)) { writer.uint32(48).uint64(message.proposalSeq); } for (const v of message.proposals) { @@ -71,15 +71,15 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupSeq = reader.uint64() as Long; + message.groupSeq = reader.uint64(); break; case 2: message.groups.push(GroupInfo.decode(reader, reader.uint32())); @@ -88,13 +88,13 @@ export const GenesisState = { message.groupMembers.push(GroupMember.decode(reader, reader.uint32())); break; case 4: - message.groupPolicySeq = reader.uint64() as Long; + message.groupPolicySeq = reader.uint64(); break; case 5: message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); break; case 6: - message.proposalSeq = reader.uint64() as Long; + message.proposalSeq = reader.uint64(); break; case 7: message.proposals.push(Proposal.decode(reader, reader.uint32())); @@ -111,14 +111,14 @@ export const GenesisState = { }, fromJSON(object: any): GenesisState { const obj = createBaseGenesisState(); - if (isSet(object.groupSeq)) obj.groupSeq = Long.fromValue(object.groupSeq); + if (isSet(object.groupSeq)) obj.groupSeq = BigInt(object.groupSeq.toString()); if (Array.isArray(object?.groups)) obj.groups = object.groups.map((e: any) => GroupInfo.fromJSON(e)); if (Array.isArray(object?.groupMembers)) obj.groupMembers = object.groupMembers.map((e: any) => GroupMember.fromJSON(e)); - if (isSet(object.groupPolicySeq)) obj.groupPolicySeq = Long.fromValue(object.groupPolicySeq); + if (isSet(object.groupPolicySeq)) obj.groupPolicySeq = BigInt(object.groupPolicySeq.toString()); if (Array.isArray(object?.groupPolicies)) obj.groupPolicies = object.groupPolicies.map((e: any) => GroupPolicyInfo.fromJSON(e)); - if (isSet(object.proposalSeq)) obj.proposalSeq = Long.fromValue(object.proposalSeq); + if (isSet(object.proposalSeq)) obj.proposalSeq = BigInt(object.proposalSeq.toString()); if (Array.isArray(object?.proposals)) obj.proposals = object.proposals.map((e: any) => Proposal.fromJSON(e)); if (Array.isArray(object?.votes)) obj.votes = object.votes.map((e: any) => Vote.fromJSON(e)); @@ -126,7 +126,7 @@ export const GenesisState = { }, toJSON(message: GenesisState): unknown { const obj: any = {}; - message.groupSeq !== undefined && (obj.groupSeq = (message.groupSeq || Long.UZERO).toString()); + message.groupSeq !== undefined && (obj.groupSeq = (message.groupSeq || BigInt(0)).toString()); if (message.groups) { obj.groups = message.groups.map((e) => (e ? GroupInfo.toJSON(e) : undefined)); } else { @@ -138,13 +138,13 @@ export const GenesisState = { obj.groupMembers = []; } message.groupPolicySeq !== undefined && - (obj.groupPolicySeq = (message.groupPolicySeq || Long.UZERO).toString()); + (obj.groupPolicySeq = (message.groupPolicySeq || BigInt(0)).toString()); if (message.groupPolicies) { obj.groupPolicies = message.groupPolicies.map((e) => (e ? GroupPolicyInfo.toJSON(e) : undefined)); } else { obj.groupPolicies = []; } - message.proposalSeq !== undefined && (obj.proposalSeq = (message.proposalSeq || Long.UZERO).toString()); + message.proposalSeq !== undefined && (obj.proposalSeq = (message.proposalSeq || BigInt(0)).toString()); if (message.proposals) { obj.proposals = message.proposals.map((e) => (e ? Proposal.toJSON(e) : undefined)); } else { @@ -157,19 +157,19 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.groupSeq !== undefined && object.groupSeq !== null) { - message.groupSeq = Long.fromValue(object.groupSeq); + message.groupSeq = BigInt(object.groupSeq.toString()); } message.groups = object.groups?.map((e) => GroupInfo.fromPartial(e)) || []; message.groupMembers = object.groupMembers?.map((e) => GroupMember.fromPartial(e)) || []; if (object.groupPolicySeq !== undefined && object.groupPolicySeq !== null) { - message.groupPolicySeq = Long.fromValue(object.groupPolicySeq); + message.groupPolicySeq = BigInt(object.groupPolicySeq.toString()); } message.groupPolicies = object.groupPolicies?.map((e) => GroupPolicyInfo.fromPartial(e)) || []; if (object.proposalSeq !== undefined && object.proposalSeq !== null) { - message.proposalSeq = Long.fromValue(object.proposalSeq); + message.proposalSeq = BigInt(object.proposalSeq.toString()); } message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; diff --git a/src/cosmos/group/v1/query.ts b/src/cosmos/group/v1/query.ts index 7f8ac1f..3337b6a 100644 --- a/src/cosmos/group/v1/query.ts +++ b/src/cosmos/group/v1/query.ts @@ -1,13 +1,13 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { GroupInfo, GroupPolicyInfo, GroupMember, Proposal, Vote, TallyResult } from "./types"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.group.v1"; /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequest { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } /** QueryGroupInfoResponse is the Query/GroupInfo response type. */ export interface QueryGroupInfoResponse { @@ -27,7 +27,7 @@ export interface QueryGroupPolicyInfoResponse { /** QueryGroupMembersRequest is the Query/GroupMembers request type. */ export interface QueryGroupMembersRequest { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -55,7 +55,7 @@ export interface QueryGroupsByAdminResponse { /** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ export interface QueryGroupPoliciesByGroupRequest { /** group_id is the unique ID of the group policy's group. */ - groupId: Long; + groupId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -83,7 +83,7 @@ export interface QueryGroupPoliciesByAdminResponse { /** QueryProposalRequest is the Query/Proposal request type. */ export interface QueryProposalRequest { /** proposal_id is the unique ID of a proposal. */ - proposalId: Long; + proposalId: bigint; } /** QueryProposalResponse is the Query/Proposal response type. */ export interface QueryProposalResponse { @@ -107,7 +107,7 @@ export interface QueryProposalsByGroupPolicyResponse { /** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ export interface QueryVoteByProposalVoterRequest { /** proposal_id is the unique ID of a proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is a proposal voter account address. */ voter: string; } @@ -119,7 +119,7 @@ export interface QueryVoteByProposalVoterResponse { /** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ export interface QueryVotesByProposalRequest { /** proposal_id is the unique ID of a proposal. */ - proposalId: Long; + proposalId: bigint; /** pagination defines an optional pagination for the request. */ pagination: PageRequest; } @@ -161,7 +161,7 @@ export interface QueryGroupsByMemberResponse { /** QueryTallyResultRequest is the Query/TallyResult request type. */ export interface QueryTallyResultRequest { /** proposal_id is the unique id of a proposal. */ - proposalId: Long; + proposalId: bigint; } /** QueryTallyResultResponse is the Query/TallyResult response type. */ export interface QueryTallyResultResponse { @@ -190,25 +190,25 @@ export interface QueryGroupsResponse { } function createBaseQueryGroupInfoRequest(): QueryGroupInfoRequest { return { - groupId: Long.UZERO, + groupId: BigInt(0), }; } export const QueryGroupInfoRequest = { - encode(message: QueryGroupInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: QueryGroupInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -219,18 +219,18 @@ export const QueryGroupInfoRequest = { }, fromJSON(object: any): QueryGroupInfoRequest { const obj = createBaseQueryGroupInfoRequest(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); return obj; }, toJSON(message: QueryGroupInfoRequest): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryGroupInfoRequest { + fromPartial(object: Partial): QueryGroupInfoRequest { const message = createBaseQueryGroupInfoRequest(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } return message; }, @@ -241,14 +241,14 @@ function createBaseQueryGroupInfoResponse(): QueryGroupInfoResponse { }; } export const QueryGroupInfoResponse = { - encode(message: QueryGroupInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { GroupInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupInfoResponse(); while (reader.pos < end) { @@ -274,7 +274,7 @@ export const QueryGroupInfoResponse = { message.info !== undefined && (obj.info = message.info ? GroupInfo.toJSON(message.info) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryGroupInfoResponse { + fromPartial(object: Partial): QueryGroupInfoResponse { const message = createBaseQueryGroupInfoResponse(); if (object.info !== undefined && object.info !== null) { message.info = GroupInfo.fromPartial(object.info); @@ -288,14 +288,14 @@ function createBaseQueryGroupPolicyInfoRequest(): QueryGroupPolicyInfoRequest { }; } export const QueryGroupPolicyInfoRequest = { - encode(message: QueryGroupPolicyInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupPolicyInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPolicyInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPolicyInfoRequest(); while (reader.pos < end) { @@ -321,9 +321,7 @@ export const QueryGroupPolicyInfoRequest = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupPolicyInfoRequest { + fromPartial(object: Partial): QueryGroupPolicyInfoRequest { const message = createBaseQueryGroupPolicyInfoRequest(); message.address = object.address ?? ""; return message; @@ -335,14 +333,14 @@ function createBaseQueryGroupPolicyInfoResponse(): QueryGroupPolicyInfoResponse }; } export const QueryGroupPolicyInfoResponse = { - encode(message: QueryGroupPolicyInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupPolicyInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.info !== undefined) { GroupPolicyInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPolicyInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPolicyInfoResponse(); while (reader.pos < end) { @@ -369,9 +367,7 @@ export const QueryGroupPolicyInfoResponse = { (obj.info = message.info ? GroupPolicyInfo.toJSON(message.info) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupPolicyInfoResponse { + fromPartial(object: Partial): QueryGroupPolicyInfoResponse { const message = createBaseQueryGroupPolicyInfoResponse(); if (object.info !== undefined && object.info !== null) { message.info = GroupPolicyInfo.fromPartial(object.info); @@ -381,13 +377,13 @@ export const QueryGroupPolicyInfoResponse = { }; function createBaseQueryGroupMembersRequest(): QueryGroupMembersRequest { return { - groupId: Long.UZERO, + groupId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryGroupMembersRequest = { - encode(message: QueryGroupMembersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: QueryGroupMembersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.pagination !== undefined) { @@ -395,15 +391,15 @@ export const QueryGroupMembersRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupMembersRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupMembersRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -417,23 +413,21 @@ export const QueryGroupMembersRequest = { }, fromJSON(object: any): QueryGroupMembersRequest { const obj = createBaseQueryGroupMembersRequest(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryGroupMembersRequest): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupMembersRequest { + fromPartial(object: Partial): QueryGroupMembersRequest { const message = createBaseQueryGroupMembersRequest(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -448,7 +442,7 @@ function createBaseQueryGroupMembersResponse(): QueryGroupMembersResponse { }; } export const QueryGroupMembersResponse = { - encode(message: QueryGroupMembersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.members) { GroupMember.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -457,8 +451,8 @@ export const QueryGroupMembersResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupMembersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupMembersResponse(); while (reader.pos < end) { @@ -494,9 +488,7 @@ export const QueryGroupMembersResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupMembersResponse { + fromPartial(object: Partial): QueryGroupMembersResponse { const message = createBaseQueryGroupMembersResponse(); message.members = object.members?.map((e) => GroupMember.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -512,7 +504,7 @@ function createBaseQueryGroupsByAdminRequest(): QueryGroupsByAdminRequest { }; } export const QueryGroupsByAdminRequest = { - encode(message: QueryGroupsByAdminRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupsByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -521,8 +513,8 @@ export const QueryGroupsByAdminRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByAdminRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByAdminRequest(); while (reader.pos < end) { @@ -554,9 +546,7 @@ export const QueryGroupsByAdminRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupsByAdminRequest { + fromPartial(object: Partial): QueryGroupsByAdminRequest { const message = createBaseQueryGroupsByAdminRequest(); message.admin = object.admin ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -572,7 +562,7 @@ function createBaseQueryGroupsByAdminResponse(): QueryGroupsByAdminResponse { }; } export const QueryGroupsByAdminResponse = { - encode(message: QueryGroupsByAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupsByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groups) { GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -581,8 +571,8 @@ export const QueryGroupsByAdminResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByAdminResponse(); while (reader.pos < end) { @@ -618,9 +608,7 @@ export const QueryGroupsByAdminResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupsByAdminResponse { + fromPartial(object: Partial): QueryGroupsByAdminResponse { const message = createBaseQueryGroupsByAdminResponse(); message.groups = object.groups?.map((e) => GroupInfo.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -631,13 +619,16 @@ export const QueryGroupsByAdminResponse = { }; function createBaseQueryGroupPoliciesByGroupRequest(): QueryGroupPoliciesByGroupRequest { return { - groupId: Long.UZERO, + groupId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryGroupPoliciesByGroupRequest = { - encode(message: QueryGroupPoliciesByGroupRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode( + message: QueryGroupPoliciesByGroupRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.pagination !== undefined) { @@ -645,15 +636,15 @@ export const QueryGroupPoliciesByGroupRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByGroupRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByGroupRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -667,23 +658,21 @@ export const QueryGroupPoliciesByGroupRequest = { }, fromJSON(object: any): QueryGroupPoliciesByGroupRequest { const obj = createBaseQueryGroupPoliciesByGroupRequest(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryGroupPoliciesByGroupRequest): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupPoliciesByGroupRequest { + fromPartial(object: Partial): QueryGroupPoliciesByGroupRequest { const message = createBaseQueryGroupPoliciesByGroupRequest(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -698,7 +687,10 @@ function createBaseQueryGroupPoliciesByGroupResponse(): QueryGroupPoliciesByGrou }; } export const QueryGroupPoliciesByGroupResponse = { - encode(message: QueryGroupPoliciesByGroupResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGroupPoliciesByGroupResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.groupPolicies) { GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -707,8 +699,8 @@ export const QueryGroupPoliciesByGroupResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByGroupResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByGroupResponse(); while (reader.pos < end) { @@ -745,9 +737,7 @@ export const QueryGroupPoliciesByGroupResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupPoliciesByGroupResponse { + fromPartial(object: Partial): QueryGroupPoliciesByGroupResponse { const message = createBaseQueryGroupPoliciesByGroupResponse(); message.groupPolicies = object.groupPolicies?.map((e) => GroupPolicyInfo.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -763,7 +753,10 @@ function createBaseQueryGroupPoliciesByAdminRequest(): QueryGroupPoliciesByAdmin }; } export const QueryGroupPoliciesByAdminRequest = { - encode(message: QueryGroupPoliciesByAdminRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGroupPoliciesByAdminRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -772,8 +765,8 @@ export const QueryGroupPoliciesByAdminRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByAdminRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByAdminRequest(); while (reader.pos < end) { @@ -805,9 +798,7 @@ export const QueryGroupPoliciesByAdminRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupPoliciesByAdminRequest { + fromPartial(object: Partial): QueryGroupPoliciesByAdminRequest { const message = createBaseQueryGroupPoliciesByAdminRequest(); message.admin = object.admin ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -823,7 +814,10 @@ function createBaseQueryGroupPoliciesByAdminResponse(): QueryGroupPoliciesByAdmi }; } export const QueryGroupPoliciesByAdminResponse = { - encode(message: QueryGroupPoliciesByAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryGroupPoliciesByAdminResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.groupPolicies) { GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -832,8 +826,8 @@ export const QueryGroupPoliciesByAdminResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupPoliciesByAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupPoliciesByAdminResponse(); while (reader.pos < end) { @@ -870,9 +864,7 @@ export const QueryGroupPoliciesByAdminResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupPoliciesByAdminResponse { + fromPartial(object: Partial): QueryGroupPoliciesByAdminResponse { const message = createBaseQueryGroupPoliciesByAdminResponse(); message.groupPolicies = object.groupPolicies?.map((e) => GroupPolicyInfo.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -883,25 +875,25 @@ export const QueryGroupPoliciesByAdminResponse = { }; function createBaseQueryProposalRequest(): QueryProposalRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const QueryProposalRequest = { - encode(message: QueryProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -912,18 +904,18 @@ export const QueryProposalRequest = { }, fromJSON(object: any): QueryProposalRequest { const obj = createBaseQueryProposalRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: QueryProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryProposalRequest { + fromPartial(object: Partial): QueryProposalRequest { const message = createBaseQueryProposalRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -934,14 +926,14 @@ function createBaseQueryProposalResponse(): QueryProposalResponse { }; } export const QueryProposalResponse = { - encode(message: QueryProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.proposal !== undefined) { Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalResponse(); while (reader.pos < end) { @@ -968,7 +960,7 @@ export const QueryProposalResponse = { (obj.proposal = message.proposal ? Proposal.toJSON(message.proposal) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryProposalResponse { + fromPartial(object: Partial): QueryProposalResponse { const message = createBaseQueryProposalResponse(); if (object.proposal !== undefined && object.proposal !== null) { message.proposal = Proposal.fromPartial(object.proposal); @@ -983,7 +975,10 @@ function createBaseQueryProposalsByGroupPolicyRequest(): QueryProposalsByGroupPo }; } export const QueryProposalsByGroupPolicyRequest = { - encode(message: QueryProposalsByGroupPolicyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryProposalsByGroupPolicyRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -992,8 +987,8 @@ export const QueryProposalsByGroupPolicyRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsByGroupPolicyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsByGroupPolicyRequest(); while (reader.pos < end) { @@ -1025,9 +1020,7 @@ export const QueryProposalsByGroupPolicyRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryProposalsByGroupPolicyRequest { + fromPartial(object: Partial): QueryProposalsByGroupPolicyRequest { const message = createBaseQueryProposalsByGroupPolicyRequest(); message.address = object.address ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1043,7 +1036,10 @@ function createBaseQueryProposalsByGroupPolicyResponse(): QueryProposalsByGroupP }; } export const QueryProposalsByGroupPolicyResponse = { - encode(message: QueryProposalsByGroupPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryProposalsByGroupPolicyResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.proposals) { Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1052,8 +1048,8 @@ export const QueryProposalsByGroupPolicyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryProposalsByGroupPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryProposalsByGroupPolicyResponse(); while (reader.pos < end) { @@ -1090,9 +1086,7 @@ export const QueryProposalsByGroupPolicyResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryProposalsByGroupPolicyResponse { + fromPartial(object: Partial): QueryProposalsByGroupPolicyResponse { const message = createBaseQueryProposalsByGroupPolicyResponse(); message.proposals = object.proposals?.map((e) => Proposal.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1103,13 +1097,16 @@ export const QueryProposalsByGroupPolicyResponse = { }; function createBaseQueryVoteByProposalVoterRequest(): QueryVoteByProposalVoterRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", }; } export const QueryVoteByProposalVoterRequest = { - encode(message: QueryVoteByProposalVoterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode( + message: QueryVoteByProposalVoterRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -1117,15 +1114,15 @@ export const QueryVoteByProposalVoterRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteByProposalVoterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteByProposalVoterRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -1139,22 +1136,20 @@ export const QueryVoteByProposalVoterRequest = { }, fromJSON(object: any): QueryVoteByProposalVoterRequest { const obj = createBaseQueryVoteByProposalVoterRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); return obj; }, toJSON(message: QueryVoteByProposalVoterRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); return obj; }, - fromPartial, I>>( - object: I, - ): QueryVoteByProposalVoterRequest { + fromPartial(object: Partial): QueryVoteByProposalVoterRequest { const message = createBaseQueryVoteByProposalVoterRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; return message; @@ -1166,14 +1161,17 @@ function createBaseQueryVoteByProposalVoterResponse(): QueryVoteByProposalVoterR }; } export const QueryVoteByProposalVoterResponse = { - encode(message: QueryVoteByProposalVoterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryVoteByProposalVoterResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.vote !== undefined) { Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVoteByProposalVoterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVoteByProposalVoterResponse(); while (reader.pos < end) { @@ -1199,9 +1197,7 @@ export const QueryVoteByProposalVoterResponse = { message.vote !== undefined && (obj.vote = message.vote ? Vote.toJSON(message.vote) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryVoteByProposalVoterResponse { + fromPartial(object: Partial): QueryVoteByProposalVoterResponse { const message = createBaseQueryVoteByProposalVoterResponse(); if (object.vote !== undefined && object.vote !== null) { message.vote = Vote.fromPartial(object.vote); @@ -1211,13 +1207,13 @@ export const QueryVoteByProposalVoterResponse = { }; function createBaseQueryVotesByProposalRequest(): QueryVotesByProposalRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryVotesByProposalRequest = { - encode(message: QueryVotesByProposalRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryVotesByProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.pagination !== undefined) { @@ -1225,15 +1221,15 @@ export const QueryVotesByProposalRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByProposalRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByProposalRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -1247,23 +1243,21 @@ export const QueryVotesByProposalRequest = { }, fromJSON(object: any): QueryVotesByProposalRequest { const obj = createBaseQueryVotesByProposalRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryVotesByProposalRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryVotesByProposalRequest { + fromPartial(object: Partial): QueryVotesByProposalRequest { const message = createBaseQueryVotesByProposalRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -1278,7 +1272,7 @@ function createBaseQueryVotesByProposalResponse(): QueryVotesByProposalResponse }; } export const QueryVotesByProposalResponse = { - encode(message: QueryVotesByProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVotesByProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1287,8 +1281,8 @@ export const QueryVotesByProposalResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByProposalResponse(); while (reader.pos < end) { @@ -1324,9 +1318,7 @@ export const QueryVotesByProposalResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryVotesByProposalResponse { + fromPartial(object: Partial): QueryVotesByProposalResponse { const message = createBaseQueryVotesByProposalResponse(); message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1342,7 +1334,7 @@ function createBaseQueryVotesByVoterRequest(): QueryVotesByVoterRequest { }; } export const QueryVotesByVoterRequest = { - encode(message: QueryVotesByVoterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVotesByVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.voter !== "") { writer.uint32(10).string(message.voter); } @@ -1351,8 +1343,8 @@ export const QueryVotesByVoterRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByVoterRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByVoterRequest(); while (reader.pos < end) { @@ -1384,9 +1376,7 @@ export const QueryVotesByVoterRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryVotesByVoterRequest { + fromPartial(object: Partial): QueryVotesByVoterRequest { const message = createBaseQueryVotesByVoterRequest(); message.voter = object.voter ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1402,7 +1392,7 @@ function createBaseQueryVotesByVoterResponse(): QueryVotesByVoterResponse { }; } export const QueryVotesByVoterResponse = { - encode(message: QueryVotesByVoterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryVotesByVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.votes) { Vote.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1411,8 +1401,8 @@ export const QueryVotesByVoterResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryVotesByVoterResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryVotesByVoterResponse(); while (reader.pos < end) { @@ -1448,9 +1438,7 @@ export const QueryVotesByVoterResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryVotesByVoterResponse { + fromPartial(object: Partial): QueryVotesByVoterResponse { const message = createBaseQueryVotesByVoterResponse(); message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1466,7 +1454,7 @@ function createBaseQueryGroupsByMemberRequest(): QueryGroupsByMemberRequest { }; } export const QueryGroupsByMemberRequest = { - encode(message: QueryGroupsByMemberRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupsByMemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -1475,8 +1463,8 @@ export const QueryGroupsByMemberRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByMemberRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByMemberRequest(); while (reader.pos < end) { @@ -1508,9 +1496,7 @@ export const QueryGroupsByMemberRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupsByMemberRequest { + fromPartial(object: Partial): QueryGroupsByMemberRequest { const message = createBaseQueryGroupsByMemberRequest(); message.address = object.address ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1526,7 +1512,7 @@ function createBaseQueryGroupsByMemberResponse(): QueryGroupsByMemberResponse { }; } export const QueryGroupsByMemberResponse = { - encode(message: QueryGroupsByMemberResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupsByMemberResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groups) { GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1535,8 +1521,8 @@ export const QueryGroupsByMemberResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsByMemberResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsByMemberResponse(); while (reader.pos < end) { @@ -1572,9 +1558,7 @@ export const QueryGroupsByMemberResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGroupsByMemberResponse { + fromPartial(object: Partial): QueryGroupsByMemberResponse { const message = createBaseQueryGroupsByMemberResponse(); message.groups = object.groups?.map((e) => GroupInfo.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1585,25 +1569,25 @@ export const QueryGroupsByMemberResponse = { }; function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const QueryTallyResultRequest = { - encode(message: QueryTallyResultRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1614,18 +1598,18 @@ export const QueryTallyResultRequest = { }, fromJSON(object: any): QueryTallyResultRequest { const obj = createBaseQueryTallyResultRequest(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: QueryTallyResultRequest): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryTallyResultRequest { + fromPartial(object: Partial): QueryTallyResultRequest { const message = createBaseQueryTallyResultRequest(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, @@ -1636,14 +1620,14 @@ function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { }; } export const QueryTallyResultResponse = { - encode(message: QueryTallyResultResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tally !== undefined) { TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTallyResultResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTallyResultResponse(); while (reader.pos < end) { @@ -1670,9 +1654,7 @@ export const QueryTallyResultResponse = { (obj.tally = message.tally ? TallyResult.toJSON(message.tally) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTallyResultResponse { + fromPartial(object: Partial): QueryTallyResultResponse { const message = createBaseQueryTallyResultResponse(); if (object.tally !== undefined && object.tally !== null) { message.tally = TallyResult.fromPartial(object.tally); @@ -1686,14 +1668,14 @@ function createBaseQueryGroupsRequest(): QueryGroupsRequest { }; } export const QueryGroupsRequest = { - encode(message: QueryGroupsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsRequest(); while (reader.pos < end) { @@ -1720,7 +1702,7 @@ export const QueryGroupsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryGroupsRequest { + fromPartial(object: Partial): QueryGroupsRequest { const message = createBaseQueryGroupsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -1735,7 +1717,7 @@ function createBaseQueryGroupsResponse(): QueryGroupsResponse { }; } export const QueryGroupsResponse = { - encode(message: QueryGroupsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryGroupsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.groups) { GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1744,8 +1726,8 @@ export const QueryGroupsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGroupsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryGroupsResponse(); while (reader.pos < end) { @@ -1781,7 +1763,7 @@ export const QueryGroupsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryGroupsResponse { + fromPartial(object: Partial): QueryGroupsResponse { const message = createBaseQueryGroupsResponse(); message.groups = object.groups?.map((e) => GroupInfo.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1855,73 +1837,73 @@ export class QueryClientImpl implements Query { GroupInfo(request: QueryGroupInfoRequest): Promise { const data = QueryGroupInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupInfo", data); - return promise.then((data) => QueryGroupInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupInfoResponse.decode(new BinaryReader(data))); } GroupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { const data = QueryGroupPolicyInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPolicyInfo", data); - return promise.then((data) => QueryGroupPolicyInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupPolicyInfoResponse.decode(new BinaryReader(data))); } GroupMembers(request: QueryGroupMembersRequest): Promise { const data = QueryGroupMembersRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupMembers", data); - return promise.then((data) => QueryGroupMembersResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupMembersResponse.decode(new BinaryReader(data))); } GroupsByAdmin(request: QueryGroupsByAdminRequest): Promise { const data = QueryGroupsByAdminRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByAdmin", data); - return promise.then((data) => QueryGroupsByAdminResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupsByAdminResponse.decode(new BinaryReader(data))); } GroupPoliciesByGroup( request: QueryGroupPoliciesByGroupRequest, ): Promise { const data = QueryGroupPoliciesByGroupRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByGroup", data); - return promise.then((data) => QueryGroupPoliciesByGroupResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupPoliciesByGroupResponse.decode(new BinaryReader(data))); } GroupPoliciesByAdmin( request: QueryGroupPoliciesByAdminRequest, ): Promise { const data = QueryGroupPoliciesByAdminRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByAdmin", data); - return promise.then((data) => QueryGroupPoliciesByAdminResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupPoliciesByAdminResponse.decode(new BinaryReader(data))); } Proposal(request: QueryProposalRequest): Promise { const data = QueryProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "Proposal", data); - return promise.then((data) => QueryProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryProposalResponse.decode(new BinaryReader(data))); } ProposalsByGroupPolicy( request: QueryProposalsByGroupPolicyRequest, ): Promise { const data = QueryProposalsByGroupPolicyRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "ProposalsByGroupPolicy", data); - return promise.then((data) => QueryProposalsByGroupPolicyResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryProposalsByGroupPolicyResponse.decode(new BinaryReader(data))); } VoteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { const data = QueryVoteByProposalVoterRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "VoteByProposalVoter", data); - return promise.then((data) => QueryVoteByProposalVoterResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVoteByProposalVoterResponse.decode(new BinaryReader(data))); } VotesByProposal(request: QueryVotesByProposalRequest): Promise { const data = QueryVotesByProposalRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByProposal", data); - return promise.then((data) => QueryVotesByProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVotesByProposalResponse.decode(new BinaryReader(data))); } VotesByVoter(request: QueryVotesByVoterRequest): Promise { const data = QueryVotesByVoterRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByVoter", data); - return promise.then((data) => QueryVotesByVoterResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryVotesByVoterResponse.decode(new BinaryReader(data))); } GroupsByMember(request: QueryGroupsByMemberRequest): Promise { const data = QueryGroupsByMemberRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByMember", data); - return promise.then((data) => QueryGroupsByMemberResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupsByMemberResponse.decode(new BinaryReader(data))); } TallyResult(request: QueryTallyResultRequest): Promise { const data = QueryTallyResultRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data); - return promise.then((data) => QueryTallyResultResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTallyResultResponse.decode(new BinaryReader(data))); } Groups( request: QueryGroupsRequest = { @@ -1930,6 +1912,6 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryGroupsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Query", "Groups", data); - return promise.then((data) => QueryGroupsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGroupsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/group/v1/tx.amino.ts b/src/cosmos/group/v1/tx.amino.ts new file mode 100644 index 0000000..2c6d354 --- /dev/null +++ b/src/cosmos/group/v1/tx.amino.ts @@ -0,0 +1,549 @@ +/* eslint-disable */ +import { voteOptionFromJSON } from "./types"; +import { AminoMsg } from "@cosmjs/amino"; +import { + execFromJSON, + MsgCreateGroup, + MsgUpdateGroupMembers, + MsgUpdateGroupAdmin, + MsgUpdateGroupMetadata, + MsgCreateGroupPolicy, + MsgCreateGroupWithPolicy, + MsgUpdateGroupPolicyAdmin, + MsgUpdateGroupPolicyDecisionPolicy, + MsgUpdateGroupPolicyMetadata, + MsgSubmitProposal, + MsgWithdrawProposal, + MsgVote, + MsgExec, + MsgLeaveGroup, +} from "./tx"; +export interface MsgCreateGroupAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreateGroup"; + value: { + admin: string; + members: { + address: string; + weight: string; + metadata: string; + }[]; + metadata: string; + }; +} +export interface MsgUpdateGroupMembersAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembers"; + value: { + admin: string; + group_id: string; + member_updates: { + address: string; + weight: string; + metadata: string; + }[]; + }; +} +export interface MsgUpdateGroupAdminAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdmin"; + value: { + admin: string; + group_id: string; + new_admin: string; + }; +} +export interface MsgUpdateGroupMetadataAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadata"; + value: { + admin: string; + group_id: string; + metadata: string; + }; +} +export interface MsgCreateGroupPolicyAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicy"; + value: { + admin: string; + group_id: string; + metadata: string; + decision_policy: { + type_url: string; + value: Uint8Array; + }; + }; +} +export interface MsgCreateGroupWithPolicyAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicy"; + value: { + admin: string; + members: { + address: string; + weight: string; + metadata: string; + }[]; + group_metadata: string; + group_policy_metadata: string; + group_policy_as_admin: boolean; + decision_policy: { + type_url: string; + value: Uint8Array; + }; + }; +} +export interface MsgUpdateGroupPolicyAdminAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + value: { + admin: string; + group_policy_address: string; + new_admin: string; + }; +} +export interface MsgUpdateGroupPolicyDecisionPolicyAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; + value: { + admin: string; + group_policy_address: string; + decision_policy: { + type_url: string; + value: Uint8Array; + }; + }; +} +export interface MsgUpdateGroupPolicyMetadataAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + value: { + admin: string; + group_policy_address: string; + metadata: string; + }; +} +export interface MsgSubmitProposalAminoType extends AminoMsg { + type: "cosmos-sdk/group/MsgSubmitProposal"; + value: { + group_policy_address: string; + proposers: string[]; + metadata: string; + messages: { + type_url: string; + value: Uint8Array; + }[]; + exec: number; + title: string; + summary: string; + }; +} +export interface MsgWithdrawProposalAminoType extends AminoMsg { + type: "cosmos-sdk/group/MsgWithdrawProposal"; + value: { + proposal_id: string; + address: string; + }; +} +export interface MsgVoteAminoType extends AminoMsg { + type: "cosmos-sdk/group/MsgVote"; + value: { + proposal_id: string; + voter: string; + option: number; + metadata: string; + exec: number; + }; +} +export interface MsgExecAminoType extends AminoMsg { + type: "cosmos-sdk/group/MsgExec"; + value: { + proposal_id: string; + executor: string; + }; +} +export interface MsgLeaveGroupAminoType extends AminoMsg { + type: "cosmos-sdk/group/MsgLeaveGroup"; + value: { + address: string; + group_id: string; + }; +} +export const AminoConverter = { + "/cosmos.group.v1.MsgCreateGroup": { + aminoType: "cosmos-sdk/MsgCreateGroup", + toAmino: ({ admin, members, metadata }: MsgCreateGroup): MsgCreateGroupAminoType["value"] => { + return { + admin, + members: members.map((el0) => ({ + address: el0.address, + weight: el0.weight, + metadata: el0.metadata, + })), + metadata, + }; + }, + fromAmino: ({ admin, members, metadata }: MsgCreateGroupAminoType["value"]): MsgCreateGroup => { + return { + admin, + members: members.map((el0) => ({ + address: el0.address, + weight: el0.weight, + metadata: el0.metadata, + })), + metadata, + }; + }, + }, + "/cosmos.group.v1.MsgUpdateGroupMembers": { + aminoType: "cosmos-sdk/MsgUpdateGroupMembers", + toAmino: ({ + admin, + groupId, + memberUpdates, + }: MsgUpdateGroupMembers): MsgUpdateGroupMembersAminoType["value"] => { + return { + admin, + group_id: groupId.toString(), + member_updates: memberUpdates.map((el0) => ({ + address: el0.address, + weight: el0.weight, + metadata: el0.metadata, + })), + }; + }, + fromAmino: ({ + admin, + group_id, + member_updates, + }: MsgUpdateGroupMembersAminoType["value"]): MsgUpdateGroupMembers => { + return { + admin, + groupId: BigInt(group_id), + memberUpdates: member_updates.map((el0) => ({ + address: el0.address, + weight: el0.weight, + metadata: el0.metadata, + })), + }; + }, + }, + "/cosmos.group.v1.MsgUpdateGroupAdmin": { + aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", + toAmino: ({ admin, groupId, newAdmin }: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAminoType["value"] => { + return { + admin, + group_id: groupId.toString(), + new_admin: newAdmin, + }; + }, + fromAmino: ({ + admin, + group_id, + new_admin, + }: MsgUpdateGroupAdminAminoType["value"]): MsgUpdateGroupAdmin => { + return { + admin, + groupId: BigInt(group_id), + newAdmin: new_admin, + }; + }, + }, + "/cosmos.group.v1.MsgUpdateGroupMetadata": { + aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", + toAmino: ({ + admin, + groupId, + metadata, + }: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAminoType["value"] => { + return { + admin, + group_id: groupId.toString(), + metadata, + }; + }, + fromAmino: ({ + admin, + group_id, + metadata, + }: MsgUpdateGroupMetadataAminoType["value"]): MsgUpdateGroupMetadata => { + return { + admin, + groupId: BigInt(group_id), + metadata, + }; + }, + }, + "/cosmos.group.v1.MsgCreateGroupPolicy": { + aminoType: "cosmos-sdk/MsgCreateGroupPolicy", + toAmino: ({ + admin, + groupId, + metadata, + decisionPolicy, + }: MsgCreateGroupPolicy): MsgCreateGroupPolicyAminoType["value"] => { + return { + admin, + group_id: groupId.toString(), + metadata, + decision_policy: { + type_url: decisionPolicy.typeUrl, + value: decisionPolicy.value, + }, + }; + }, + fromAmino: ({ + admin, + group_id, + metadata, + decision_policy, + }: MsgCreateGroupPolicyAminoType["value"]): MsgCreateGroupPolicy => { + return { + admin, + groupId: BigInt(group_id), + metadata, + decisionPolicy: { + typeUrl: decision_policy.type_url, + value: decision_policy.value, + }, + }; + }, + }, + "/cosmos.group.v1.MsgCreateGroupWithPolicy": { + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", + toAmino: ({ + admin, + members, + groupMetadata, + groupPolicyMetadata, + groupPolicyAsAdmin, + decisionPolicy, + }: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAminoType["value"] => { + return { + admin, + members: members.map((el0) => ({ + address: el0.address, + weight: el0.weight, + metadata: el0.metadata, + })), + group_metadata: groupMetadata, + group_policy_metadata: groupPolicyMetadata, + group_policy_as_admin: groupPolicyAsAdmin, + decision_policy: { + type_url: decisionPolicy.typeUrl, + value: decisionPolicy.value, + }, + }; + }, + fromAmino: ({ + admin, + members, + group_metadata, + group_policy_metadata, + group_policy_as_admin, + decision_policy, + }: MsgCreateGroupWithPolicyAminoType["value"]): MsgCreateGroupWithPolicy => { + return { + admin, + members: members.map((el0) => ({ + address: el0.address, + weight: el0.weight, + metadata: el0.metadata, + })), + groupMetadata: group_metadata, + groupPolicyMetadata: group_policy_metadata, + groupPolicyAsAdmin: group_policy_as_admin, + decisionPolicy: { + typeUrl: decision_policy.type_url, + value: decision_policy.value, + }, + }; + }, + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + toAmino: ({ + admin, + groupPolicyAddress, + newAdmin, + }: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAminoType["value"] => { + return { + admin, + group_policy_address: groupPolicyAddress, + new_admin: newAdmin, + }; + }, + fromAmino: ({ + admin, + group_policy_address, + new_admin, + }: MsgUpdateGroupPolicyAdminAminoType["value"]): MsgUpdateGroupPolicyAdmin => { + return { + admin, + groupPolicyAddress: group_policy_address, + newAdmin: new_admin, + }; + }, + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy": { + aminoType: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", + toAmino: ({ + admin, + groupPolicyAddress, + decisionPolicy, + }: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyAminoType["value"] => { + return { + admin, + group_policy_address: groupPolicyAddress, + decision_policy: { + type_url: decisionPolicy.typeUrl, + value: decisionPolicy.value, + }, + }; + }, + fromAmino: ({ + admin, + group_policy_address, + decision_policy, + }: MsgUpdateGroupPolicyDecisionPolicyAminoType["value"]): MsgUpdateGroupPolicyDecisionPolicy => { + return { + admin, + groupPolicyAddress: group_policy_address, + decisionPolicy: { + typeUrl: decision_policy.type_url, + value: decision_policy.value, + }, + }; + }, + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + toAmino: ({ + admin, + groupPolicyAddress, + metadata, + }: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataAminoType["value"] => { + return { + admin, + group_policy_address: groupPolicyAddress, + metadata, + }; + }, + fromAmino: ({ + admin, + group_policy_address, + metadata, + }: MsgUpdateGroupPolicyMetadataAminoType["value"]): MsgUpdateGroupPolicyMetadata => { + return { + admin, + groupPolicyAddress: group_policy_address, + metadata, + }; + }, + }, + "/cosmos.group.v1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/group/MsgSubmitProposal", + toAmino: ({ + groupPolicyAddress, + proposers, + metadata, + messages, + exec, + title, + summary, + }: MsgSubmitProposal): MsgSubmitProposalAminoType["value"] => { + return { + group_policy_address: groupPolicyAddress, + proposers, + metadata, + messages: messages.map((el0) => ({ + type_url: el0.typeUrl, + value: el0.value, + })), + exec, + title, + summary, + }; + }, + fromAmino: ({ + group_policy_address, + proposers, + metadata, + messages, + exec, + title, + summary, + }: MsgSubmitProposalAminoType["value"]): MsgSubmitProposal => { + return { + groupPolicyAddress: group_policy_address, + proposers, + metadata, + messages: messages.map((el0) => ({ + typeUrl: el0.type_url, + value: el0.value, + })), + exec: execFromJSON(exec), + title, + summary, + }; + }, + }, + "/cosmos.group.v1.MsgWithdrawProposal": { + aminoType: "cosmos-sdk/group/MsgWithdrawProposal", + toAmino: ({ proposalId, address }: MsgWithdrawProposal): MsgWithdrawProposalAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + address, + }; + }, + fromAmino: ({ proposal_id, address }: MsgWithdrawProposalAminoType["value"]): MsgWithdrawProposal => { + return { + proposalId: BigInt(proposal_id), + address, + }; + }, + }, + "/cosmos.group.v1.MsgVote": { + aminoType: "cosmos-sdk/group/MsgVote", + toAmino: ({ proposalId, voter, option, metadata, exec }: MsgVote): MsgVoteAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + voter, + option, + metadata, + exec, + }; + }, + fromAmino: ({ proposal_id, voter, option, metadata, exec }: MsgVoteAminoType["value"]): MsgVote => { + return { + proposalId: BigInt(proposal_id), + voter, + option: voteOptionFromJSON(option), + metadata, + exec: execFromJSON(exec), + }; + }, + }, + "/cosmos.group.v1.MsgExec": { + aminoType: "cosmos-sdk/group/MsgExec", + toAmino: ({ proposalId, executor }: MsgExec): MsgExecAminoType["value"] => { + return { + proposal_id: proposalId.toString(), + executor, + }; + }, + fromAmino: ({ proposal_id, executor }: MsgExecAminoType["value"]): MsgExec => { + return { + proposalId: BigInt(proposal_id), + executor, + }; + }, + }, + "/cosmos.group.v1.MsgLeaveGroup": { + aminoType: "cosmos-sdk/group/MsgLeaveGroup", + toAmino: ({ address, groupId }: MsgLeaveGroup): MsgLeaveGroupAminoType["value"] => { + return { + address, + group_id: groupId.toString(), + }; + }, + fromAmino: ({ address, group_id }: MsgLeaveGroupAminoType["value"]): MsgLeaveGroup => { + return { + address, + groupId: BigInt(group_id), + }; + }, + }, +}; diff --git a/src/cosmos/group/v1/tx.registry.ts b/src/cosmos/group/v1/tx.registry.ts new file mode 100644 index 0000000..63dbafb --- /dev/null +++ b/src/cosmos/group/v1/tx.registry.ts @@ -0,0 +1,472 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgCreateGroup, + MsgUpdateGroupMembers, + MsgUpdateGroupAdmin, + MsgUpdateGroupMetadata, + MsgCreateGroupPolicy, + MsgCreateGroupWithPolicy, + MsgUpdateGroupPolicyAdmin, + MsgUpdateGroupPolicyDecisionPolicy, + MsgUpdateGroupPolicyMetadata, + MsgSubmitProposal, + MsgWithdrawProposal, + MsgVote, + MsgExec, + MsgLeaveGroup, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.group.v1.MsgCreateGroup", MsgCreateGroup], + ["/cosmos.group.v1.MsgUpdateGroupMembers", MsgUpdateGroupMembers], + ["/cosmos.group.v1.MsgUpdateGroupAdmin", MsgUpdateGroupAdmin], + ["/cosmos.group.v1.MsgUpdateGroupMetadata", MsgUpdateGroupMetadata], + ["/cosmos.group.v1.MsgCreateGroupPolicy", MsgCreateGroupPolicy], + ["/cosmos.group.v1.MsgCreateGroupWithPolicy", MsgCreateGroupWithPolicy], + ["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin], + ["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", MsgUpdateGroupPolicyDecisionPolicy], + ["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata], + ["/cosmos.group.v1.MsgSubmitProposal", MsgSubmitProposal], + ["/cosmos.group.v1.MsgWithdrawProposal", MsgWithdrawProposal], + ["/cosmos.group.v1.MsgVote", MsgVote], + ["/cosmos.group.v1.MsgExec", MsgExec], + ["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.encode(value).finish(), + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.encode(value).finish(), + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.encode(value).finish(), + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.encode(value).finish(), + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.encode(value).finish(), + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.encode(value).finish(), + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.encode(value).finish(), + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.encode(value).finish(), + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.encode(value).finish(), + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish(), + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.encode(value).finish(), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.encode(value).finish(), + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.encode(value).finish(), + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value, + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value, + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value, + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value, + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value, + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value, + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value, + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value, + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value, + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value, + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value, + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value, + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value, + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value, + }; + }, + }, + toJSON: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.toJSON(value), + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.toJSON(value), + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.toJSON(value), + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.toJSON(value), + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.toJSON(value), + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.toJSON(value), + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.toJSON(value), + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.toJSON(value), + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.toJSON(value), + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.toJSON(value), + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.toJSON(value), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.toJSON(value), + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.toJSON(value), + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.toJSON(value), + }; + }, + }, + fromJSON: { + createGroup(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.fromJSON(value), + }; + }, + updateGroupMembers(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.fromJSON(value), + }; + }, + updateGroupAdmin(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.fromJSON(value), + }; + }, + updateGroupMetadata(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.fromJSON(value), + }; + }, + createGroupPolicy(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.fromJSON(value), + }; + }, + createGroupWithPolicy(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.fromJSON(value), + }; + }, + updateGroupPolicyAdmin(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.fromJSON(value), + }; + }, + updateGroupPolicyDecisionPolicy(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.fromJSON(value), + }; + }, + updateGroupPolicyMetadata(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.fromJSON(value), + }; + }, + submitProposal(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromJSON(value), + }; + }, + withdrawProposal(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.fromJSON(value), + }; + }, + vote(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.fromJSON(value), + }; + }, + exec(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.fromJSON(value), + }; + }, + leaveGroup(value: any) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.fromJSON(value), + }; + }, + }, + fromPartial: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.fromPartial(value), + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.fromPartial(value), + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.fromPartial(value), + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.fromPartial(value), + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.fromPartial(value), + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.fromPartial(value), + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.fromPartial(value), + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial(value), + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.fromPartial(value), + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value), + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.fromPartial(value), + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.fromPartial(value), + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.fromPartial(value), + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/group/v1/tx.ts b/src/cosmos/group/v1/tx.ts index 44a212f..6c761c8 100644 --- a/src/cosmos/group/v1/tx.ts +++ b/src/cosmos/group/v1/tx.ts @@ -9,8 +9,8 @@ import { proposalExecutorResultToJSON, } from "./types"; import { Any } from "../../../google/protobuf/any"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.group.v1"; /** Exec defines modes of execution of a proposal on creation or on new vote. */ export enum Exec { @@ -65,14 +65,14 @@ export interface MsgCreateGroup { /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ export interface MsgCreateGroupResponse { /** group_id is the unique ID of the newly created group. */ - groupId: Long; + groupId: bigint; } /** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ export interface MsgUpdateGroupMembers { /** admin is the account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** * member_updates is the list of members to update, * set weight to 0 to remove a member. @@ -86,7 +86,7 @@ export interface MsgUpdateGroupAdmin { /** admin is the current account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** new_admin is the group new admin account address. */ newAdmin: string; } @@ -97,7 +97,7 @@ export interface MsgUpdateGroupMetadata { /** admin is the account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** metadata is the updated group's metadata. */ metadata: string; } @@ -108,7 +108,7 @@ export interface MsgCreateGroupPolicy { /** admin is the account address of the group admin. */ admin: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** metadata is any arbitrary metadata attached to the group policy. */ metadata: string; /** decision_policy specifies the group policy's decision policy. */ @@ -151,7 +151,7 @@ export interface MsgCreateGroupWithPolicy { /** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ export interface MsgCreateGroupWithPolicyResponse { /** group_id is the unique ID of the newly created group with policy. */ - groupId: Long; + groupId: bigint; /** group_policy_address is the account address of the newly created group policy. */ groupPolicyAddress: string; } @@ -212,12 +212,12 @@ export interface MsgSubmitProposal { /** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { /** proposal is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; } /** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ export interface MsgWithdrawProposal { /** proposal is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** address is the admin of the group policy or one of the proposer of the proposal. */ address: string; } @@ -226,7 +226,7 @@ export interface MsgWithdrawProposalResponse {} /** MsgVote is the Msg/Vote request type. */ export interface MsgVote { /** proposal is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the voter account address. */ voter: string; /** option is the voter's choice on the proposal. */ @@ -244,7 +244,7 @@ export interface MsgVoteResponse {} /** MsgExec is the Msg/Exec request type. */ export interface MsgExec { /** proposal is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** executor is the account address used to execute the proposal. */ executor: string; } @@ -258,7 +258,7 @@ export interface MsgLeaveGroup { /** address is the account address of the group member. */ address: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; } /** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ export interface MsgLeaveGroupResponse {} @@ -270,7 +270,7 @@ function createBaseMsgCreateGroup(): MsgCreateGroup { }; } export const MsgCreateGroup = { - encode(message: MsgCreateGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -282,8 +282,8 @@ export const MsgCreateGroup = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroup(); while (reader.pos < end) { @@ -324,7 +324,7 @@ export const MsgCreateGroup = { message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>(object: I): MsgCreateGroup { + fromPartial(object: Partial): MsgCreateGroup { const message = createBaseMsgCreateGroup(); message.admin = object.admin ?? ""; message.members = object.members?.map((e) => MemberRequest.fromPartial(e)) || []; @@ -334,25 +334,25 @@ export const MsgCreateGroup = { }; function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { return { - groupId: Long.UZERO, + groupId: BigInt(0), }; } export const MsgCreateGroupResponse = { - encode(message: MsgCreateGroupResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: MsgCreateGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -363,18 +363,18 @@ export const MsgCreateGroupResponse = { }, fromJSON(object: any): MsgCreateGroupResponse { const obj = createBaseMsgCreateGroupResponse(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); return obj; }, toJSON(message: MsgCreateGroupResponse): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgCreateGroupResponse { + fromPartial(object: Partial): MsgCreateGroupResponse { const message = createBaseMsgCreateGroupResponse(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } return message; }, @@ -382,16 +382,16 @@ export const MsgCreateGroupResponse = { function createBaseMsgUpdateGroupMembers(): MsgUpdateGroupMembers { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), memberUpdates: [], }; } export const MsgUpdateGroupMembers = { - encode(message: MsgUpdateGroupMembers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateGroupMembers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } for (const v of message.memberUpdates) { @@ -399,8 +399,8 @@ export const MsgUpdateGroupMembers = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMembers { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMembers(); while (reader.pos < end) { @@ -410,7 +410,7 @@ export const MsgUpdateGroupMembers = { message.admin = reader.string(); break; case 2: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 3: message.memberUpdates.push(MemberRequest.decode(reader, reader.uint32())); @@ -425,7 +425,7 @@ export const MsgUpdateGroupMembers = { fromJSON(object: any): MsgUpdateGroupMembers { const obj = createBaseMsgUpdateGroupMembers(); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (Array.isArray(object?.memberUpdates)) obj.memberUpdates = object.memberUpdates.map((e: any) => MemberRequest.fromJSON(e)); return obj; @@ -433,7 +433,7 @@ export const MsgUpdateGroupMembers = { toJSON(message: MsgUpdateGroupMembers): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); if (message.memberUpdates) { obj.memberUpdates = message.memberUpdates.map((e) => (e ? MemberRequest.toJSON(e) : undefined)); } else { @@ -441,11 +441,11 @@ export const MsgUpdateGroupMembers = { } return obj; }, - fromPartial, I>>(object: I): MsgUpdateGroupMembers { + fromPartial(object: Partial): MsgUpdateGroupMembers { const message = createBaseMsgUpdateGroupMembers(); message.admin = object.admin ?? ""; if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.memberUpdates = object.memberUpdates?.map((e) => MemberRequest.fromPartial(e)) || []; return message; @@ -455,11 +455,11 @@ function createBaseMsgUpdateGroupMembersResponse(): MsgUpdateGroupMembersRespons return {}; } export const MsgUpdateGroupMembersResponse = { - encode(_: MsgUpdateGroupMembersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMembersResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMembersResponse(); while (reader.pos < end) { @@ -480,9 +480,7 @@ export const MsgUpdateGroupMembersResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgUpdateGroupMembersResponse { + fromPartial(_: Partial): MsgUpdateGroupMembersResponse { const message = createBaseMsgUpdateGroupMembersResponse(); return message; }, @@ -490,16 +488,16 @@ export const MsgUpdateGroupMembersResponse = { function createBaseMsgUpdateGroupAdmin(): MsgUpdateGroupAdmin { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), newAdmin: "", }; } export const MsgUpdateGroupAdmin = { - encode(message: MsgUpdateGroupAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateGroupAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.newAdmin !== "") { @@ -507,8 +505,8 @@ export const MsgUpdateGroupAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupAdmin(); while (reader.pos < end) { @@ -518,7 +516,7 @@ export const MsgUpdateGroupAdmin = { message.admin = reader.string(); break; case 2: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 3: message.newAdmin = reader.string(); @@ -533,22 +531,22 @@ export const MsgUpdateGroupAdmin = { fromJSON(object: any): MsgUpdateGroupAdmin { const obj = createBaseMsgUpdateGroupAdmin(); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.newAdmin)) obj.newAdmin = String(object.newAdmin); return obj; }, toJSON(message: MsgUpdateGroupAdmin): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); return obj; }, - fromPartial, I>>(object: I): MsgUpdateGroupAdmin { + fromPartial(object: Partial): MsgUpdateGroupAdmin { const message = createBaseMsgUpdateGroupAdmin(); message.admin = object.admin ?? ""; if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.newAdmin = object.newAdmin ?? ""; return message; @@ -558,11 +556,11 @@ function createBaseMsgUpdateGroupAdminResponse(): MsgUpdateGroupAdminResponse { return {}; } export const MsgUpdateGroupAdminResponse = { - encode(_: MsgUpdateGroupAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateGroupAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupAdminResponse(); while (reader.pos < end) { @@ -583,9 +581,7 @@ export const MsgUpdateGroupAdminResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgUpdateGroupAdminResponse { + fromPartial(_: Partial): MsgUpdateGroupAdminResponse { const message = createBaseMsgUpdateGroupAdminResponse(); return message; }, @@ -593,16 +589,16 @@ export const MsgUpdateGroupAdminResponse = { function createBaseMsgUpdateGroupMetadata(): MsgUpdateGroupMetadata { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), metadata: "", }; } export const MsgUpdateGroupMetadata = { - encode(message: MsgUpdateGroupMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateGroupMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.metadata !== "") { @@ -610,8 +606,8 @@ export const MsgUpdateGroupMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMetadata(); while (reader.pos < end) { @@ -621,7 +617,7 @@ export const MsgUpdateGroupMetadata = { message.admin = reader.string(); break; case 2: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 3: message.metadata = reader.string(); @@ -636,22 +632,22 @@ export const MsgUpdateGroupMetadata = { fromJSON(object: any): MsgUpdateGroupMetadata { const obj = createBaseMsgUpdateGroupMetadata(); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.metadata)) obj.metadata = String(object.metadata); return obj; }, toJSON(message: MsgUpdateGroupMetadata): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>(object: I): MsgUpdateGroupMetadata { + fromPartial(object: Partial): MsgUpdateGroupMetadata { const message = createBaseMsgUpdateGroupMetadata(); message.admin = object.admin ?? ""; if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.metadata = object.metadata ?? ""; return message; @@ -661,11 +657,11 @@ function createBaseMsgUpdateGroupMetadataResponse(): MsgUpdateGroupMetadataRespo return {}; } export const MsgUpdateGroupMetadataResponse = { - encode(_: MsgUpdateGroupMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateGroupMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupMetadataResponse(); while (reader.pos < end) { @@ -686,9 +682,7 @@ export const MsgUpdateGroupMetadataResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgUpdateGroupMetadataResponse { + fromPartial(_: Partial): MsgUpdateGroupMetadataResponse { const message = createBaseMsgUpdateGroupMetadataResponse(); return message; }, @@ -696,17 +690,17 @@ export const MsgUpdateGroupMetadataResponse = { function createBaseMsgCreateGroupPolicy(): MsgCreateGroupPolicy { return { admin: "", - groupId: Long.UZERO, + groupId: BigInt(0), metadata: "", decisionPolicy: Any.fromPartial({}), }; } export const MsgCreateGroupPolicy = { - encode(message: MsgCreateGroupPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.metadata !== "") { @@ -717,8 +711,8 @@ export const MsgCreateGroupPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupPolicy(); while (reader.pos < end) { @@ -728,7 +722,7 @@ export const MsgCreateGroupPolicy = { message.admin = reader.string(); break; case 2: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 3: message.metadata = reader.string(); @@ -746,7 +740,7 @@ export const MsgCreateGroupPolicy = { fromJSON(object: any): MsgCreateGroupPolicy { const obj = createBaseMsgCreateGroupPolicy(); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.metadata)) obj.metadata = String(object.metadata); if (isSet(object.decisionPolicy)) obj.decisionPolicy = Any.fromJSON(object.decisionPolicy); return obj; @@ -754,17 +748,17 @@ export const MsgCreateGroupPolicy = { toJSON(message: MsgCreateGroupPolicy): unknown { const obj: any = {}; message.admin !== undefined && (obj.admin = message.admin); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.metadata !== undefined && (obj.metadata = message.metadata); message.decisionPolicy !== undefined && (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgCreateGroupPolicy { + fromPartial(object: Partial): MsgCreateGroupPolicy { const message = createBaseMsgCreateGroupPolicy(); message.admin = object.admin ?? ""; if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.metadata = object.metadata ?? ""; if (object.decisionPolicy !== undefined && object.decisionPolicy !== null) { @@ -779,14 +773,14 @@ function createBaseMsgCreateGroupPolicyResponse(): MsgCreateGroupPolicyResponse }; } export const MsgCreateGroupPolicyResponse = { - encode(message: MsgCreateGroupPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupPolicyResponse(); while (reader.pos < end) { @@ -812,9 +806,7 @@ export const MsgCreateGroupPolicyResponse = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>( - object: I, - ): MsgCreateGroupPolicyResponse { + fromPartial(object: Partial): MsgCreateGroupPolicyResponse { const message = createBaseMsgCreateGroupPolicyResponse(); message.address = object.address ?? ""; return message; @@ -828,7 +820,7 @@ function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { }; } export const MsgUpdateGroupPolicyAdmin = { - encode(message: MsgUpdateGroupPolicyAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateGroupPolicyAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -840,8 +832,8 @@ export const MsgUpdateGroupPolicyAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyAdmin(); while (reader.pos < end) { @@ -877,9 +869,7 @@ export const MsgUpdateGroupPolicyAdmin = { message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); return obj; }, - fromPartial, I>>( - object: I, - ): MsgUpdateGroupPolicyAdmin { + fromPartial(object: Partial): MsgUpdateGroupPolicyAdmin { const message = createBaseMsgUpdateGroupPolicyAdmin(); message.admin = object.admin ?? ""; message.groupPolicyAddress = object.groupPolicyAddress ?? ""; @@ -891,11 +881,11 @@ function createBaseMsgUpdateGroupPolicyAdminResponse(): MsgUpdateGroupPolicyAdmi return {}; } export const MsgUpdateGroupPolicyAdminResponse = { - encode(_: MsgUpdateGroupPolicyAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateGroupPolicyAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyAdminResponse(); while (reader.pos < end) { @@ -916,9 +906,7 @@ export const MsgUpdateGroupPolicyAdminResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgUpdateGroupPolicyAdminResponse { + fromPartial(_: Partial): MsgUpdateGroupPolicyAdminResponse { const message = createBaseMsgUpdateGroupPolicyAdminResponse(); return message; }, @@ -934,7 +922,7 @@ function createBaseMsgCreateGroupWithPolicy(): MsgCreateGroupWithPolicy { }; } export const MsgCreateGroupWithPolicy = { - encode(message: MsgCreateGroupWithPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateGroupWithPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -955,8 +943,8 @@ export const MsgCreateGroupWithPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupWithPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupWithPolicy(); while (reader.pos < end) { @@ -1013,9 +1001,7 @@ export const MsgCreateGroupWithPolicy = { (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): MsgCreateGroupWithPolicy { + fromPartial(object: Partial): MsgCreateGroupWithPolicy { const message = createBaseMsgCreateGroupWithPolicy(); message.admin = object.admin ?? ""; message.members = object.members?.map((e) => MemberRequest.fromPartial(e)) || []; @@ -1030,13 +1016,16 @@ export const MsgCreateGroupWithPolicy = { }; function createBaseMsgCreateGroupWithPolicyResponse(): MsgCreateGroupWithPolicyResponse { return { - groupId: Long.UZERO, + groupId: BigInt(0), groupPolicyAddress: "", }; } export const MsgCreateGroupWithPolicyResponse = { - encode(message: MsgCreateGroupWithPolicyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode( + message: MsgCreateGroupWithPolicyResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.groupPolicyAddress !== "") { @@ -1044,15 +1033,15 @@ export const MsgCreateGroupWithPolicyResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateGroupWithPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateGroupWithPolicyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 2: message.groupPolicyAddress = reader.string(); @@ -1066,22 +1055,20 @@ export const MsgCreateGroupWithPolicyResponse = { }, fromJSON(object: any): MsgCreateGroupWithPolicyResponse { const obj = createBaseMsgCreateGroupWithPolicyResponse(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.groupPolicyAddress)) obj.groupPolicyAddress = String(object.groupPolicyAddress); return obj; }, toJSON(message: MsgCreateGroupWithPolicyResponse): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.groupPolicyAddress !== undefined && (obj.groupPolicyAddress = message.groupPolicyAddress); return obj; }, - fromPartial, I>>( - object: I, - ): MsgCreateGroupWithPolicyResponse { + fromPartial(object: Partial): MsgCreateGroupWithPolicyResponse { const message = createBaseMsgCreateGroupWithPolicyResponse(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.groupPolicyAddress = object.groupPolicyAddress ?? ""; return message; @@ -1095,7 +1082,10 @@ function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDec }; } export const MsgUpdateGroupPolicyDecisionPolicy = { - encode(message: MsgUpdateGroupPolicyDecisionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgUpdateGroupPolicyDecisionPolicy, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1107,8 +1097,8 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); while (reader.pos < end) { @@ -1145,9 +1135,7 @@ export const MsgUpdateGroupPolicyDecisionPolicy = { (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): MsgUpdateGroupPolicyDecisionPolicy { + fromPartial(object: Partial): MsgUpdateGroupPolicyDecisionPolicy { const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); message.admin = object.admin ?? ""; message.groupPolicyAddress = object.groupPolicyAddress ?? ""; @@ -1163,12 +1151,12 @@ function createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(): MsgUpdateGroupP export const MsgUpdateGroupPolicyDecisionPolicyResponse = { encode( _: MsgUpdateGroupPolicyDecisionPolicyResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); while (reader.pos < end) { @@ -1189,8 +1177,8 @@ export const MsgUpdateGroupPolicyDecisionPolicyResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, + fromPartial( + _: Partial, ): MsgUpdateGroupPolicyDecisionPolicyResponse { const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); return message; @@ -1204,7 +1192,7 @@ function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata }; } export const MsgUpdateGroupPolicyMetadata = { - encode(message: MsgUpdateGroupPolicyMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateGroupPolicyMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.admin !== "") { writer.uint32(10).string(message.admin); } @@ -1216,8 +1204,8 @@ export const MsgUpdateGroupPolicyMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyMetadata(); while (reader.pos < end) { @@ -1253,9 +1241,7 @@ export const MsgUpdateGroupPolicyMetadata = { message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>( - object: I, - ): MsgUpdateGroupPolicyMetadata { + fromPartial(object: Partial): MsgUpdateGroupPolicyMetadata { const message = createBaseMsgUpdateGroupPolicyMetadata(); message.admin = object.admin ?? ""; message.groupPolicyAddress = object.groupPolicyAddress ?? ""; @@ -1267,11 +1253,14 @@ function createBaseMsgUpdateGroupPolicyMetadataResponse(): MsgUpdateGroupPolicyM return {}; } export const MsgUpdateGroupPolicyMetadataResponse = { - encode(_: MsgUpdateGroupPolicyMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: MsgUpdateGroupPolicyMetadataResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadataResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); while (reader.pos < end) { @@ -1292,9 +1281,7 @@ export const MsgUpdateGroupPolicyMetadataResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgUpdateGroupPolicyMetadataResponse { + fromPartial(_: Partial): MsgUpdateGroupPolicyMetadataResponse { const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); return message; }, @@ -1311,7 +1298,7 @@ function createBaseMsgSubmitProposal(): MsgSubmitProposal { }; } export const MsgSubmitProposal = { - encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.groupPolicyAddress !== "") { writer.uint32(10).string(message.groupPolicyAddress); } @@ -1335,8 +1322,8 @@ export const MsgSubmitProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposal(); while (reader.pos < end) { @@ -1400,7 +1387,7 @@ export const MsgSubmitProposal = { message.summary !== undefined && (obj.summary = message.summary); return obj; }, - fromPartial, I>>(object: I): MsgSubmitProposal { + fromPartial(object: Partial): MsgSubmitProposal { const message = createBaseMsgSubmitProposal(); message.groupPolicyAddress = object.groupPolicyAddress ?? ""; message.proposers = object.proposers?.map((e) => e) || []; @@ -1414,25 +1401,25 @@ export const MsgSubmitProposal = { }; function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), }; } export const MsgSubmitProposalResponse = { - encode(message: MsgSubmitProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitProposalResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1443,33 +1430,31 @@ export const MsgSubmitProposalResponse = { }, fromJSON(object: any): MsgSubmitProposalResponse { const obj = createBaseMsgSubmitProposalResponse(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); return obj; }, toJSON(message: MsgSubmitProposalResponse): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgSubmitProposalResponse { + fromPartial(object: Partial): MsgSubmitProposalResponse { const message = createBaseMsgSubmitProposalResponse(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } return message; }, }; function createBaseMsgWithdrawProposal(): MsgWithdrawProposal { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), address: "", }; } export const MsgWithdrawProposal = { - encode(message: MsgWithdrawProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.address !== "") { @@ -1477,15 +1462,15 @@ export const MsgWithdrawProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.address = reader.string(); @@ -1499,20 +1484,20 @@ export const MsgWithdrawProposal = { }, fromJSON(object: any): MsgWithdrawProposal { const obj = createBaseMsgWithdrawProposal(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.address)) obj.address = String(object.address); return obj; }, toJSON(message: MsgWithdrawProposal): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): MsgWithdrawProposal { + fromPartial(object: Partial): MsgWithdrawProposal { const message = createBaseMsgWithdrawProposal(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.address = object.address ?? ""; return message; @@ -1522,11 +1507,11 @@ function createBaseMsgWithdrawProposalResponse(): MsgWithdrawProposalResponse { return {}; } export const MsgWithdrawProposalResponse = { - encode(_: MsgWithdrawProposalResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgWithdrawProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdrawProposalResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgWithdrawProposalResponse(); while (reader.pos < end) { @@ -1547,16 +1532,14 @@ export const MsgWithdrawProposalResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgWithdrawProposalResponse { + fromPartial(_: Partial): MsgWithdrawProposalResponse { const message = createBaseMsgWithdrawProposalResponse(); return message; }, }; function createBaseMsgVote(): MsgVote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, metadata: "", @@ -1564,8 +1547,8 @@ function createBaseMsgVote(): MsgVote { }; } export const MsgVote = { - encode(message: MsgVote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -1582,15 +1565,15 @@ export const MsgVote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -1613,7 +1596,7 @@ export const MsgVote = { }, fromJSON(object: any): MsgVote { const obj = createBaseMsgVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (isSet(object.option)) obj.option = voteOptionFromJSON(object.option); if (isSet(object.metadata)) obj.metadata = String(object.metadata); @@ -1622,17 +1605,17 @@ export const MsgVote = { }, toJSON(message: MsgVote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.metadata !== undefined && (obj.metadata = message.metadata); message.exec !== undefined && (obj.exec = execToJSON(message.exec)); return obj; }, - fromPartial, I>>(object: I): MsgVote { + fromPartial(object: Partial): MsgVote { const message = createBaseMsgVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.option = object.option ?? 0; @@ -1645,11 +1628,11 @@ function createBaseMsgVoteResponse(): MsgVoteResponse { return {}; } export const MsgVoteResponse = { - encode(_: MsgVoteResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgVoteResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgVoteResponse(); while (reader.pos < end) { @@ -1670,20 +1653,20 @@ export const MsgVoteResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgVoteResponse { + fromPartial(_: Partial): MsgVoteResponse { const message = createBaseMsgVoteResponse(); return message; }, }; function createBaseMsgExec(): MsgExec { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), executor: "", }; } export const MsgExec = { - encode(message: MsgExec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.executor !== "") { @@ -1691,15 +1674,15 @@ export const MsgExec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExec(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.executor = reader.string(); @@ -1713,20 +1696,20 @@ export const MsgExec = { }, fromJSON(object: any): MsgExec { const obj = createBaseMsgExec(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.executor)) obj.executor = String(object.executor); return obj; }, toJSON(message: MsgExec): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.executor !== undefined && (obj.executor = message.executor); return obj; }, - fromPartial, I>>(object: I): MsgExec { + fromPartial(object: Partial): MsgExec { const message = createBaseMsgExec(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.executor = object.executor ?? ""; return message; @@ -1738,14 +1721,14 @@ function createBaseMsgExecResponse(): MsgExecResponse { }; } export const MsgExecResponse = { - encode(message: MsgExecResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(16).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecResponse(); while (reader.pos < end) { @@ -1771,7 +1754,7 @@ export const MsgExecResponse = { message.result !== undefined && (obj.result = proposalExecutorResultToJSON(message.result)); return obj; }, - fromPartial, I>>(object: I): MsgExecResponse { + fromPartial(object: Partial): MsgExecResponse { const message = createBaseMsgExecResponse(); message.result = object.result ?? 0; return message; @@ -1780,21 +1763,21 @@ export const MsgExecResponse = { function createBaseMsgLeaveGroup(): MsgLeaveGroup { return { address: "", - groupId: Long.UZERO, + groupId: BigInt(0), }; } export const MsgLeaveGroup = { - encode(message: MsgLeaveGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLeaveGroup { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLeaveGroup(); while (reader.pos < end) { @@ -1804,7 +1787,7 @@ export const MsgLeaveGroup = { message.address = reader.string(); break; case 2: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1816,20 +1799,20 @@ export const MsgLeaveGroup = { fromJSON(object: any): MsgLeaveGroup { const obj = createBaseMsgLeaveGroup(); if (isSet(object.address)) obj.address = String(object.address); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); return obj; }, toJSON(message: MsgLeaveGroup): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgLeaveGroup { + fromPartial(object: Partial): MsgLeaveGroup { const message = createBaseMsgLeaveGroup(); message.address = object.address ?? ""; if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } return message; }, @@ -1838,11 +1821,11 @@ function createBaseMsgLeaveGroupResponse(): MsgLeaveGroupResponse { return {}; } export const MsgLeaveGroupResponse = { - encode(_: MsgLeaveGroupResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgLeaveGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLeaveGroupResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLeaveGroupResponse(); while (reader.pos < end) { @@ -1863,7 +1846,7 @@ export const MsgLeaveGroupResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgLeaveGroupResponse { + fromPartial(_: Partial): MsgLeaveGroupResponse { const message = createBaseMsgLeaveGroupResponse(); return message; }, @@ -1925,75 +1908,75 @@ export class MsgClientImpl implements Msg { CreateGroup(request: MsgCreateGroup): Promise { const data = MsgCreateGroup.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroup", data); - return promise.then((data) => MsgCreateGroupResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreateGroupResponse.decode(new BinaryReader(data))); } UpdateGroupMembers(request: MsgUpdateGroupMembers): Promise { const data = MsgUpdateGroupMembers.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMembers", data); - return promise.then((data) => MsgUpdateGroupMembersResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateGroupMembersResponse.decode(new BinaryReader(data))); } UpdateGroupAdmin(request: MsgUpdateGroupAdmin): Promise { const data = MsgUpdateGroupAdmin.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupAdmin", data); - return promise.then((data) => MsgUpdateGroupAdminResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateGroupAdminResponse.decode(new BinaryReader(data))); } UpdateGroupMetadata(request: MsgUpdateGroupMetadata): Promise { const data = MsgUpdateGroupMetadata.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMetadata", data); - return promise.then((data) => MsgUpdateGroupMetadataResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data))); } CreateGroupPolicy(request: MsgCreateGroupPolicy): Promise { const data = MsgCreateGroupPolicy.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupPolicy", data); - return promise.then((data) => MsgCreateGroupPolicyResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreateGroupPolicyResponse.decode(new BinaryReader(data))); } CreateGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise { const data = MsgCreateGroupWithPolicy.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupWithPolicy", data); - return promise.then((data) => MsgCreateGroupWithPolicyResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data))); } UpdateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise { const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyAdmin", data); - return promise.then((data) => MsgUpdateGroupPolicyAdminResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data))); } UpdateGroupPolicyDecisionPolicy( request: MsgUpdateGroupPolicyDecisionPolicy, ): Promise { const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyDecisionPolicy", data); - return promise.then((data) => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data))); } UpdateGroupPolicyMetadata( request: MsgUpdateGroupPolicyMetadata, ): Promise { const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyMetadata", data); - return promise.then((data) => MsgUpdateGroupPolicyMetadataResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data))); } SubmitProposal(request: MsgSubmitProposal): Promise { const data = MsgSubmitProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "SubmitProposal", data); - return promise.then((data) => MsgSubmitProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSubmitProposalResponse.decode(new BinaryReader(data))); } WithdrawProposal(request: MsgWithdrawProposal): Promise { const data = MsgWithdrawProposal.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "WithdrawProposal", data); - return promise.then((data) => MsgWithdrawProposalResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgWithdrawProposalResponse.decode(new BinaryReader(data))); } Vote(request: MsgVote): Promise { const data = MsgVote.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "Vote", data); - return promise.then((data) => MsgVoteResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgVoteResponse.decode(new BinaryReader(data))); } Exec(request: MsgExec): Promise { const data = MsgExec.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "Exec", data); - return promise.then((data) => MsgExecResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgExecResponse.decode(new BinaryReader(data))); } LeaveGroup(request: MsgLeaveGroup): Promise { const data = MsgLeaveGroup.encode(request).finish(); const promise = this.rpc.request("cosmos.group.v1.Msg", "LeaveGroup", data); - return promise.then((data) => MsgLeaveGroupResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgLeaveGroupResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/group/v1/types.ts b/src/cosmos/group/v1/types.ts index c0499b8..0b4e5da 100644 --- a/src/cosmos/group/v1/types.ts +++ b/src/cosmos/group/v1/types.ts @@ -2,8 +2,8 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration } from "../../../google/protobuf/duration"; import { Any } from "../../../google/protobuf/any"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.group.v1"; /** VoteOption enumerates the valid vote options for a given proposal. */ export enum VoteOption { @@ -268,7 +268,7 @@ export interface DecisionPolicyWindows { /** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfo { /** id is the unique ID of the group. */ - id: Long; + id: bigint; /** admin is the account address of the group's admin. */ admin: string; /** metadata is any arbitrary metadata to attached to the group. */ @@ -279,7 +279,7 @@ export interface GroupInfo { * or any member is added or removed this version is incremented and will * cause proposals based on older versions of this group to fail */ - version: Long; + version: bigint; /** total_weight is the sum of the group members' weights. */ totalWeight: string; /** created_at is a timestamp specifying when a group was created. */ @@ -288,7 +288,7 @@ export interface GroupInfo { /** GroupMember represents the relationship between a group and a member. */ export interface GroupMember { /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** member is the member data. */ member: Member; } @@ -297,7 +297,7 @@ export interface GroupPolicyInfo { /** address is the account address of group policy. */ address: string; /** group_id is the unique ID of the group. */ - groupId: Long; + groupId: bigint; /** admin is the account address of the group admin. */ admin: string; /** @@ -310,7 +310,7 @@ export interface GroupPolicyInfo { * version is used to track changes to a group's GroupPolicyInfo structure that * would create a different result on a running proposal. */ - version: Long; + version: bigint; /** decision_policy specifies the group policy's decision policy. */ decisionPolicy: Any; /** created_at is a timestamp specifying when a group policy was created. */ @@ -324,7 +324,7 @@ export interface GroupPolicyInfo { */ export interface Proposal { /** id is the unique id of the proposal. */ - id: Long; + id: bigint; /** group_policy_address is the account address of group policy. */ groupPolicyAddress: string; /** @@ -341,14 +341,14 @@ export interface Proposal { * group_version tracks the version of the group at proposal submission. * This field is here for informational purposes only. */ - groupVersion: Long; + groupVersion: bigint; /** * group_policy_version tracks the version of the group policy at proposal submission. * When a decision policy is changed, existing proposals from previous policy * versions will become invalid with the `ABORTED` status. * This field is here for informational purposes only. */ - groupPolicyVersion: Long; + groupPolicyVersion: bigint; /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ status: ProposalStatus; /** @@ -397,7 +397,7 @@ export interface TallyResult { /** Vote represents a vote for a proposal. */ export interface Vote { /** proposal is the unique ID of the proposal. */ - proposalId: Long; + proposalId: bigint; /** voter is the account address of the voter. */ voter: string; /** option is the voter's choice on the proposal. */ @@ -416,7 +416,7 @@ function createBaseMember(): Member { }; } export const Member = { - encode(message: Member, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Member, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -431,8 +431,8 @@ export const Member = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Member { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Member { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMember(); while (reader.pos < end) { @@ -473,7 +473,7 @@ export const Member = { message.addedAt !== undefined && (obj.addedAt = fromTimestamp(message.addedAt).toISOString()); return obj; }, - fromPartial, I>>(object: I): Member { + fromPartial(object: Partial): Member { const message = createBaseMember(); message.address = object.address ?? ""; message.weight = object.weight ?? ""; @@ -492,7 +492,7 @@ function createBaseMemberRequest(): MemberRequest { }; } export const MemberRequest = { - encode(message: MemberRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -504,8 +504,8 @@ export const MemberRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MemberRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMemberRequest(); while (reader.pos < end) { @@ -541,7 +541,7 @@ export const MemberRequest = { message.metadata !== undefined && (obj.metadata = message.metadata); return obj; }, - fromPartial, I>>(object: I): MemberRequest { + fromPartial(object: Partial): MemberRequest { const message = createBaseMemberRequest(); message.address = object.address ?? ""; message.weight = object.weight ?? ""; @@ -556,7 +556,7 @@ function createBaseThresholdDecisionPolicy(): ThresholdDecisionPolicy { }; } export const ThresholdDecisionPolicy = { - encode(message: ThresholdDecisionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ThresholdDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.threshold !== "") { writer.uint32(10).string(message.threshold); } @@ -565,8 +565,8 @@ export const ThresholdDecisionPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ThresholdDecisionPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ThresholdDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseThresholdDecisionPolicy(); while (reader.pos < end) { @@ -598,7 +598,7 @@ export const ThresholdDecisionPolicy = { (obj.windows = message.windows ? DecisionPolicyWindows.toJSON(message.windows) : undefined); return obj; }, - fromPartial, I>>(object: I): ThresholdDecisionPolicy { + fromPartial(object: Partial): ThresholdDecisionPolicy { const message = createBaseThresholdDecisionPolicy(); message.threshold = object.threshold ?? ""; if (object.windows !== undefined && object.windows !== null) { @@ -614,7 +614,7 @@ function createBasePercentageDecisionPolicy(): PercentageDecisionPolicy { }; } export const PercentageDecisionPolicy = { - encode(message: PercentageDecisionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PercentageDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.percentage !== "") { writer.uint32(10).string(message.percentage); } @@ -623,8 +623,8 @@ export const PercentageDecisionPolicy = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PercentageDecisionPolicy { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PercentageDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePercentageDecisionPolicy(); while (reader.pos < end) { @@ -656,9 +656,7 @@ export const PercentageDecisionPolicy = { (obj.windows = message.windows ? DecisionPolicyWindows.toJSON(message.windows) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): PercentageDecisionPolicy { + fromPartial(object: Partial): PercentageDecisionPolicy { const message = createBasePercentageDecisionPolicy(); message.percentage = object.percentage ?? ""; if (object.windows !== undefined && object.windows !== null) { @@ -674,7 +672,7 @@ function createBaseDecisionPolicyWindows(): DecisionPolicyWindows { }; } export const DecisionPolicyWindows = { - encode(message: DecisionPolicyWindows, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DecisionPolicyWindows, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.votingPeriod !== undefined) { Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); } @@ -683,8 +681,8 @@ export const DecisionPolicyWindows = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DecisionPolicyWindows { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DecisionPolicyWindows { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDecisionPolicyWindows(); while (reader.pos < end) { @@ -720,7 +718,7 @@ export const DecisionPolicyWindows = { : undefined); return obj; }, - fromPartial, I>>(object: I): DecisionPolicyWindows { + fromPartial(object: Partial): DecisionPolicyWindows { const message = createBaseDecisionPolicyWindows(); if (object.votingPeriod !== undefined && object.votingPeriod !== null) { message.votingPeriod = Duration.fromPartial(object.votingPeriod); @@ -733,17 +731,17 @@ export const DecisionPolicyWindows = { }; function createBaseGroupInfo(): GroupInfo { return { - id: Long.UZERO, + id: BigInt(0), admin: "", metadata: "", - version: Long.UZERO, + version: BigInt(0), totalWeight: "", createdAt: Timestamp.fromPartial({}), }; } export const GroupInfo = { - encode(message: GroupInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + encode(message: GroupInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.admin !== "") { @@ -752,7 +750,7 @@ export const GroupInfo = { if (message.metadata !== "") { writer.uint32(26).string(message.metadata); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(32).uint64(message.version); } if (message.totalWeight !== "") { @@ -763,15 +761,15 @@ export const GroupInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GroupInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GroupInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; + message.id = reader.uint64(); break; case 2: message.admin = reader.string(); @@ -780,7 +778,7 @@ export const GroupInfo = { message.metadata = reader.string(); break; case 4: - message.version = reader.uint64() as Long; + message.version = reader.uint64(); break; case 5: message.totalWeight = reader.string(); @@ -797,33 +795,33 @@ export const GroupInfo = { }, fromJSON(object: any): GroupInfo { const obj = createBaseGroupInfo(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); if (isSet(object.admin)) obj.admin = String(object.admin); if (isSet(object.metadata)) obj.metadata = String(object.metadata); - if (isSet(object.version)) obj.version = Long.fromValue(object.version); + if (isSet(object.version)) obj.version = BigInt(object.version.toString()); if (isSet(object.totalWeight)) obj.totalWeight = String(object.totalWeight); if (isSet(object.createdAt)) obj.createdAt = fromJsonTimestamp(object.createdAt); return obj; }, toJSON(message: GroupInfo): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.admin !== undefined && (obj.admin = message.admin); message.metadata !== undefined && (obj.metadata = message.metadata); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.totalWeight !== undefined && (obj.totalWeight = message.totalWeight); message.createdAt !== undefined && (obj.createdAt = fromTimestamp(message.createdAt).toISOString()); return obj; }, - fromPartial, I>>(object: I): GroupInfo { + fromPartial(object: Partial): GroupInfo { const message = createBaseGroupInfo(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } message.admin = object.admin ?? ""; message.metadata = object.metadata ?? ""; if (object.version !== undefined && object.version !== null) { - message.version = Long.fromValue(object.version); + message.version = BigInt(object.version.toString()); } message.totalWeight = object.totalWeight ?? ""; if (object.createdAt !== undefined && object.createdAt !== null) { @@ -834,13 +832,13 @@ export const GroupInfo = { }; function createBaseGroupMember(): GroupMember { return { - groupId: Long.UZERO, + groupId: BigInt(0), member: Member.fromPartial({}), }; } export const GroupMember = { - encode(message: GroupMember, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.groupId.isZero()) { + encode(message: GroupMember, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { writer.uint32(8).uint64(message.groupId); } if (message.member !== undefined) { @@ -848,15 +846,15 @@ export const GroupMember = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GroupMember { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GroupMember { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupMember(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 2: message.member = Member.decode(reader, reader.uint32()); @@ -870,20 +868,20 @@ export const GroupMember = { }, fromJSON(object: any): GroupMember { const obj = createBaseGroupMember(); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.member)) obj.member = Member.fromJSON(object.member); return obj; }, toJSON(message: GroupMember): unknown { const obj: any = {}; - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.member !== undefined && (obj.member = message.member ? Member.toJSON(message.member) : undefined); return obj; }, - fromPartial, I>>(object: I): GroupMember { + fromPartial(object: Partial): GroupMember { const message = createBaseGroupMember(); if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } if (object.member !== undefined && object.member !== null) { message.member = Member.fromPartial(object.member); @@ -894,20 +892,20 @@ export const GroupMember = { function createBaseGroupPolicyInfo(): GroupPolicyInfo { return { address: "", - groupId: Long.UZERO, + groupId: BigInt(0), admin: "", metadata: "", - version: Long.UZERO, + version: BigInt(0), decisionPolicy: Any.fromPartial({}), createdAt: Timestamp.fromPartial({}), }; } export const GroupPolicyInfo = { - encode(message: GroupPolicyInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GroupPolicyInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.groupId.isZero()) { + if (message.groupId !== BigInt(0)) { writer.uint32(16).uint64(message.groupId); } if (message.admin !== "") { @@ -916,7 +914,7 @@ export const GroupPolicyInfo = { if (message.metadata !== "") { writer.uint32(34).string(message.metadata); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(40).uint64(message.version); } if (message.decisionPolicy !== undefined) { @@ -927,8 +925,8 @@ export const GroupPolicyInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GroupPolicyInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GroupPolicyInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGroupPolicyInfo(); while (reader.pos < end) { @@ -938,7 +936,7 @@ export const GroupPolicyInfo = { message.address = reader.string(); break; case 2: - message.groupId = reader.uint64() as Long; + message.groupId = reader.uint64(); break; case 3: message.admin = reader.string(); @@ -947,7 +945,7 @@ export const GroupPolicyInfo = { message.metadata = reader.string(); break; case 5: - message.version = reader.uint64() as Long; + message.version = reader.uint64(); break; case 6: message.decisionPolicy = Any.decode(reader, reader.uint32()); @@ -965,10 +963,10 @@ export const GroupPolicyInfo = { fromJSON(object: any): GroupPolicyInfo { const obj = createBaseGroupPolicyInfo(); if (isSet(object.address)) obj.address = String(object.address); - if (isSet(object.groupId)) obj.groupId = Long.fromValue(object.groupId); + if (isSet(object.groupId)) obj.groupId = BigInt(object.groupId.toString()); if (isSet(object.admin)) obj.admin = String(object.admin); if (isSet(object.metadata)) obj.metadata = String(object.metadata); - if (isSet(object.version)) obj.version = Long.fromValue(object.version); + if (isSet(object.version)) obj.version = BigInt(object.version.toString()); if (isSet(object.decisionPolicy)) obj.decisionPolicy = Any.fromJSON(object.decisionPolicy); if (isSet(object.createdAt)) obj.createdAt = fromJsonTimestamp(object.createdAt); return obj; @@ -976,25 +974,25 @@ export const GroupPolicyInfo = { toJSON(message: GroupPolicyInfo): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.groupId !== undefined && (obj.groupId = (message.groupId || Long.UZERO).toString()); + message.groupId !== undefined && (obj.groupId = (message.groupId || BigInt(0)).toString()); message.admin !== undefined && (obj.admin = message.admin); message.metadata !== undefined && (obj.metadata = message.metadata); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); message.decisionPolicy !== undefined && (obj.decisionPolicy = message.decisionPolicy ? Any.toJSON(message.decisionPolicy) : undefined); message.createdAt !== undefined && (obj.createdAt = fromTimestamp(message.createdAt).toISOString()); return obj; }, - fromPartial, I>>(object: I): GroupPolicyInfo { + fromPartial(object: Partial): GroupPolicyInfo { const message = createBaseGroupPolicyInfo(); message.address = object.address ?? ""; if (object.groupId !== undefined && object.groupId !== null) { - message.groupId = Long.fromValue(object.groupId); + message.groupId = BigInt(object.groupId.toString()); } message.admin = object.admin ?? ""; message.metadata = object.metadata ?? ""; if (object.version !== undefined && object.version !== null) { - message.version = Long.fromValue(object.version); + message.version = BigInt(object.version.toString()); } if (object.decisionPolicy !== undefined && object.decisionPolicy !== null) { message.decisionPolicy = Any.fromPartial(object.decisionPolicy); @@ -1007,13 +1005,13 @@ export const GroupPolicyInfo = { }; function createBaseProposal(): Proposal { return { - id: Long.UZERO, + id: BigInt(0), groupPolicyAddress: "", metadata: "", proposers: [], submitTime: Timestamp.fromPartial({}), - groupVersion: Long.UZERO, - groupPolicyVersion: Long.UZERO, + groupVersion: BigInt(0), + groupPolicyVersion: BigInt(0), status: 0, finalTallyResult: TallyResult.fromPartial({}), votingPeriodEnd: Timestamp.fromPartial({}), @@ -1024,8 +1022,8 @@ function createBaseProposal(): Proposal { }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.groupPolicyAddress !== "") { @@ -1040,10 +1038,10 @@ export const Proposal = { if (message.submitTime !== undefined) { Timestamp.encode(message.submitTime, writer.uint32(42).fork()).ldelim(); } - if (!message.groupVersion.isZero()) { + if (message.groupVersion !== BigInt(0)) { writer.uint32(48).uint64(message.groupVersion); } - if (!message.groupPolicyVersion.isZero()) { + if (message.groupPolicyVersion !== BigInt(0)) { writer.uint32(56).uint64(message.groupPolicyVersion); } if (message.status !== 0) { @@ -1069,15 +1067,15 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; + message.id = reader.uint64(); break; case 2: message.groupPolicyAddress = reader.string(); @@ -1092,10 +1090,10 @@ export const Proposal = { message.submitTime = Timestamp.decode(reader, reader.uint32()); break; case 6: - message.groupVersion = reader.uint64() as Long; + message.groupVersion = reader.uint64(); break; case 7: - message.groupPolicyVersion = reader.uint64() as Long; + message.groupPolicyVersion = reader.uint64(); break; case 8: message.status = reader.int32() as any; @@ -1127,13 +1125,14 @@ export const Proposal = { }, fromJSON(object: any): Proposal { const obj = createBaseProposal(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); if (isSet(object.groupPolicyAddress)) obj.groupPolicyAddress = String(object.groupPolicyAddress); if (isSet(object.metadata)) obj.metadata = String(object.metadata); if (Array.isArray(object?.proposers)) obj.proposers = object.proposers.map((e: any) => String(e)); if (isSet(object.submitTime)) obj.submitTime = fromJsonTimestamp(object.submitTime); - if (isSet(object.groupVersion)) obj.groupVersion = Long.fromValue(object.groupVersion); - if (isSet(object.groupPolicyVersion)) obj.groupPolicyVersion = Long.fromValue(object.groupPolicyVersion); + if (isSet(object.groupVersion)) obj.groupVersion = BigInt(object.groupVersion.toString()); + if (isSet(object.groupPolicyVersion)) + obj.groupPolicyVersion = BigInt(object.groupPolicyVersion.toString()); if (isSet(object.status)) obj.status = proposalStatusFromJSON(object.status); if (isSet(object.finalTallyResult)) obj.finalTallyResult = TallyResult.fromJSON(object.finalTallyResult); if (isSet(object.votingPeriodEnd)) obj.votingPeriodEnd = fromJsonTimestamp(object.votingPeriodEnd); @@ -1146,7 +1145,7 @@ export const Proposal = { }, toJSON(message: Proposal): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.groupPolicyAddress !== undefined && (obj.groupPolicyAddress = message.groupPolicyAddress); message.metadata !== undefined && (obj.metadata = message.metadata); if (message.proposers) { @@ -1155,10 +1154,9 @@ export const Proposal = { obj.proposers = []; } message.submitTime !== undefined && (obj.submitTime = fromTimestamp(message.submitTime).toISOString()); - message.groupVersion !== undefined && - (obj.groupVersion = (message.groupVersion || Long.UZERO).toString()); + message.groupVersion !== undefined && (obj.groupVersion = (message.groupVersion || BigInt(0)).toString()); message.groupPolicyVersion !== undefined && - (obj.groupPolicyVersion = (message.groupPolicyVersion || Long.UZERO).toString()); + (obj.groupPolicyVersion = (message.groupPolicyVersion || BigInt(0)).toString()); message.status !== undefined && (obj.status = proposalStatusToJSON(message.status)); message.finalTallyResult !== undefined && (obj.finalTallyResult = message.finalTallyResult @@ -1177,10 +1175,10 @@ export const Proposal = { message.summary !== undefined && (obj.summary = message.summary); return obj; }, - fromPartial, I>>(object: I): Proposal { + fromPartial(object: Partial): Proposal { const message = createBaseProposal(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } message.groupPolicyAddress = object.groupPolicyAddress ?? ""; message.metadata = object.metadata ?? ""; @@ -1189,10 +1187,10 @@ export const Proposal = { message.submitTime = Timestamp.fromPartial(object.submitTime); } if (object.groupVersion !== undefined && object.groupVersion !== null) { - message.groupVersion = Long.fromValue(object.groupVersion); + message.groupVersion = BigInt(object.groupVersion.toString()); } if (object.groupPolicyVersion !== undefined && object.groupPolicyVersion !== null) { - message.groupPolicyVersion = Long.fromValue(object.groupPolicyVersion); + message.groupPolicyVersion = BigInt(object.groupPolicyVersion.toString()); } message.status = object.status ?? 0; if (object.finalTallyResult !== undefined && object.finalTallyResult !== null) { @@ -1217,7 +1215,7 @@ function createBaseTallyResult(): TallyResult { }; } export const TallyResult = { - encode(message: TallyResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.yesCount !== "") { writer.uint32(10).string(message.yesCount); } @@ -1232,8 +1230,8 @@ export const TallyResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TallyResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTallyResult(); while (reader.pos < end) { @@ -1274,7 +1272,7 @@ export const TallyResult = { message.noWithVetoCount !== undefined && (obj.noWithVetoCount = message.noWithVetoCount); return obj; }, - fromPartial, I>>(object: I): TallyResult { + fromPartial(object: Partial): TallyResult { const message = createBaseTallyResult(); message.yesCount = object.yesCount ?? ""; message.abstainCount = object.abstainCount ?? ""; @@ -1285,7 +1283,7 @@ export const TallyResult = { }; function createBaseVote(): Vote { return { - proposalId: Long.UZERO, + proposalId: BigInt(0), voter: "", option: 0, metadata: "", @@ -1293,8 +1291,8 @@ function createBaseVote(): Vote { }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.proposalId.isZero()) { + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { writer.uint32(8).uint64(message.proposalId); } if (message.voter !== "") { @@ -1311,15 +1309,15 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposalId = reader.uint64() as Long; + message.proposalId = reader.uint64(); break; case 2: message.voter = reader.string(); @@ -1342,7 +1340,7 @@ export const Vote = { }, fromJSON(object: any): Vote { const obj = createBaseVote(); - if (isSet(object.proposalId)) obj.proposalId = Long.fromValue(object.proposalId); + if (isSet(object.proposalId)) obj.proposalId = BigInt(object.proposalId.toString()); if (isSet(object.voter)) obj.voter = String(object.voter); if (isSet(object.option)) obj.option = voteOptionFromJSON(object.option); if (isSet(object.metadata)) obj.metadata = String(object.metadata); @@ -1351,17 +1349,17 @@ export const Vote = { }, toJSON(message: Vote): unknown { const obj: any = {}; - message.proposalId !== undefined && (obj.proposalId = (message.proposalId || Long.UZERO).toString()); + message.proposalId !== undefined && (obj.proposalId = (message.proposalId || BigInt(0)).toString()); message.voter !== undefined && (obj.voter = message.voter); message.option !== undefined && (obj.option = voteOptionToJSON(message.option)); message.metadata !== undefined && (obj.metadata = message.metadata); message.submitTime !== undefined && (obj.submitTime = fromTimestamp(message.submitTime).toISOString()); return obj; }, - fromPartial, I>>(object: I): Vote { + fromPartial(object: Partial): Vote { const message = createBaseVote(); if (object.proposalId !== undefined && object.proposalId !== null) { - message.proposalId = Long.fromValue(object.proposalId); + message.proposalId = BigInt(object.proposalId.toString()); } message.voter = object.voter ?? ""; message.option = object.option ?? 0; diff --git a/src/cosmos/ics23/v1/proofs.ts b/src/cosmos/ics23/v1/proofs.ts index 0c395e2..1daaadc 100644 --- a/src/cosmos/ics23/v1/proofs.ts +++ b/src/cosmos/ics23/v1/proofs.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.ics23.v1"; export enum HashOp { /** NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument some places. */ @@ -340,7 +340,7 @@ function createBaseExistenceProof(): ExistenceProof { }; } export const ExistenceProof = { - encode(message: ExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -355,8 +355,8 @@ export const ExistenceProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExistenceProof(); while (reader.pos < end) { @@ -403,7 +403,7 @@ export const ExistenceProof = { } return obj; }, - fromPartial, I>>(object: I): ExistenceProof { + fromPartial(object: Partial): ExistenceProof { const message = createBaseExistenceProof(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); @@ -422,7 +422,7 @@ function createBaseNonExistenceProof(): NonExistenceProof { }; } export const NonExistenceProof = { - encode(message: NonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: NonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -434,8 +434,8 @@ export const NonExistenceProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): NonExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): NonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseNonExistenceProof(); while (reader.pos < end) { @@ -473,7 +473,7 @@ export const NonExistenceProof = { (obj.right = message.right ? ExistenceProof.toJSON(message.right) : undefined); return obj; }, - fromPartial, I>>(object: I): NonExistenceProof { + fromPartial(object: Partial): NonExistenceProof { const message = createBaseNonExistenceProof(); message.key = object.key ?? new Uint8Array(); if (object.left !== undefined && object.left !== null) { @@ -494,7 +494,7 @@ function createBaseCommitmentProof(): CommitmentProof { }; } export const CommitmentProof = { - encode(message: CommitmentProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CommitmentProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); } @@ -509,8 +509,8 @@ export const CommitmentProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitmentProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitmentProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitmentProof(); while (reader.pos < end) { @@ -554,7 +554,7 @@ export const CommitmentProof = { (obj.compressed = message.compressed ? CompressedBatchProof.toJSON(message.compressed) : undefined); return obj; }, - fromPartial, I>>(object: I): CommitmentProof { + fromPartial(object: Partial): CommitmentProof { const message = createBaseCommitmentProof(); if (object.exist !== undefined && object.exist !== null) { message.exist = ExistenceProof.fromPartial(object.exist); @@ -581,7 +581,7 @@ function createBaseLeafOp(): LeafOp { }; } export const LeafOp = { - encode(message: LeafOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: LeafOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== 0) { writer.uint32(8).int32(message.hash); } @@ -599,8 +599,8 @@ export const LeafOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LeafOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LeafOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLeafOp(); while (reader.pos < end) { @@ -647,7 +647,7 @@ export const LeafOp = { (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): LeafOp { + fromPartial(object: Partial): LeafOp { const message = createBaseLeafOp(); message.hash = object.hash ?? 0; message.prehashKey = object.prehashKey ?? 0; @@ -665,7 +665,7 @@ function createBaseInnerOp(): InnerOp { }; } export const InnerOp = { - encode(message: InnerOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InnerOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== 0) { writer.uint32(8).int32(message.hash); } @@ -677,8 +677,8 @@ export const InnerOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InnerOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InnerOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInnerOp(); while (reader.pos < end) { @@ -716,7 +716,7 @@ export const InnerOp = { (obj.suffix = base64FromBytes(message.suffix !== undefined ? message.suffix : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): InnerOp { + fromPartial(object: Partial): InnerOp { const message = createBaseInnerOp(); message.hash = object.hash ?? 0; message.prefix = object.prefix ?? new Uint8Array(); @@ -734,7 +734,7 @@ function createBaseProofSpec(): ProofSpec { }; } export const ProofSpec = { - encode(message: ProofSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ProofSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.leafSpec !== undefined) { LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); } @@ -752,8 +752,8 @@ export const ProofSpec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofSpec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofSpec(); while (reader.pos < end) { @@ -803,7 +803,7 @@ export const ProofSpec = { (obj.prehashKeyBeforeComparison = message.prehashKeyBeforeComparison); return obj; }, - fromPartial, I>>(object: I): ProofSpec { + fromPartial(object: Partial): ProofSpec { const message = createBaseProofSpec(); if (object.leafSpec !== undefined && object.leafSpec !== null) { message.leafSpec = LeafOp.fromPartial(object.leafSpec); @@ -828,7 +828,7 @@ function createBaseInnerSpec(): InnerSpec { }; } export const InnerSpec = { - encode(message: InnerSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InnerSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.childOrder) { writer.int32(v); @@ -851,8 +851,8 @@ export const InnerSpec = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InnerSpec { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InnerSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInnerSpec(); while (reader.pos < end) { @@ -917,7 +917,7 @@ export const InnerSpec = { message.hash !== undefined && (obj.hash = hashOpToJSON(message.hash)); return obj; }, - fromPartial, I>>(object: I): InnerSpec { + fromPartial(object: Partial): InnerSpec { const message = createBaseInnerSpec(); message.childOrder = object.childOrder?.map((e) => e) || []; message.childSize = object.childSize ?? 0; @@ -934,14 +934,14 @@ function createBaseBatchProof(): BatchProof { }; } export const BatchProof = { - encode(message: BatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchProof(); while (reader.pos < end) { @@ -971,7 +971,7 @@ export const BatchProof = { } return obj; }, - fromPartial, I>>(object: I): BatchProof { + fromPartial(object: Partial): BatchProof { const message = createBaseBatchProof(); message.entries = object.entries?.map((e) => BatchEntry.fromPartial(e)) || []; return message; @@ -984,7 +984,7 @@ function createBaseBatchEntry(): BatchEntry { }; } export const BatchEntry = { - encode(message: BatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); } @@ -993,8 +993,8 @@ export const BatchEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BatchEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBatchEntry(); while (reader.pos < end) { @@ -1027,7 +1027,7 @@ export const BatchEntry = { (obj.nonexist = message.nonexist ? NonExistenceProof.toJSON(message.nonexist) : undefined); return obj; }, - fromPartial, I>>(object: I): BatchEntry { + fromPartial(object: Partial): BatchEntry { const message = createBaseBatchEntry(); if (object.exist !== undefined && object.exist !== null) { message.exist = ExistenceProof.fromPartial(object.exist); @@ -1045,7 +1045,7 @@ function createBaseCompressedBatchProof(): CompressedBatchProof { }; } export const CompressedBatchProof = { - encode(message: CompressedBatchProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CompressedBatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1054,8 +1054,8 @@ export const CompressedBatchProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompressedBatchProof(); while (reader.pos < end) { @@ -1096,7 +1096,7 @@ export const CompressedBatchProof = { } return obj; }, - fromPartial, I>>(object: I): CompressedBatchProof { + fromPartial(object: Partial): CompressedBatchProof { const message = createBaseCompressedBatchProof(); message.entries = object.entries?.map((e) => CompressedBatchEntry.fromPartial(e)) || []; message.lookupInners = object.lookupInners?.map((e) => InnerOp.fromPartial(e)) || []; @@ -1110,7 +1110,7 @@ function createBaseCompressedBatchEntry(): CompressedBatchEntry { }; } export const CompressedBatchEntry = { - encode(message: CompressedBatchEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CompressedBatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exist !== undefined) { CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); } @@ -1119,8 +1119,8 @@ export const CompressedBatchEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CompressedBatchEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompressedBatchEntry(); while (reader.pos < end) { @@ -1153,7 +1153,7 @@ export const CompressedBatchEntry = { (obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toJSON(message.nonexist) : undefined); return obj; }, - fromPartial, I>>(object: I): CompressedBatchEntry { + fromPartial(object: Partial): CompressedBatchEntry { const message = createBaseCompressedBatchEntry(); if (object.exist !== undefined && object.exist !== null) { message.exist = CompressedExistenceProof.fromPartial(object.exist); @@ -1173,7 +1173,7 @@ function createBaseCompressedExistenceProof(): CompressedExistenceProof { }; } export const CompressedExistenceProof = { - encode(message: CompressedExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CompressedExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -1190,8 +1190,8 @@ export const CompressedExistenceProof = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CompressedExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CompressedExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompressedExistenceProof(); while (reader.pos < end) { @@ -1245,9 +1245,7 @@ export const CompressedExistenceProof = { } return obj; }, - fromPartial, I>>( - object: I, - ): CompressedExistenceProof { + fromPartial(object: Partial): CompressedExistenceProof { const message = createBaseCompressedExistenceProof(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); @@ -1266,7 +1264,7 @@ function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { }; } export const CompressedNonExistenceProof = { - encode(message: CompressedNonExistenceProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CompressedNonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -1278,8 +1276,8 @@ export const CompressedNonExistenceProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CompressedNonExistenceProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CompressedNonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompressedNonExistenceProof(); while (reader.pos < end) { @@ -1318,9 +1316,7 @@ export const CompressedNonExistenceProof = { (obj.right = message.right ? CompressedExistenceProof.toJSON(message.right) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): CompressedNonExistenceProof { + fromPartial(object: Partial): CompressedNonExistenceProof { const message = createBaseCompressedNonExistenceProof(); message.key = object.key ?? new Uint8Array(); if (object.left !== undefined && object.left !== null) { diff --git a/src/cosmos/mint/module/v1/module.ts b/src/cosmos/mint/module/v1/module.ts index 3967cd0..72ed8d7 100644 --- a/src/cosmos/mint/module/v1/module.ts +++ b/src/cosmos/mint/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.mint.module.v1"; /** Module is the config object of the mint module. */ export interface Module { @@ -15,7 +15,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.feeCollectorName !== "") { writer.uint32(10).string(message.feeCollectorName); } @@ -24,8 +24,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -56,7 +56,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.feeCollectorName = object.feeCollectorName ?? ""; message.authority = object.authority ?? ""; diff --git a/src/cosmos/mint/v1beta1/genesis.ts b/src/cosmos/mint/v1beta1/genesis.ts index f930df4..ad07a58 100644 --- a/src/cosmos/mint/v1beta1/genesis.ts +++ b/src/cosmos/mint/v1beta1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Minter, Params } from "./mint"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.mint.v1beta1"; /** GenesisState defines the mint module's genesis state. */ export interface GenesisState { @@ -17,7 +17,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.minter !== undefined) { Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); } @@ -26,8 +26,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -58,7 +58,7 @@ export const GenesisState = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.minter !== undefined && object.minter !== null) { message.minter = Minter.fromPartial(object.minter); diff --git a/src/cosmos/mint/v1beta1/mint.ts b/src/cosmos/mint/v1beta1/mint.ts index 7ff40e3..d7902fb 100644 --- a/src/cosmos/mint/v1beta1/mint.ts +++ b/src/cosmos/mint/v1beta1/mint.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.mint.v1beta1"; /** Minter represents the minting state. */ export interface Minter { @@ -22,7 +22,7 @@ export interface Params { /** goal of percent bonded atoms */ goalBonded: string; /** expected blocks per year */ - blocksPerYear: Long; + blocksPerYear: bigint; } function createBaseMinter(): Minter { return { @@ -31,7 +31,7 @@ function createBaseMinter(): Minter { }; } export const Minter = { - encode(message: Minter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Minter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.inflation !== "") { writer.uint32(10).string(message.inflation); } @@ -40,8 +40,8 @@ export const Minter = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Minter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Minter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMinter(); while (reader.pos < end) { @@ -72,7 +72,7 @@ export const Minter = { message.annualProvisions !== undefined && (obj.annualProvisions = message.annualProvisions); return obj; }, - fromPartial, I>>(object: I): Minter { + fromPartial(object: Partial): Minter { const message = createBaseMinter(); message.inflation = object.inflation ?? ""; message.annualProvisions = object.annualProvisions ?? ""; @@ -86,11 +86,11 @@ function createBaseParams(): Params { inflationMax: "", inflationMin: "", goalBonded: "", - blocksPerYear: Long.UZERO, + blocksPerYear: BigInt(0), }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mintDenom !== "") { writer.uint32(10).string(message.mintDenom); } @@ -106,13 +106,13 @@ export const Params = { if (message.goalBonded !== "") { writer.uint32(42).string(message.goalBonded); } - if (!message.blocksPerYear.isZero()) { + if (message.blocksPerYear !== BigInt(0)) { writer.uint32(48).uint64(message.blocksPerYear); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -134,7 +134,7 @@ export const Params = { message.goalBonded = reader.string(); break; case 6: - message.blocksPerYear = reader.uint64() as Long; + message.blocksPerYear = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -150,7 +150,7 @@ export const Params = { if (isSet(object.inflationMax)) obj.inflationMax = String(object.inflationMax); if (isSet(object.inflationMin)) obj.inflationMin = String(object.inflationMin); if (isSet(object.goalBonded)) obj.goalBonded = String(object.goalBonded); - if (isSet(object.blocksPerYear)) obj.blocksPerYear = Long.fromValue(object.blocksPerYear); + if (isSet(object.blocksPerYear)) obj.blocksPerYear = BigInt(object.blocksPerYear.toString()); return obj; }, toJSON(message: Params): unknown { @@ -161,10 +161,10 @@ export const Params = { message.inflationMin !== undefined && (obj.inflationMin = message.inflationMin); message.goalBonded !== undefined && (obj.goalBonded = message.goalBonded); message.blocksPerYear !== undefined && - (obj.blocksPerYear = (message.blocksPerYear || Long.UZERO).toString()); + (obj.blocksPerYear = (message.blocksPerYear || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.mintDenom = object.mintDenom ?? ""; message.inflationRateChange = object.inflationRateChange ?? ""; @@ -172,7 +172,7 @@ export const Params = { message.inflationMin = object.inflationMin ?? ""; message.goalBonded = object.goalBonded ?? ""; if (object.blocksPerYear !== undefined && object.blocksPerYear !== null) { - message.blocksPerYear = Long.fromValue(object.blocksPerYear); + message.blocksPerYear = BigInt(object.blocksPerYear.toString()); } return message; }, diff --git a/src/cosmos/mint/v1beta1/query.ts b/src/cosmos/mint/v1beta1/query.ts index 94cedd8..8d17023 100644 --- a/src/cosmos/mint/v1beta1/query.ts +++ b/src/cosmos/mint/v1beta1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./mint"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.mint.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -37,11 +37,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -62,7 +62,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -73,14 +73,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -106,7 +106,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -118,11 +118,11 @@ function createBaseQueryInflationRequest(): QueryInflationRequest { return {}; } export const QueryInflationRequest = { - encode(_: QueryInflationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryInflationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInflationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInflationRequest(); while (reader.pos < end) { @@ -143,7 +143,7 @@ export const QueryInflationRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryInflationRequest { + fromPartial(_: Partial): QueryInflationRequest { const message = createBaseQueryInflationRequest(); return message; }, @@ -154,14 +154,14 @@ function createBaseQueryInflationResponse(): QueryInflationResponse { }; } export const QueryInflationResponse = { - encode(message: QueryInflationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryInflationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.inflation.length !== 0) { writer.uint32(10).bytes(message.inflation); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInflationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInflationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInflationResponse(); while (reader.pos < end) { @@ -190,7 +190,7 @@ export const QueryInflationResponse = { )); return obj; }, - fromPartial, I>>(object: I): QueryInflationResponse { + fromPartial(object: Partial): QueryInflationResponse { const message = createBaseQueryInflationResponse(); message.inflation = object.inflation ?? new Uint8Array(); return message; @@ -200,11 +200,11 @@ function createBaseQueryAnnualProvisionsRequest(): QueryAnnualProvisionsRequest return {}; } export const QueryAnnualProvisionsRequest = { - encode(_: QueryAnnualProvisionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryAnnualProvisionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnnualProvisionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnnualProvisionsRequest(); while (reader.pos < end) { @@ -225,9 +225,7 @@ export const QueryAnnualProvisionsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryAnnualProvisionsRequest { + fromPartial(_: Partial): QueryAnnualProvisionsRequest { const message = createBaseQueryAnnualProvisionsRequest(); return message; }, @@ -238,14 +236,14 @@ function createBaseQueryAnnualProvisionsResponse(): QueryAnnualProvisionsRespons }; } export const QueryAnnualProvisionsResponse = { - encode(message: QueryAnnualProvisionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAnnualProvisionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.annualProvisions.length !== 0) { writer.uint32(10).bytes(message.annualProvisions); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAnnualProvisionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAnnualProvisionsResponse(); while (reader.pos < end) { @@ -274,9 +272,7 @@ export const QueryAnnualProvisionsResponse = { )); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAnnualProvisionsResponse { + fromPartial(object: Partial): QueryAnnualProvisionsResponse { const message = createBaseQueryAnnualProvisionsResponse(); message.annualProvisions = object.annualProvisions ?? new Uint8Array(); return message; @@ -302,16 +298,16 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } Inflation(request: QueryInflationRequest = {}): Promise { const data = QueryInflationRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "Inflation", data); - return promise.then((data) => QueryInflationResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryInflationResponse.decode(new BinaryReader(data))); } AnnualProvisions(request: QueryAnnualProvisionsRequest = {}): Promise { const data = QueryAnnualProvisionsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Query", "AnnualProvisions", data); - return promise.then((data) => QueryAnnualProvisionsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAnnualProvisionsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/mint/v1beta1/tx.amino.ts b/src/cosmos/mint/v1beta1/tx.amino.ts new file mode 100644 index 0000000..94fca8e --- /dev/null +++ b/src/cosmos/mint/v1beta1/tx.amino.ts @@ -0,0 +1,48 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgUpdateParams } from "./tx"; +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/mint/MsgUpdateParams"; + value: { + authority: string; + params: { + mint_denom: string; + inflation_rate_change: string; + inflation_max: string; + inflation_min: string; + goal_bonded: string; + blocks_per_year: string; + }; + }; +} +export const AminoConverter = { + "/cosmos.mint.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/mint/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + mint_denom: params.mintDenom, + inflation_rate_change: params.inflationRateChange, + inflation_max: params.inflationMax, + inflation_min: params.inflationMin, + goal_bonded: params.goalBonded, + blocks_per_year: params.blocksPerYear.toString(), + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + mintDenom: params.mint_denom, + inflationRateChange: params.inflation_rate_change, + inflationMax: params.inflation_max, + inflationMin: params.inflation_min, + goalBonded: params.goal_bonded, + blocksPerYear: BigInt(params.blocks_per_year), + }, + }; + }, + }, +}; diff --git a/src/cosmos/mint/v1beta1/tx.registry.ts b/src/cosmos/mint/v1beta1/tx.registry.ts new file mode 100644 index 0000000..af2d728 --- /dev/null +++ b/src/cosmos/mint/v1beta1/tx.registry.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.mint.v1beta1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/mint/v1beta1/tx.ts b/src/cosmos/mint/v1beta1/tx.ts index 7cacc7d..c9b6ddb 100644 --- a/src/cosmos/mint/v1beta1/tx.ts +++ b/src/cosmos/mint/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./mint"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.mint.v1beta1"; /** * MsgUpdateParams is the Msg/UpdateParams request type. @@ -32,7 +32,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -41,8 +41,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -73,7 +73,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -86,11 +86,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -111,7 +111,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -135,6 +135,6 @@ export class MsgClientImpl implements Msg { UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.mint.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/nft/module/v1/module.ts b/src/cosmos/nft/module/v1/module.ts index 25f2d2f..1186fff 100644 --- a/src/cosmos/nft/module/v1/module.ts +++ b/src/cosmos/nft/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.nft.module.v1"; /** Module is the config object of the nft module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/nft/v1beta1/event.ts b/src/cosmos/nft/v1beta1/event.ts index 1b76b01..aa03d64 100644 --- a/src/cosmos/nft/v1beta1/event.ts +++ b/src/cosmos/nft/v1beta1/event.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.nft.v1beta1"; /** EventSend is emitted on Msg/Send */ export interface EventSend { @@ -40,7 +40,7 @@ function createBaseEventSend(): EventSend { }; } export const EventSend = { - encode(message: EventSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EventSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -55,8 +55,8 @@ export const EventSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSend(); while (reader.pos < end) { @@ -97,7 +97,7 @@ export const EventSend = { message.receiver !== undefined && (obj.receiver = message.receiver); return obj; }, - fromPartial, I>>(object: I): EventSend { + fromPartial(object: Partial): EventSend { const message = createBaseEventSend(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; @@ -114,7 +114,7 @@ function createBaseEventMint(): EventMint { }; } export const EventMint = { - encode(message: EventMint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EventMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -126,8 +126,8 @@ export const EventMint = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventMint { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventMint(); while (reader.pos < end) { @@ -163,7 +163,7 @@ export const EventMint = { message.owner !== undefined && (obj.owner = message.owner); return obj; }, - fromPartial, I>>(object: I): EventMint { + fromPartial(object: Partial): EventMint { const message = createBaseEventMint(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; @@ -179,7 +179,7 @@ function createBaseEventBurn(): EventBurn { }; } export const EventBurn = { - encode(message: EventBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EventBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -191,8 +191,8 @@ export const EventBurn = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventBurn { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventBurn { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventBurn(); while (reader.pos < end) { @@ -228,7 +228,7 @@ export const EventBurn = { message.owner !== undefined && (obj.owner = message.owner); return obj; }, - fromPartial, I>>(object: I): EventBurn { + fromPartial(object: Partial): EventBurn { const message = createBaseEventBurn(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; diff --git a/src/cosmos/nft/v1beta1/genesis.ts b/src/cosmos/nft/v1beta1/genesis.ts index ed72dcd..af26ea2 100644 --- a/src/cosmos/nft/v1beta1/genesis.ts +++ b/src/cosmos/nft/v1beta1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Class, NFT } from "./nft"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.nft.v1beta1"; /** GenesisState defines the nft module's genesis state. */ export interface GenesisState { @@ -24,7 +24,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { Class.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -33,8 +33,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -73,7 +73,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.classes = object.classes?.map((e) => Class.fromPartial(e)) || []; message.entries = object.entries?.map((e) => Entry.fromPartial(e)) || []; @@ -87,7 +87,7 @@ function createBaseEntry(): Entry { }; } export const Entry = { - encode(message: Entry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Entry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -96,8 +96,8 @@ export const Entry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Entry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Entry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEntry(); while (reader.pos < end) { @@ -132,7 +132,7 @@ export const Entry = { } return obj; }, - fromPartial, I>>(object: I): Entry { + fromPartial(object: Partial): Entry { const message = createBaseEntry(); message.owner = object.owner ?? ""; message.nfts = object.nfts?.map((e) => NFT.fromPartial(e)) || []; diff --git a/src/cosmos/nft/v1beta1/nft.ts b/src/cosmos/nft/v1beta1/nft.ts index 326c447..8ba6ec7 100644 --- a/src/cosmos/nft/v1beta1/nft.ts +++ b/src/cosmos/nft/v1beta1/nft.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.nft.v1beta1"; /** Class defines the class of the nft type. */ export interface Class { @@ -45,7 +45,7 @@ function createBaseClass(): Class { }; } export const Class = { - encode(message: Class, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Class, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -69,8 +69,8 @@ export const Class = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Class { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Class { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClass(); while (reader.pos < end) { @@ -126,7 +126,7 @@ export const Class = { message.data !== undefined && (obj.data = message.data ? Any.toJSON(message.data) : undefined); return obj; }, - fromPartial, I>>(object: I): Class { + fromPartial(object: Partial): Class { const message = createBaseClass(); message.id = object.id ?? ""; message.name = object.name ?? ""; @@ -150,7 +150,7 @@ function createBaseNFT(): NFT { }; } export const NFT = { - encode(message: NFT, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: NFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -168,8 +168,8 @@ export const NFT = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): NFT { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): NFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseNFT(); while (reader.pos < end) { @@ -215,7 +215,7 @@ export const NFT = { message.data !== undefined && (obj.data = message.data ? Any.toJSON(message.data) : undefined); return obj; }, - fromPartial, I>>(object: I): NFT { + fromPartial(object: Partial): NFT { const message = createBaseNFT(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; diff --git a/src/cosmos/nft/v1beta1/query.ts b/src/cosmos/nft/v1beta1/query.ts index 7d7228d..cd7d3ce 100644 --- a/src/cosmos/nft/v1beta1/query.ts +++ b/src/cosmos/nft/v1beta1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { NFT, Class } from "./nft"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.nft.v1beta1"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method */ export interface QueryBalanceRequest { @@ -14,7 +14,7 @@ export interface QueryBalanceRequest { /** QueryBalanceResponse is the response type for the Query/Balance RPC method */ export interface QueryBalanceResponse { /** amount is the number of all NFTs of a given class owned by the owner */ - amount: Long; + amount: bigint; } /** QueryOwnerRequest is the request type for the Query/Owner RPC method */ export interface QueryOwnerRequest { @@ -36,7 +36,7 @@ export interface QuerySupplyRequest { /** QuerySupplyResponse is the response type for the Query/Supply RPC method */ export interface QuerySupplyResponse { /** amount is the number of all NFTs from the given class */ - amount: Long; + amount: bigint; } /** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ export interface QueryNFTsRequest { @@ -95,7 +95,7 @@ function createBaseQueryBalanceRequest(): QueryBalanceRequest { }; } export const QueryBalanceRequest = { - encode(message: QueryBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -104,8 +104,8 @@ export const QueryBalanceRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceRequest(); while (reader.pos < end) { @@ -136,7 +136,7 @@ export const QueryBalanceRequest = { message.owner !== undefined && (obj.owner = message.owner); return obj; }, - fromPartial, I>>(object: I): QueryBalanceRequest { + fromPartial(object: Partial): QueryBalanceRequest { const message = createBaseQueryBalanceRequest(); message.classId = object.classId ?? ""; message.owner = object.owner ?? ""; @@ -145,25 +145,25 @@ export const QueryBalanceRequest = { }; function createBaseQueryBalanceResponse(): QueryBalanceResponse { return { - amount: Long.UZERO, + amount: BigInt(0), }; } export const QueryBalanceResponse = { - encode(message: QueryBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.amount.isZero()) { + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { writer.uint32(8).uint64(message.amount); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryBalanceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.amount = reader.uint64() as Long; + message.amount = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -174,18 +174,18 @@ export const QueryBalanceResponse = { }, fromJSON(object: any): QueryBalanceResponse { const obj = createBaseQueryBalanceResponse(); - if (isSet(object.amount)) obj.amount = Long.fromValue(object.amount); + if (isSet(object.amount)) obj.amount = BigInt(object.amount.toString()); return obj; }, toJSON(message: QueryBalanceResponse): unknown { const obj: any = {}; - message.amount !== undefined && (obj.amount = (message.amount || Long.UZERO).toString()); + message.amount !== undefined && (obj.amount = (message.amount || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryBalanceResponse { + fromPartial(object: Partial): QueryBalanceResponse { const message = createBaseQueryBalanceResponse(); if (object.amount !== undefined && object.amount !== null) { - message.amount = Long.fromValue(object.amount); + message.amount = BigInt(object.amount.toString()); } return message; }, @@ -197,7 +197,7 @@ function createBaseQueryOwnerRequest(): QueryOwnerRequest { }; } export const QueryOwnerRequest = { - encode(message: QueryOwnerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryOwnerRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -206,8 +206,8 @@ export const QueryOwnerRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryOwnerRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwnerRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryOwnerRequest(); while (reader.pos < end) { @@ -238,7 +238,7 @@ export const QueryOwnerRequest = { message.id !== undefined && (obj.id = message.id); return obj; }, - fromPartial, I>>(object: I): QueryOwnerRequest { + fromPartial(object: Partial): QueryOwnerRequest { const message = createBaseQueryOwnerRequest(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; @@ -251,14 +251,14 @@ function createBaseQueryOwnerResponse(): QueryOwnerResponse { }; } export const QueryOwnerResponse = { - encode(message: QueryOwnerResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryOwnerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryOwnerResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwnerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryOwnerResponse(); while (reader.pos < end) { @@ -284,7 +284,7 @@ export const QueryOwnerResponse = { message.owner !== undefined && (obj.owner = message.owner); return obj; }, - fromPartial, I>>(object: I): QueryOwnerResponse { + fromPartial(object: Partial): QueryOwnerResponse { const message = createBaseQueryOwnerResponse(); message.owner = object.owner ?? ""; return message; @@ -296,14 +296,14 @@ function createBaseQuerySupplyRequest(): QuerySupplyRequest { }; } export const QuerySupplyRequest = { - encode(message: QuerySupplyRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyRequest(); while (reader.pos < end) { @@ -329,7 +329,7 @@ export const QuerySupplyRequest = { message.classId !== undefined && (obj.classId = message.classId); return obj; }, - fromPartial, I>>(object: I): QuerySupplyRequest { + fromPartial(object: Partial): QuerySupplyRequest { const message = createBaseQuerySupplyRequest(); message.classId = object.classId ?? ""; return message; @@ -337,25 +337,25 @@ export const QuerySupplyRequest = { }; function createBaseQuerySupplyResponse(): QuerySupplyResponse { return { - amount: Long.UZERO, + amount: BigInt(0), }; } export const QuerySupplyResponse = { - encode(message: QuerySupplyResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.amount.isZero()) { + encode(message: QuerySupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { writer.uint32(8).uint64(message.amount); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySupplyResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySupplyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.amount = reader.uint64() as Long; + message.amount = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -366,18 +366,18 @@ export const QuerySupplyResponse = { }, fromJSON(object: any): QuerySupplyResponse { const obj = createBaseQuerySupplyResponse(); - if (isSet(object.amount)) obj.amount = Long.fromValue(object.amount); + if (isSet(object.amount)) obj.amount = BigInt(object.amount.toString()); return obj; }, toJSON(message: QuerySupplyResponse): unknown { const obj: any = {}; - message.amount !== undefined && (obj.amount = (message.amount || Long.UZERO).toString()); + message.amount !== undefined && (obj.amount = (message.amount || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QuerySupplyResponse { + fromPartial(object: Partial): QuerySupplyResponse { const message = createBaseQuerySupplyResponse(); if (object.amount !== undefined && object.amount !== null) { - message.amount = Long.fromValue(object.amount); + message.amount = BigInt(object.amount.toString()); } return message; }, @@ -390,7 +390,7 @@ function createBaseQueryNFTsRequest(): QueryNFTsRequest { }; } export const QueryNFTsRequest = { - encode(message: QueryNFTsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryNFTsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -402,8 +402,8 @@ export const QueryNFTsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTsRequest(); while (reader.pos < end) { @@ -440,7 +440,7 @@ export const QueryNFTsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryNFTsRequest { + fromPartial(object: Partial): QueryNFTsRequest { const message = createBaseQueryNFTsRequest(); message.classId = object.classId ?? ""; message.owner = object.owner ?? ""; @@ -457,7 +457,7 @@ function createBaseQueryNFTsResponse(): QueryNFTsResponse { }; } export const QueryNFTsResponse = { - encode(message: QueryNFTsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryNFTsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.nfts) { NFT.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -466,8 +466,8 @@ export const QueryNFTsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTsResponse(); while (reader.pos < end) { @@ -503,7 +503,7 @@ export const QueryNFTsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryNFTsResponse { + fromPartial(object: Partial): QueryNFTsResponse { const message = createBaseQueryNFTsResponse(); message.nfts = object.nfts?.map((e) => NFT.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -519,7 +519,7 @@ function createBaseQueryNFTRequest(): QueryNFTRequest { }; } export const QueryNFTRequest = { - encode(message: QueryNFTRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryNFTRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -528,8 +528,8 @@ export const QueryNFTRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTRequest(); while (reader.pos < end) { @@ -560,7 +560,7 @@ export const QueryNFTRequest = { message.id !== undefined && (obj.id = message.id); return obj; }, - fromPartial, I>>(object: I): QueryNFTRequest { + fromPartial(object: Partial): QueryNFTRequest { const message = createBaseQueryNFTRequest(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; @@ -573,14 +573,14 @@ function createBaseQueryNFTResponse(): QueryNFTResponse { }; } export const QueryNFTResponse = { - encode(message: QueryNFTResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryNFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.nft !== undefined) { NFT.encode(message.nft, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNFTResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNFTResponse(); while (reader.pos < end) { @@ -606,7 +606,7 @@ export const QueryNFTResponse = { message.nft !== undefined && (obj.nft = message.nft ? NFT.toJSON(message.nft) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryNFTResponse { + fromPartial(object: Partial): QueryNFTResponse { const message = createBaseQueryNFTResponse(); if (object.nft !== undefined && object.nft !== null) { message.nft = NFT.fromPartial(object.nft); @@ -620,14 +620,14 @@ function createBaseQueryClassRequest(): QueryClassRequest { }; } export const QueryClassRequest = { - encode(message: QueryClassRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClassRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassRequest(); while (reader.pos < end) { @@ -653,7 +653,7 @@ export const QueryClassRequest = { message.classId !== undefined && (obj.classId = message.classId); return obj; }, - fromPartial, I>>(object: I): QueryClassRequest { + fromPartial(object: Partial): QueryClassRequest { const message = createBaseQueryClassRequest(); message.classId = object.classId ?? ""; return message; @@ -665,14 +665,14 @@ function createBaseQueryClassResponse(): QueryClassResponse { }; } export const QueryClassResponse = { - encode(message: QueryClassResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.class !== undefined) { Class.encode(message.class, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassResponse(); while (reader.pos < end) { @@ -698,7 +698,7 @@ export const QueryClassResponse = { message.class !== undefined && (obj.class = message.class ? Class.toJSON(message.class) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryClassResponse { + fromPartial(object: Partial): QueryClassResponse { const message = createBaseQueryClassResponse(); if (object.class !== undefined && object.class !== null) { message.class = Class.fromPartial(object.class); @@ -712,14 +712,14 @@ function createBaseQueryClassesRequest(): QueryClassesRequest { }; } export const QueryClassesRequest = { - encode(message: QueryClassesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClassesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesRequest(); while (reader.pos < end) { @@ -746,7 +746,7 @@ export const QueryClassesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryClassesRequest { + fromPartial(object: Partial): QueryClassesRequest { const message = createBaseQueryClassesRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -761,7 +761,7 @@ function createBaseQueryClassesResponse(): QueryClassesResponse { }; } export const QueryClassesResponse = { - encode(message: QueryClassesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClassesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.classes) { Class.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -770,8 +770,8 @@ export const QueryClassesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClassesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClassesResponse(); while (reader.pos < end) { @@ -807,7 +807,7 @@ export const QueryClassesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryClassesResponse { + fromPartial(object: Partial): QueryClassesResponse { const message = createBaseQueryClassesResponse(); message.classes = object.classes?.map((e) => Class.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -851,32 +851,32 @@ export class QueryClientImpl implements Query { Balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Balance", data); - return promise.then((data) => QueryBalanceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryBalanceResponse.decode(new BinaryReader(data))); } Owner(request: QueryOwnerRequest): Promise { const data = QueryOwnerRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Owner", data); - return promise.then((data) => QueryOwnerResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryOwnerResponse.decode(new BinaryReader(data))); } Supply(request: QuerySupplyRequest): Promise { const data = QuerySupplyRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Supply", data); - return promise.then((data) => QuerySupplyResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySupplyResponse.decode(new BinaryReader(data))); } NFTs(request: QueryNFTsRequest): Promise { const data = QueryNFTsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFTs", data); - return promise.then((data) => QueryNFTsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryNFTsResponse.decode(new BinaryReader(data))); } NFT(request: QueryNFTRequest): Promise { const data = QueryNFTRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFT", data); - return promise.then((data) => QueryNFTResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryNFTResponse.decode(new BinaryReader(data))); } Class(request: QueryClassRequest): Promise { const data = QueryClassRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Class", data); - return promise.then((data) => QueryClassResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClassResponse.decode(new BinaryReader(data))); } Classes( request: QueryClassesRequest = { @@ -885,6 +885,6 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryClassesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Classes", data); - return promise.then((data) => QueryClassesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClassesResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/nft/v1beta1/tx.amino.ts b/src/cosmos/nft/v1beta1/tx.amino.ts new file mode 100644 index 0000000..b8710fb --- /dev/null +++ b/src/cosmos/nft/v1beta1/tx.amino.ts @@ -0,0 +1,33 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgSend } from "./tx"; +export interface MsgSendAminoType extends AminoMsg { + type: "cosmos-sdk/MsgNFTSend"; + value: { + class_id: string; + id: string; + sender: string; + receiver: string; + }; +} +export const AminoConverter = { + "/cosmos.nft.v1beta1.MsgSend": { + aminoType: "cosmos-sdk/MsgNFTSend", + toAmino: ({ classId, id, sender, receiver }: MsgSend): MsgSendAminoType["value"] => { + return { + class_id: classId, + id, + sender, + receiver, + }; + }, + fromAmino: ({ class_id, id, sender, receiver }: MsgSendAminoType["value"]): MsgSend => { + return { + classId: class_id, + id, + sender, + receiver, + }; + }, + }, +}; diff --git a/src/cosmos/nft/v1beta1/tx.registry.ts b/src/cosmos/nft/v1beta1/tx.registry.ts new file mode 100644 index 0000000..3b54037 --- /dev/null +++ b/src/cosmos/nft/v1beta1/tx.registry.ts @@ -0,0 +1,52 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSend } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.nft.v1beta1.MsgSend", MsgSend]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value, + }; + }, + }, + toJSON: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.toJSON(value), + }; + }, + }, + fromJSON: { + send(value: any) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.fromJSON(value), + }; + }, + }, + fromPartial: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/nft/v1beta1/tx.ts b/src/cosmos/nft/v1beta1/tx.ts index 6a6f1ee..7053a60 100644 --- a/src/cosmos/nft/v1beta1/tx.ts +++ b/src/cosmos/nft/v1beta1/tx.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.nft.v1beta1"; /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSend { @@ -24,7 +24,7 @@ function createBaseMsgSend(): MsgSend { }; } export const MsgSend = { - encode(message: MsgSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.classId !== "") { writer.uint32(10).string(message.classId); } @@ -39,8 +39,8 @@ export const MsgSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSend(); while (reader.pos < end) { @@ -81,7 +81,7 @@ export const MsgSend = { message.receiver !== undefined && (obj.receiver = message.receiver); return obj; }, - fromPartial, I>>(object: I): MsgSend { + fromPartial(object: Partial): MsgSend { const message = createBaseMsgSend(); message.classId = object.classId ?? ""; message.id = object.id ?? ""; @@ -94,11 +94,11 @@ function createBaseMsgSendResponse(): MsgSendResponse { return {}; } export const MsgSendResponse = { - encode(_: MsgSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendResponse(); while (reader.pos < end) { @@ -119,7 +119,7 @@ export const MsgSendResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgSendResponse { + fromPartial(_: Partial): MsgSendResponse { const message = createBaseMsgSendResponse(); return message; }, @@ -138,6 +138,6 @@ export class MsgClientImpl implements Msg { Send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); const promise = this.rpc.request("cosmos.nft.v1beta1.Msg", "Send", data); - return promise.then((data) => MsgSendResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSendResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/orm/module/v1alpha1/module.ts b/src/cosmos/orm/module/v1alpha1/module.ts index 7ba89f5..7aac44a 100644 --- a/src/cosmos/orm/module/v1alpha1/module.ts +++ b/src/cosmos/orm/module/v1alpha1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.orm.module.v1alpha1"; /** * Module defines the ORM module which adds providers to the app container for @@ -12,11 +11,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -37,7 +36,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/orm/query/v1alpha1/query.ts b/src/cosmos/orm/query/v1alpha1/query.ts index 8a67b80..a53acc0 100644 --- a/src/cosmos/orm/query/v1alpha1/query.ts +++ b/src/cosmos/orm/query/v1alpha1/query.ts @@ -3,18 +3,15 @@ import { PageRequest, PageResponse } from "../../../base/query/v1beta1/paginatio import { Any } from "../../../../google/protobuf/any"; import { Timestamp } from "../../../../google/protobuf/timestamp"; import { Duration } from "../../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { - Long, isSet, - DeepPartial, - Exact, bytesFromBase64, fromJsonTimestamp, base64FromBytes, fromTimestamp, Rpc, } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "cosmos.orm.query.v1alpha1"; /** GetRequest is the Query/Get request type. */ export interface GetRequest { @@ -94,12 +91,12 @@ export interface IndexValue { * uint specifies a value for an uint32, fixed32, uint64, or fixed64 * index field. */ - uint?: Long; + uint?: bigint; /** * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 * index field. */ - int?: Long; + int?: bigint; /** str specifies a value for a string index field. */ str?: string; /** bytes specifies a value for a bytes index field. */ @@ -121,7 +118,7 @@ function createBaseGetRequest(): GetRequest { }; } export const GetRequest = { - encode(message: GetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.messageName !== "") { writer.uint32(10).string(message.messageName); } @@ -133,8 +130,8 @@ export const GetRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetRequest(); while (reader.pos < end) { @@ -174,7 +171,7 @@ export const GetRequest = { } return obj; }, - fromPartial, I>>(object: I): GetRequest { + fromPartial(object: Partial): GetRequest { const message = createBaseGetRequest(); message.messageName = object.messageName ?? ""; message.index = object.index ?? ""; @@ -188,14 +185,14 @@ function createBaseGetResponse(): GetResponse { }; } export const GetResponse = { - encode(message: GetResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== undefined) { Any.encode(message.result, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetResponse(); while (reader.pos < end) { @@ -221,7 +218,7 @@ export const GetResponse = { message.result !== undefined && (obj.result = message.result ? Any.toJSON(message.result) : undefined); return obj; }, - fromPartial, I>>(object: I): GetResponse { + fromPartial(object: Partial): GetResponse { const message = createBaseGetResponse(); if (object.result !== undefined && object.result !== null) { message.result = Any.fromPartial(object.result); @@ -239,7 +236,7 @@ function createBaseListRequest(): ListRequest { }; } export const ListRequest = { - encode(message: ListRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.messageName !== "") { writer.uint32(10).string(message.messageName); } @@ -257,8 +254,8 @@ export const ListRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListRequest(); while (reader.pos < end) { @@ -307,7 +304,7 @@ export const ListRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): ListRequest { + fromPartial(object: Partial): ListRequest { const message = createBaseListRequest(); message.messageName = object.messageName ?? ""; message.index = object.index ?? ""; @@ -329,14 +326,14 @@ function createBaseListRequest_Prefix(): ListRequest_Prefix { }; } export const ListRequest_Prefix = { - encode(message: ListRequest_Prefix, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListRequest_Prefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.values) { IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListRequest_Prefix { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Prefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListRequest_Prefix(); while (reader.pos < end) { @@ -366,7 +363,7 @@ export const ListRequest_Prefix = { } return obj; }, - fromPartial, I>>(object: I): ListRequest_Prefix { + fromPartial(object: Partial): ListRequest_Prefix { const message = createBaseListRequest_Prefix(); message.values = object.values?.map((e) => IndexValue.fromPartial(e)) || []; return message; @@ -379,7 +376,7 @@ function createBaseListRequest_Range(): ListRequest_Range { }; } export const ListRequest_Range = { - encode(message: ListRequest_Range, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListRequest_Range, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.start) { IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -388,8 +385,8 @@ export const ListRequest_Range = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListRequest_Range { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Range { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListRequest_Range(); while (reader.pos < end) { @@ -428,7 +425,7 @@ export const ListRequest_Range = { } return obj; }, - fromPartial, I>>(object: I): ListRequest_Range { + fromPartial(object: Partial): ListRequest_Range { const message = createBaseListRequest_Range(); message.start = object.start?.map((e) => IndexValue.fromPartial(e)) || []; message.end = object.end?.map((e) => IndexValue.fromPartial(e)) || []; @@ -442,7 +439,7 @@ function createBaseListResponse(): ListResponse { }; } export const ListResponse = { - encode(message: ListResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.results) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -451,8 +448,8 @@ export const ListResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ListResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseListResponse(); while (reader.pos < end) { @@ -488,7 +485,7 @@ export const ListResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): ListResponse { + fromPartial(object: Partial): ListResponse { const message = createBaseListResponse(); message.results = object.results?.map((e) => Any.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -510,7 +507,7 @@ function createBaseIndexValue(): IndexValue { }; } export const IndexValue = { - encode(message: IndexValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IndexValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.uint !== undefined) { writer.uint32(8).uint64(message.uint); } @@ -537,18 +534,18 @@ export const IndexValue = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IndexValue { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IndexValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIndexValue(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uint = reader.uint64() as Long; + message.uint = reader.uint64(); break; case 2: - message.int = reader.int64() as Long; + message.int = reader.int64(); break; case 3: message.str = reader.string(); @@ -577,8 +574,8 @@ export const IndexValue = { }, fromJSON(object: any): IndexValue { const obj = createBaseIndexValue(); - if (isSet(object.uint)) obj.uint = Long.fromValue(object.uint); - if (isSet(object.int)) obj.int = Long.fromValue(object.int); + if (isSet(object.uint)) obj.uint = BigInt(object.uint.toString()); + if (isSet(object.int)) obj.int = BigInt(object.int.toString()); if (isSet(object.str)) obj.str = String(object.str); if (isSet(object.bytes)) obj.bytes = bytesFromBase64(object.bytes); if (isSet(object.enum)) obj.enum = String(object.enum); @@ -601,13 +598,13 @@ export const IndexValue = { (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); return obj; }, - fromPartial, I>>(object: I): IndexValue { + fromPartial(object: Partial): IndexValue { const message = createBaseIndexValue(); if (object.uint !== undefined && object.uint !== null) { - message.uint = Long.fromValue(object.uint); + message.uint = BigInt(object.uint.toString()); } if (object.int !== undefined && object.int !== null) { - message.int = Long.fromValue(object.int); + message.int = BigInt(object.int.toString()); } message.str = object.str ?? undefined; message.bytes = object.bytes ?? undefined; @@ -639,11 +636,11 @@ export class QueryClientImpl implements Query { Get(request: GetRequest): Promise { const data = GetRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "Get", data); - return promise.then((data) => GetResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetResponse.decode(new BinaryReader(data))); } List(request: ListRequest): Promise { const data = ListRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "List", data); - return promise.then((data) => ListResponse.decode(new _m0.Reader(data))); + return promise.then((data) => ListResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/orm/v1/orm.ts b/src/cosmos/orm/v1/orm.ts index 7fb93ef..53f9a1f 100644 --- a/src/cosmos/orm/v1/orm.ts +++ b/src/cosmos/orm/v1/orm.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.orm.v1"; /** TableDescriptor describes an ORM table. */ export interface TableDescriptor { @@ -97,7 +97,7 @@ function createBaseTableDescriptor(): TableDescriptor { }; } export const TableDescriptor = { - encode(message: TableDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TableDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.primaryKey !== undefined) { PrimaryKeyDescriptor.encode(message.primaryKey, writer.uint32(10).fork()).ldelim(); } @@ -109,8 +109,8 @@ export const TableDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TableDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TableDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTableDescriptor(); while (reader.pos < end) { @@ -152,7 +152,7 @@ export const TableDescriptor = { message.id !== undefined && (obj.id = Math.round(message.id)); return obj; }, - fromPartial, I>>(object: I): TableDescriptor { + fromPartial(object: Partial): TableDescriptor { const message = createBaseTableDescriptor(); if (object.primaryKey !== undefined && object.primaryKey !== null) { message.primaryKey = PrimaryKeyDescriptor.fromPartial(object.primaryKey); @@ -169,7 +169,7 @@ function createBasePrimaryKeyDescriptor(): PrimaryKeyDescriptor { }; } export const PrimaryKeyDescriptor = { - encode(message: PrimaryKeyDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PrimaryKeyDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fields !== "") { writer.uint32(10).string(message.fields); } @@ -178,8 +178,8 @@ export const PrimaryKeyDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PrimaryKeyDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PrimaryKeyDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePrimaryKeyDescriptor(); while (reader.pos < end) { @@ -210,7 +210,7 @@ export const PrimaryKeyDescriptor = { message.autoIncrement !== undefined && (obj.autoIncrement = message.autoIncrement); return obj; }, - fromPartial, I>>(object: I): PrimaryKeyDescriptor { + fromPartial(object: Partial): PrimaryKeyDescriptor { const message = createBasePrimaryKeyDescriptor(); message.fields = object.fields ?? ""; message.autoIncrement = object.autoIncrement ?? false; @@ -225,7 +225,7 @@ function createBaseSecondaryIndexDescriptor(): SecondaryIndexDescriptor { }; } export const SecondaryIndexDescriptor = { - encode(message: SecondaryIndexDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SecondaryIndexDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fields !== "") { writer.uint32(10).string(message.fields); } @@ -237,8 +237,8 @@ export const SecondaryIndexDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SecondaryIndexDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SecondaryIndexDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSecondaryIndexDescriptor(); while (reader.pos < end) { @@ -274,9 +274,7 @@ export const SecondaryIndexDescriptor = { message.unique !== undefined && (obj.unique = message.unique); return obj; }, - fromPartial, I>>( - object: I, - ): SecondaryIndexDescriptor { + fromPartial(object: Partial): SecondaryIndexDescriptor { const message = createBaseSecondaryIndexDescriptor(); message.fields = object.fields ?? ""; message.id = object.id ?? 0; @@ -290,14 +288,14 @@ function createBaseSingletonDescriptor(): SingletonDescriptor { }; } export const SingletonDescriptor = { - encode(message: SingletonDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SingletonDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SingletonDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SingletonDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSingletonDescriptor(); while (reader.pos < end) { @@ -323,7 +321,7 @@ export const SingletonDescriptor = { message.id !== undefined && (obj.id = Math.round(message.id)); return obj; }, - fromPartial, I>>(object: I): SingletonDescriptor { + fromPartial(object: Partial): SingletonDescriptor { const message = createBaseSingletonDescriptor(); message.id = object.id ?? 0; return message; diff --git a/src/cosmos/orm/v1alpha1/schema.ts b/src/cosmos/orm/v1alpha1/schema.ts index 97b49c3..7c6c2b9 100644 --- a/src/cosmos/orm/v1alpha1/schema.ts +++ b/src/cosmos/orm/v1alpha1/schema.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.orm.v1alpha1"; /** StorageType */ export enum StorageType { @@ -121,7 +121,7 @@ function createBaseModuleSchemaDescriptor(): ModuleSchemaDescriptor { }; } export const ModuleSchemaDescriptor = { - encode(message: ModuleSchemaDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleSchemaDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.schemaFile) { ModuleSchemaDescriptor_FileEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -130,8 +130,8 @@ export const ModuleSchemaDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleSchemaDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleSchemaDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleSchemaDescriptor(); while (reader.pos < end) { @@ -170,7 +170,7 @@ export const ModuleSchemaDescriptor = { (obj.prefix = base64FromBytes(message.prefix !== undefined ? message.prefix : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): ModuleSchemaDescriptor { + fromPartial(object: Partial): ModuleSchemaDescriptor { const message = createBaseModuleSchemaDescriptor(); message.schemaFile = object.schemaFile?.map((e) => ModuleSchemaDescriptor_FileEntry.fromPartial(e)) || []; message.prefix = object.prefix ?? new Uint8Array(); @@ -185,7 +185,10 @@ function createBaseModuleSchemaDescriptor_FileEntry(): ModuleSchemaDescriptor_Fi }; } export const ModuleSchemaDescriptor_FileEntry = { - encode(message: ModuleSchemaDescriptor_FileEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ModuleSchemaDescriptor_FileEntry, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.id !== 0) { writer.uint32(8).uint32(message.id); } @@ -197,8 +200,8 @@ export const ModuleSchemaDescriptor_FileEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleSchemaDescriptor_FileEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleSchemaDescriptor_FileEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleSchemaDescriptor_FileEntry(); while (reader.pos < end) { @@ -234,9 +237,7 @@ export const ModuleSchemaDescriptor_FileEntry = { message.storageType !== undefined && (obj.storageType = storageTypeToJSON(message.storageType)); return obj; }, - fromPartial, I>>( - object: I, - ): ModuleSchemaDescriptor_FileEntry { + fromPartial(object: Partial): ModuleSchemaDescriptor_FileEntry { const message = createBaseModuleSchemaDescriptor_FileEntry(); message.id = object.id ?? 0; message.protoFileName = object.protoFileName ?? ""; diff --git a/src/cosmos/params/module/v1/module.ts b/src/cosmos/params/module/v1/module.ts index 25654b1..aac449d 100644 --- a/src/cosmos/params/module/v1/module.ts +++ b/src/cosmos/params/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.params.module.v1"; /** Module is the config object of the params module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/params/v1beta1/params.ts b/src/cosmos/params/v1beta1/params.ts index 702385c..d401ec2 100644 --- a/src/cosmos/params/v1beta1/params.ts +++ b/src/cosmos/params/v1beta1/params.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.params.v1beta1"; /** ParameterChangeProposal defines a proposal to change one or more parameters. */ export interface ParameterChangeProposal { @@ -25,7 +25,7 @@ function createBaseParameterChangeProposal(): ParameterChangeProposal { }; } export const ParameterChangeProposal = { - encode(message: ParameterChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ParameterChangeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -37,8 +37,8 @@ export const ParameterChangeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ParameterChangeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ParameterChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParameterChangeProposal(); while (reader.pos < end) { @@ -78,7 +78,7 @@ export const ParameterChangeProposal = { } return obj; }, - fromPartial, I>>(object: I): ParameterChangeProposal { + fromPartial(object: Partial): ParameterChangeProposal { const message = createBaseParameterChangeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -94,7 +94,7 @@ function createBaseParamChange(): ParamChange { }; } export const ParamChange = { - encode(message: ParamChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ParamChange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -106,8 +106,8 @@ export const ParamChange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ParamChange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ParamChange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParamChange(); while (reader.pos < end) { @@ -143,7 +143,7 @@ export const ParamChange = { message.value !== undefined && (obj.value = message.value); return obj; }, - fromPartial, I>>(object: I): ParamChange { + fromPartial(object: Partial): ParamChange { const message = createBaseParamChange(); message.subspace = object.subspace ?? ""; message.key = object.key ?? ""; diff --git a/src/cosmos/params/v1beta1/query.ts b/src/cosmos/params/v1beta1/query.ts index 512833f..1e46fb9 100644 --- a/src/cosmos/params/v1beta1/query.ts +++ b/src/cosmos/params/v1beta1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { ParamChange } from "./params"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.params.v1beta1"; /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest { @@ -48,7 +48,7 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { }; } export const QueryParamsRequest = { - encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -57,8 +57,8 @@ export const QueryParamsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -89,7 +89,7 @@ export const QueryParamsRequest = { message.key !== undefined && (obj.key = message.key); return obj; }, - fromPartial, I>>(object: I): QueryParamsRequest { + fromPartial(object: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); message.subspace = object.subspace ?? ""; message.key = object.key ?? ""; @@ -102,14 +102,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.param !== undefined) { ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -136,7 +136,7 @@ export const QueryParamsResponse = { (obj.param = message.param ? ParamChange.toJSON(message.param) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.param !== undefined && object.param !== null) { message.param = ParamChange.fromPartial(object.param); @@ -148,11 +148,11 @@ function createBaseQuerySubspacesRequest(): QuerySubspacesRequest { return {}; } export const QuerySubspacesRequest = { - encode(_: QuerySubspacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QuerySubspacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySubspacesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySubspacesRequest(); while (reader.pos < end) { @@ -173,7 +173,7 @@ export const QuerySubspacesRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QuerySubspacesRequest { + fromPartial(_: Partial): QuerySubspacesRequest { const message = createBaseQuerySubspacesRequest(); return message; }, @@ -184,14 +184,14 @@ function createBaseQuerySubspacesResponse(): QuerySubspacesResponse { }; } export const QuerySubspacesResponse = { - encode(message: QuerySubspacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySubspacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.subspaces) { Subspace.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySubspacesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySubspacesResponse(); while (reader.pos < end) { @@ -222,7 +222,7 @@ export const QuerySubspacesResponse = { } return obj; }, - fromPartial, I>>(object: I): QuerySubspacesResponse { + fromPartial(object: Partial): QuerySubspacesResponse { const message = createBaseQuerySubspacesResponse(); message.subspaces = object.subspaces?.map((e) => Subspace.fromPartial(e)) || []; return message; @@ -235,7 +235,7 @@ function createBaseSubspace(): Subspace { }; } export const Subspace = { - encode(message: Subspace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Subspace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.subspace !== "") { writer.uint32(10).string(message.subspace); } @@ -244,8 +244,8 @@ export const Subspace = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Subspace { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Subspace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSubspace(); while (reader.pos < end) { @@ -280,7 +280,7 @@ export const Subspace = { } return obj; }, - fromPartial, I>>(object: I): Subspace { + fromPartial(object: Partial): Subspace { const message = createBaseSubspace(); message.subspace = object.subspace ?? ""; message.keys = object.keys?.map((e) => e) || []; @@ -311,11 +311,11 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } Subspaces(request: QuerySubspacesRequest = {}): Promise { const data = QuerySubspacesRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Subspaces", data); - return promise.then((data) => QuerySubspacesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySubspacesResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/reflection/v1/reflection.ts b/src/cosmos/reflection/v1/reflection.ts index bc836b2..eab51d7 100644 --- a/src/cosmos/reflection/v1/reflection.ts +++ b/src/cosmos/reflection/v1/reflection.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { FileDescriptorProto } from "../../../google/protobuf/descriptor"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.reflection.v1"; /** FileDescriptorsRequest is the Query/FileDescriptors request type. */ export interface FileDescriptorsRequest {} @@ -14,11 +14,11 @@ function createBaseFileDescriptorsRequest(): FileDescriptorsRequest { return {}; } export const FileDescriptorsRequest = { - encode(_: FileDescriptorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: FileDescriptorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileDescriptorsRequest(); while (reader.pos < end) { @@ -39,7 +39,7 @@ export const FileDescriptorsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): FileDescriptorsRequest { + fromPartial(_: Partial): FileDescriptorsRequest { const message = createBaseFileDescriptorsRequest(); return message; }, @@ -50,14 +50,14 @@ function createBaseFileDescriptorsResponse(): FileDescriptorsResponse { }; } export const FileDescriptorsResponse = { - encode(message: FileDescriptorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FileDescriptorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.files) { FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileDescriptorsResponse(); while (reader.pos < end) { @@ -88,7 +88,7 @@ export const FileDescriptorsResponse = { } return obj; }, - fromPartial, I>>(object: I): FileDescriptorsResponse { + fromPartial(object: Partial): FileDescriptorsResponse { const message = createBaseFileDescriptorsResponse(); message.files = object.files?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; @@ -112,6 +112,6 @@ export class ReflectionServiceClientImpl implements ReflectionService { FileDescriptors(request: FileDescriptorsRequest = {}): Promise { const data = FileDescriptorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.reflection.v1.ReflectionService", "FileDescriptors", data); - return promise.then((data) => FileDescriptorsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => FileDescriptorsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/slashing/module/v1/module.ts b/src/cosmos/slashing/module/v1/module.ts index b9a3bfa..430f527 100644 --- a/src/cosmos/slashing/module/v1/module.ts +++ b/src/cosmos/slashing/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.slashing.module.v1"; /** Module is the config object of the slashing module. */ export interface Module { @@ -13,14 +13,14 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -46,7 +46,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.authority = object.authority ?? ""; return message; diff --git a/src/cosmos/slashing/v1beta1/genesis.ts b/src/cosmos/slashing/v1beta1/genesis.ts index 47e556b..03c89e0 100644 --- a/src/cosmos/slashing/v1beta1/genesis.ts +++ b/src/cosmos/slashing/v1beta1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params, ValidatorSigningInfo } from "./slashing"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** GenesisState defines the slashing module's genesis state. */ export interface GenesisState { @@ -38,7 +38,7 @@ export interface ValidatorMissedBlocks { /** MissedBlock contains height and missed status as boolean. */ export interface MissedBlock { /** index is the height at which the block was missed. */ - index: Long; + index: bigint; /** missed is the missed status. */ missed: boolean; } @@ -50,7 +50,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -62,8 +62,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -109,7 +109,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -126,7 +126,7 @@ function createBaseSigningInfo(): SigningInfo { }; } export const SigningInfo = { - encode(message: SigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SigningInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -135,8 +135,8 @@ export const SigningInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SigningInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SigningInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSigningInfo(); while (reader.pos < end) { @@ -171,7 +171,7 @@ export const SigningInfo = { : undefined); return obj; }, - fromPartial, I>>(object: I): SigningInfo { + fromPartial(object: Partial): SigningInfo { const message = createBaseSigningInfo(); message.address = object.address ?? ""; if (object.validatorSigningInfo !== undefined && object.validatorSigningInfo !== null) { @@ -187,7 +187,7 @@ function createBaseValidatorMissedBlocks(): ValidatorMissedBlocks { }; } export const ValidatorMissedBlocks = { - encode(message: ValidatorMissedBlocks, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorMissedBlocks, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -196,8 +196,8 @@ export const ValidatorMissedBlocks = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorMissedBlocks { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorMissedBlocks { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorMissedBlocks(); while (reader.pos < end) { @@ -233,7 +233,7 @@ export const ValidatorMissedBlocks = { } return obj; }, - fromPartial, I>>(object: I): ValidatorMissedBlocks { + fromPartial(object: Partial): ValidatorMissedBlocks { const message = createBaseValidatorMissedBlocks(); message.address = object.address ?? ""; message.missedBlocks = object.missedBlocks?.map((e) => MissedBlock.fromPartial(e)) || []; @@ -242,13 +242,13 @@ export const ValidatorMissedBlocks = { }; function createBaseMissedBlock(): MissedBlock { return { - index: Long.ZERO, + index: BigInt(0), missed: false, }; } export const MissedBlock = { - encode(message: MissedBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.index.isZero()) { + encode(message: MissedBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { writer.uint32(8).int64(message.index); } if (message.missed === true) { @@ -256,15 +256,15 @@ export const MissedBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MissedBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MissedBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMissedBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = reader.int64() as Long; + message.index = reader.int64(); break; case 2: message.missed = reader.bool(); @@ -278,20 +278,20 @@ export const MissedBlock = { }, fromJSON(object: any): MissedBlock { const obj = createBaseMissedBlock(); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); if (isSet(object.missed)) obj.missed = Boolean(object.missed); return obj; }, toJSON(message: MissedBlock): unknown { const obj: any = {}; - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.missed !== undefined && (obj.missed = message.missed); return obj; }, - fromPartial, I>>(object: I): MissedBlock { + fromPartial(object: Partial): MissedBlock { const message = createBaseMissedBlock(); if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } message.missed = object.missed ?? false; return message; diff --git a/src/cosmos/slashing/v1beta1/query.ts b/src/cosmos/slashing/v1beta1/query.ts index f5c25da..9cf2a53 100644 --- a/src/cosmos/slashing/v1beta1/query.ts +++ b/src/cosmos/slashing/v1beta1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { Params, ValidatorSigningInfo } from "./slashing"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method */ export interface QueryParamsRequest {} @@ -46,11 +46,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -71,7 +71,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -82,14 +82,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -115,7 +115,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -129,14 +129,14 @@ function createBaseQuerySigningInfoRequest(): QuerySigningInfoRequest { }; } export const QuerySigningInfoRequest = { - encode(message: QuerySigningInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySigningInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consAddress !== "") { writer.uint32(10).string(message.consAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfoRequest(); while (reader.pos < end) { @@ -162,7 +162,7 @@ export const QuerySigningInfoRequest = { message.consAddress !== undefined && (obj.consAddress = message.consAddress); return obj; }, - fromPartial, I>>(object: I): QuerySigningInfoRequest { + fromPartial(object: Partial): QuerySigningInfoRequest { const message = createBaseQuerySigningInfoRequest(); message.consAddress = object.consAddress ?? ""; return message; @@ -174,14 +174,14 @@ function createBaseQuerySigningInfoResponse(): QuerySigningInfoResponse { }; } export const QuerySigningInfoResponse = { - encode(message: QuerySigningInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySigningInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.valSigningInfo !== undefined) { ValidatorSigningInfo.encode(message.valSigningInfo, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfoResponse(); while (reader.pos < end) { @@ -211,9 +211,7 @@ export const QuerySigningInfoResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySigningInfoResponse { + fromPartial(object: Partial): QuerySigningInfoResponse { const message = createBaseQuerySigningInfoResponse(); if (object.valSigningInfo !== undefined && object.valSigningInfo !== null) { message.valSigningInfo = ValidatorSigningInfo.fromPartial(object.valSigningInfo); @@ -227,14 +225,14 @@ function createBaseQuerySigningInfosRequest(): QuerySigningInfosRequest { }; } export const QuerySigningInfosRequest = { - encode(message: QuerySigningInfosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySigningInfosRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfosRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfosRequest(); while (reader.pos < end) { @@ -261,9 +259,7 @@ export const QuerySigningInfosRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySigningInfosRequest { + fromPartial(object: Partial): QuerySigningInfosRequest { const message = createBaseQuerySigningInfosRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -278,7 +274,7 @@ function createBaseQuerySigningInfosResponse(): QuerySigningInfosResponse { }; } export const QuerySigningInfosResponse = { - encode(message: QuerySigningInfosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QuerySigningInfosResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.info) { ValidatorSigningInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -287,8 +283,8 @@ export const QuerySigningInfosResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySigningInfosResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySigningInfosResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySigningInfosResponse(); while (reader.pos < end) { @@ -324,9 +320,7 @@ export const QuerySigningInfosResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySigningInfosResponse { + fromPartial(object: Partial): QuerySigningInfosResponse { const message = createBaseQuerySigningInfosResponse(); message.info = object.info?.map((e) => ValidatorSigningInfo.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -355,12 +349,12 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } SigningInfo(request: QuerySigningInfoRequest): Promise { const data = QuerySigningInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfo", data); - return promise.then((data) => QuerySigningInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySigningInfoResponse.decode(new BinaryReader(data))); } SigningInfos( request: QuerySigningInfosRequest = { @@ -369,6 +363,6 @@ export class QueryClientImpl implements Query { ): Promise { const data = QuerySigningInfosRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Query", "SigningInfos", data); - return promise.then((data) => QuerySigningInfosResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySigningInfosResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/slashing/v1beta1/slashing.ts b/src/cosmos/slashing/v1beta1/slashing.ts index 89691af..e9dc905 100644 --- a/src/cosmos/slashing/v1beta1/slashing.ts +++ b/src/cosmos/slashing/v1beta1/slashing.ts @@ -1,17 +1,8 @@ /* eslint-disable */ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration } from "../../../google/protobuf/duration"; -import { - Long, - isSet, - fromJsonTimestamp, - fromTimestamp, - DeepPartial, - Exact, - bytesFromBase64, - base64FromBytes, -} from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** * ValidatorSigningInfo defines a validator's signing info for monitoring their @@ -20,13 +11,13 @@ export const protobufPackage = "cosmos.slashing.v1beta1"; export interface ValidatorSigningInfo { address: string; /** Height at which validator was first a candidate OR was unjailed */ - startHeight: Long; + startHeight: bigint; /** * Index which is incremented each time the validator was a bonded * in a block and may have signed a precommit or not. This in conjunction with the * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. */ - indexOffset: Long; + indexOffset: bigint; /** Timestamp until which the validator is jailed due to liveness downtime. */ jailedUntil: Timestamp; /** @@ -38,11 +29,11 @@ export interface ValidatorSigningInfo { * A counter kept to avoid unnecessary array reads. * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. */ - missedBlocksCounter: Long; + missedBlocksCounter: bigint; } /** Params represents the parameters used for by the slashing module. */ export interface Params { - signedBlocksWindow: Long; + signedBlocksWindow: bigint; minSignedPerWindow: Uint8Array; downtimeJailDuration: Duration; slashFractionDoubleSign: Uint8Array; @@ -51,22 +42,22 @@ export interface Params { function createBaseValidatorSigningInfo(): ValidatorSigningInfo { return { address: "", - startHeight: Long.ZERO, - indexOffset: Long.ZERO, + startHeight: BigInt(0), + indexOffset: BigInt(0), jailedUntil: Timestamp.fromPartial({}), tombstoned: false, - missedBlocksCounter: Long.ZERO, + missedBlocksCounter: BigInt(0), }; } export const ValidatorSigningInfo = { - encode(message: ValidatorSigningInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorSigningInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.startHeight.isZero()) { + if (message.startHeight !== BigInt(0)) { writer.uint32(16).int64(message.startHeight); } - if (!message.indexOffset.isZero()) { + if (message.indexOffset !== BigInt(0)) { writer.uint32(24).int64(message.indexOffset); } if (message.jailedUntil !== undefined) { @@ -75,13 +66,13 @@ export const ValidatorSigningInfo = { if (message.tombstoned === true) { writer.uint32(40).bool(message.tombstoned); } - if (!message.missedBlocksCounter.isZero()) { + if (message.missedBlocksCounter !== BigInt(0)) { writer.uint32(48).int64(message.missedBlocksCounter); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSigningInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSigningInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSigningInfo(); while (reader.pos < end) { @@ -91,10 +82,10 @@ export const ValidatorSigningInfo = { message.address = reader.string(); break; case 2: - message.startHeight = reader.int64() as Long; + message.startHeight = reader.int64(); break; case 3: - message.indexOffset = reader.int64() as Long; + message.indexOffset = reader.int64(); break; case 4: message.jailedUntil = Timestamp.decode(reader, reader.uint32()); @@ -103,7 +94,7 @@ export const ValidatorSigningInfo = { message.tombstoned = reader.bool(); break; case 6: - message.missedBlocksCounter = reader.int64() as Long; + message.missedBlocksCounter = reader.int64(); break; default: reader.skipType(tag & 7); @@ -115,47 +106,47 @@ export const ValidatorSigningInfo = { fromJSON(object: any): ValidatorSigningInfo { const obj = createBaseValidatorSigningInfo(); if (isSet(object.address)) obj.address = String(object.address); - if (isSet(object.startHeight)) obj.startHeight = Long.fromValue(object.startHeight); - if (isSet(object.indexOffset)) obj.indexOffset = Long.fromValue(object.indexOffset); + if (isSet(object.startHeight)) obj.startHeight = BigInt(object.startHeight.toString()); + if (isSet(object.indexOffset)) obj.indexOffset = BigInt(object.indexOffset.toString()); if (isSet(object.jailedUntil)) obj.jailedUntil = fromJsonTimestamp(object.jailedUntil); if (isSet(object.tombstoned)) obj.tombstoned = Boolean(object.tombstoned); if (isSet(object.missedBlocksCounter)) - obj.missedBlocksCounter = Long.fromValue(object.missedBlocksCounter); + obj.missedBlocksCounter = BigInt(object.missedBlocksCounter.toString()); return obj; }, toJSON(message: ValidatorSigningInfo): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.startHeight !== undefined && (obj.startHeight = (message.startHeight || Long.ZERO).toString()); - message.indexOffset !== undefined && (obj.indexOffset = (message.indexOffset || Long.ZERO).toString()); + message.startHeight !== undefined && (obj.startHeight = (message.startHeight || BigInt(0)).toString()); + message.indexOffset !== undefined && (obj.indexOffset = (message.indexOffset || BigInt(0)).toString()); message.jailedUntil !== undefined && (obj.jailedUntil = fromTimestamp(message.jailedUntil).toISOString()); message.tombstoned !== undefined && (obj.tombstoned = message.tombstoned); message.missedBlocksCounter !== undefined && - (obj.missedBlocksCounter = (message.missedBlocksCounter || Long.ZERO).toString()); + (obj.missedBlocksCounter = (message.missedBlocksCounter || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ValidatorSigningInfo { + fromPartial(object: Partial): ValidatorSigningInfo { const message = createBaseValidatorSigningInfo(); message.address = object.address ?? ""; if (object.startHeight !== undefined && object.startHeight !== null) { - message.startHeight = Long.fromValue(object.startHeight); + message.startHeight = BigInt(object.startHeight.toString()); } if (object.indexOffset !== undefined && object.indexOffset !== null) { - message.indexOffset = Long.fromValue(object.indexOffset); + message.indexOffset = BigInt(object.indexOffset.toString()); } if (object.jailedUntil !== undefined && object.jailedUntil !== null) { message.jailedUntil = Timestamp.fromPartial(object.jailedUntil); } message.tombstoned = object.tombstoned ?? false; if (object.missedBlocksCounter !== undefined && object.missedBlocksCounter !== null) { - message.missedBlocksCounter = Long.fromValue(object.missedBlocksCounter); + message.missedBlocksCounter = BigInt(object.missedBlocksCounter.toString()); } return message; }, }; function createBaseParams(): Params { return { - signedBlocksWindow: Long.ZERO, + signedBlocksWindow: BigInt(0), minSignedPerWindow: new Uint8Array(), downtimeJailDuration: Duration.fromPartial({}), slashFractionDoubleSign: new Uint8Array(), @@ -163,8 +154,8 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.signedBlocksWindow.isZero()) { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signedBlocksWindow !== BigInt(0)) { writer.uint32(8).int64(message.signedBlocksWindow); } if (message.minSignedPerWindow.length !== 0) { @@ -181,15 +172,15 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.signedBlocksWindow = reader.int64() as Long; + message.signedBlocksWindow = reader.int64(); break; case 2: message.minSignedPerWindow = reader.bytes(); @@ -212,7 +203,8 @@ export const Params = { }, fromJSON(object: any): Params { const obj = createBaseParams(); - if (isSet(object.signedBlocksWindow)) obj.signedBlocksWindow = Long.fromValue(object.signedBlocksWindow); + if (isSet(object.signedBlocksWindow)) + obj.signedBlocksWindow = BigInt(object.signedBlocksWindow.toString()); if (isSet(object.minSignedPerWindow)) obj.minSignedPerWindow = bytesFromBase64(object.minSignedPerWindow); if (isSet(object.downtimeJailDuration)) obj.downtimeJailDuration = Duration.fromJSON(object.downtimeJailDuration); @@ -225,7 +217,7 @@ export const Params = { toJSON(message: Params): unknown { const obj: any = {}; message.signedBlocksWindow !== undefined && - (obj.signedBlocksWindow = (message.signedBlocksWindow || Long.ZERO).toString()); + (obj.signedBlocksWindow = (message.signedBlocksWindow || BigInt(0)).toString()); message.minSignedPerWindow !== undefined && (obj.minSignedPerWindow = base64FromBytes( message.minSignedPerWindow !== undefined ? message.minSignedPerWindow : new Uint8Array(), @@ -244,10 +236,10 @@ export const Params = { )); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); if (object.signedBlocksWindow !== undefined && object.signedBlocksWindow !== null) { - message.signedBlocksWindow = Long.fromValue(object.signedBlocksWindow); + message.signedBlocksWindow = BigInt(object.signedBlocksWindow.toString()); } message.minSignedPerWindow = object.minSignedPerWindow ?? new Uint8Array(); if (object.downtimeJailDuration !== undefined && object.downtimeJailDuration !== null) { diff --git a/src/cosmos/slashing/v1beta1/tx.amino.ts b/src/cosmos/slashing/v1beta1/tx.amino.ts new file mode 100644 index 0000000..1e4c100 --- /dev/null +++ b/src/cosmos/slashing/v1beta1/tx.amino.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgUnjail, MsgUpdateParams } from "./tx"; +export interface MsgUnjailAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUnjail"; + value: { + validator_addr: string; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/slashing/MsgUpdateParams"; + value: { + authority: string; + params: { + signed_blocks_window: string; + min_signed_per_window: Uint8Array; + downtime_jail_duration: { + seconds: string; + nanos: number; + }; + slash_fraction_double_sign: Uint8Array; + slash_fraction_downtime: Uint8Array; + }; + }; +} +export const AminoConverter = { + "/cosmos.slashing.v1beta1.MsgUnjail": { + aminoType: "cosmos-sdk/MsgUnjail", + toAmino: ({ validatorAddr }: MsgUnjail): MsgUnjailAminoType["value"] => { + return { + validator_addr: validatorAddr, + }; + }, + fromAmino: ({ validator_addr }: MsgUnjailAminoType["value"]): MsgUnjail => { + return { + validatorAddr: validator_addr, + }; + }, + }, + "/cosmos.slashing.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/slashing/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + signed_blocks_window: params.signedBlocksWindow.toString(), + min_signed_per_window: params.minSignedPerWindow, + downtime_jail_duration: (params.downtimeJailDuration * 1_000_000_000).toString(), + slash_fraction_double_sign: params.slashFractionDoubleSign, + slash_fraction_downtime: params.slashFractionDowntime, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + signedBlocksWindow: BigInt(params.signed_blocks_window), + minSignedPerWindow: params.min_signed_per_window, + downtimeJailDuration: { + seconds: BigInt(Math.floor(parseInt(params.downtime_jail_duration) / 1_000_000_000)), + nanos: parseInt(params.downtime_jail_duration) % 1_000_000_000, + }, + slashFractionDoubleSign: params.slash_fraction_double_sign, + slashFractionDowntime: params.slash_fraction_downtime, + }, + }; + }, + }, +}; diff --git a/src/cosmos/slashing/v1beta1/tx.registry.ts b/src/cosmos/slashing/v1beta1/tx.registry.ts new file mode 100644 index 0000000..26fc42d --- /dev/null +++ b/src/cosmos/slashing/v1beta1/tx.registry.ts @@ -0,0 +1,85 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUnjail, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail], + ["/cosmos.slashing.v1beta1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + unjail(value: MsgUnjail) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", + value: MsgUnjail.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + unjail(value: MsgUnjail) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + unjail(value: MsgUnjail) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", + value: MsgUnjail.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + unjail(value: any) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", + value: MsgUnjail.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + unjail(value: MsgUnjail) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", + value: MsgUnjail.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/slashing/v1beta1/tx.ts b/src/cosmos/slashing/v1beta1/tx.ts index d8d9b1a..80a7a18 100644 --- a/src/cosmos/slashing/v1beta1/tx.ts +++ b/src/cosmos/slashing/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./slashing"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.slashing.v1beta1"; /** MsgUnjail defines the Msg/Unjail request type */ export interface MsgUnjail { @@ -37,14 +37,14 @@ function createBaseMsgUnjail(): MsgUnjail { }; } export const MsgUnjail = { - encode(message: MsgUnjail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUnjail, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjail { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnjail { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnjail(); while (reader.pos < end) { @@ -70,7 +70,7 @@ export const MsgUnjail = { message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial, I>>(object: I): MsgUnjail { + fromPartial(object: Partial): MsgUnjail { const message = createBaseMsgUnjail(); message.validatorAddr = object.validatorAddr ?? ""; return message; @@ -80,11 +80,11 @@ function createBaseMsgUnjailResponse(): MsgUnjailResponse { return {}; } export const MsgUnjailResponse = { - encode(_: MsgUnjailResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUnjailResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjailResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnjailResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnjailResponse(); while (reader.pos < end) { @@ -105,7 +105,7 @@ export const MsgUnjailResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUnjailResponse { + fromPartial(_: Partial): MsgUnjailResponse { const message = createBaseMsgUnjailResponse(); return message; }, @@ -117,7 +117,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -126,8 +126,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -158,7 +158,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -171,11 +171,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -196,7 +196,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -227,11 +227,11 @@ export class MsgClientImpl implements Msg { Unjail(request: MsgUnjail): Promise { const data = MsgUnjail.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); - return promise.then((data) => MsgUnjailResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUnjailResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/staking/module/v1/module.ts b/src/cosmos/staking/module/v1/module.ts index 15f40de..262116c 100644 --- a/src/cosmos/staking/module/v1/module.ts +++ b/src/cosmos/staking/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.staking.module.v1"; /** Module is the config object of the staking module. */ export interface Module { @@ -20,7 +20,7 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.hooksOrder) { writer.uint32(10).string(v!); } @@ -29,8 +29,8 @@ export const Module = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -65,7 +65,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.hooksOrder = object.hooksOrder?.map((e) => e) || []; message.authority = object.authority ?? ""; diff --git a/src/cosmos/staking/v1beta1/authz.ts b/src/cosmos/staking/v1beta1/authz.ts index 2430888..e10159c 100644 --- a/src/cosmos/staking/v1beta1/authz.ts +++ b/src/cosmos/staking/v1beta1/authz.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.staking.v1beta1"; /** * AuthorizationType defines the type of staking module authorization type @@ -88,7 +88,7 @@ function createBaseStakeAuthorization(): StakeAuthorization { }; } export const StakeAuthorization = { - encode(message: StakeAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StakeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.maxTokens !== undefined) { Coin.encode(message.maxTokens, writer.uint32(10).fork()).ldelim(); } @@ -103,8 +103,8 @@ export const StakeAuthorization = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StakeAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStakeAuthorization(); while (reader.pos < end) { @@ -152,7 +152,7 @@ export const StakeAuthorization = { (obj.authorizationType = authorizationTypeToJSON(message.authorizationType)); return obj; }, - fromPartial, I>>(object: I): StakeAuthorization { + fromPartial(object: Partial): StakeAuthorization { const message = createBaseStakeAuthorization(); if (object.maxTokens !== undefined && object.maxTokens !== null) { message.maxTokens = Coin.fromPartial(object.maxTokens); @@ -173,14 +173,14 @@ function createBaseStakeAuthorization_Validators(): StakeAuthorization_Validator }; } export const StakeAuthorization_Validators = { - encode(message: StakeAuthorization_Validators, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StakeAuthorization_Validators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.address) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StakeAuthorization_Validators { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StakeAuthorization_Validators { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStakeAuthorization_Validators(); while (reader.pos < end) { @@ -210,9 +210,7 @@ export const StakeAuthorization_Validators = { } return obj; }, - fromPartial, I>>( - object: I, - ): StakeAuthorization_Validators { + fromPartial(object: Partial): StakeAuthorization_Validators { const message = createBaseStakeAuthorization_Validators(); message.address = object.address?.map((e) => e) || []; return message; diff --git a/src/cosmos/staking/v1beta1/genesis.ts b/src/cosmos/staking/v1beta1/genesis.ts index 4c210b5..f7aaa46 100644 --- a/src/cosmos/staking/v1beta1/genesis.ts +++ b/src/cosmos/staking/v1beta1/genesis.ts @@ -8,17 +8,8 @@ import { TokenizeShareRecord, } from "./staking"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import { - Long, - isSet, - bytesFromBase64, - base64FromBytes, - DeepPartial, - Exact, - fromJsonTimestamp, - fromTimestamp, -} from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.staking.v1beta1"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { @@ -54,7 +45,7 @@ export interface GenesisState { * * Since: cosmos-sdk 0.47-lsm */ - lastTokenizeShareRecordId: Long; + lastTokenizeShareRecordId: bigint; /** * total number of liquid staked tokens at genesis. * @@ -86,7 +77,7 @@ export interface LastValidatorPower { /** address is the address of the validator. */ address: string; /** power defines the power of the validator. */ - power: Long; + power: bigint; } function createBaseGenesisState(): GenesisState { return { @@ -99,13 +90,13 @@ function createBaseGenesisState(): GenesisState { redelegations: [], exported: false, tokenizeShareRecords: [], - lastTokenizeShareRecordId: Long.UZERO, + lastTokenizeShareRecordId: BigInt(0), totalLiquidStakedTokens: new Uint8Array(), tokenizeShareLocks: [], }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -133,7 +124,7 @@ export const GenesisState = { for (const v of message.tokenizeShareRecords) { TokenizeShareRecord.encode(v!, writer.uint32(74).fork()).ldelim(); } - if (!message.lastTokenizeShareRecordId.isZero()) { + if (message.lastTokenizeShareRecordId !== BigInt(0)) { writer.uint32(80).uint64(message.lastTokenizeShareRecordId); } if (message.totalLiquidStakedTokens.length !== 0) { @@ -144,8 +135,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -179,7 +170,7 @@ export const GenesisState = { message.tokenizeShareRecords.push(TokenizeShareRecord.decode(reader, reader.uint32())); break; case 10: - message.lastTokenizeShareRecordId = reader.uint64() as Long; + message.lastTokenizeShareRecordId = reader.uint64(); break; case 11: message.totalLiquidStakedTokens = reader.bytes(); @@ -212,7 +203,7 @@ export const GenesisState = { if (Array.isArray(object?.tokenizeShareRecords)) obj.tokenizeShareRecords = object.tokenizeShareRecords.map((e: any) => TokenizeShareRecord.fromJSON(e)); if (isSet(object.lastTokenizeShareRecordId)) - obj.lastTokenizeShareRecordId = Long.fromValue(object.lastTokenizeShareRecordId); + obj.lastTokenizeShareRecordId = BigInt(object.lastTokenizeShareRecordId.toString()); if (isSet(object.totalLiquidStakedTokens)) obj.totalLiquidStakedTokens = bytesFromBase64(object.totalLiquidStakedTokens); if (Array.isArray(object?.tokenizeShareLocks)) @@ -264,7 +255,7 @@ export const GenesisState = { obj.tokenizeShareRecords = []; } message.lastTokenizeShareRecordId !== undefined && - (obj.lastTokenizeShareRecordId = (message.lastTokenizeShareRecordId || Long.UZERO).toString()); + (obj.lastTokenizeShareRecordId = (message.lastTokenizeShareRecordId || BigInt(0)).toString()); message.totalLiquidStakedTokens !== undefined && (obj.totalLiquidStakedTokens = base64FromBytes( message.totalLiquidStakedTokens !== undefined ? message.totalLiquidStakedTokens : new Uint8Array(), @@ -278,7 +269,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -295,7 +286,7 @@ export const GenesisState = { message.tokenizeShareRecords = object.tokenizeShareRecords?.map((e) => TokenizeShareRecord.fromPartial(e)) || []; if (object.lastTokenizeShareRecordId !== undefined && object.lastTokenizeShareRecordId !== null) { - message.lastTokenizeShareRecordId = Long.fromValue(object.lastTokenizeShareRecordId); + message.lastTokenizeShareRecordId = BigInt(object.lastTokenizeShareRecordId.toString()); } message.totalLiquidStakedTokens = object.totalLiquidStakedTokens ?? new Uint8Array(); message.tokenizeShareLocks = @@ -311,7 +302,7 @@ function createBaseTokenizeShareLock(): TokenizeShareLock { }; } export const TokenizeShareLock = { - encode(message: TokenizeShareLock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TokenizeShareLock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -323,8 +314,8 @@ export const TokenizeShareLock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TokenizeShareLock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TokenizeShareLock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTokenizeShareLock(); while (reader.pos < end) { @@ -361,7 +352,7 @@ export const TokenizeShareLock = { (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); return obj; }, - fromPartial, I>>(object: I): TokenizeShareLock { + fromPartial(object: Partial): TokenizeShareLock { const message = createBaseTokenizeShareLock(); message.address = object.address ?? ""; message.status = object.status ?? ""; @@ -374,21 +365,21 @@ export const TokenizeShareLock = { function createBaseLastValidatorPower(): LastValidatorPower { return { address: "", - power: Long.ZERO, + power: BigInt(0), }; } export const LastValidatorPower = { - encode(message: LastValidatorPower, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: LastValidatorPower, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(16).int64(message.power); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LastValidatorPower { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LastValidatorPower { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLastValidatorPower(); while (reader.pos < end) { @@ -398,7 +389,7 @@ export const LastValidatorPower = { message.address = reader.string(); break; case 2: - message.power = reader.int64() as Long; + message.power = reader.int64(); break; default: reader.skipType(tag & 7); @@ -410,20 +401,20 @@ export const LastValidatorPower = { fromJSON(object: any): LastValidatorPower { const obj = createBaseLastValidatorPower(); if (isSet(object.address)) obj.address = String(object.address); - if (isSet(object.power)) obj.power = Long.fromValue(object.power); + if (isSet(object.power)) obj.power = BigInt(object.power.toString()); return obj; }, toJSON(message: LastValidatorPower): unknown { const obj: any = {}; message.address !== undefined && (obj.address = message.address); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): LastValidatorPower { + fromPartial(object: Partial): LastValidatorPower { const message = createBaseLastValidatorPower(); message.address = object.address ?? ""; if (object.power !== undefined && object.power !== null) { - message.power = Long.fromValue(object.power); + message.power = BigInt(object.power.toString()); } return message; }, diff --git a/src/cosmos/staking/v1beta1/query.ts b/src/cosmos/staking/v1beta1/query.ts index e6cda1e..c2eadc1 100644 --- a/src/cosmos/staking/v1beta1/query.ts +++ b/src/cosmos/staking/v1beta1/query.ts @@ -11,8 +11,8 @@ import { TokenizeShareRecord, } from "./staking"; import { Coin } from "../../base/v1beta1/coin"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.staking.v1beta1"; /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequest { @@ -212,7 +212,7 @@ export interface QueryDelegatorValidatorResponse { */ export interface QueryHistoricalInfoRequest { /** height defines at which height to query the historical info. */ - height: Long; + height: bigint; } /** * QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC @@ -243,7 +243,7 @@ export interface QueryParamsResponse { * Since: cosmos-sdk 0.47-lsm */ export interface QueryTokenizeShareRecordByIdRequest { - id: Long; + id: bigint; } /** * QueryTokenizeShareRecordByIdRequest is response type for the @@ -318,7 +318,7 @@ export interface QueryLastTokenizeShareRecordIdRequest {} * Since: cosmos-sdk 0.47-lsm */ export interface QueryLastTokenizeShareRecordIdResponse { - id: Long; + id: bigint; } /** * QueryTotalTokenizeSharedAssetsRequest is request type for the @@ -378,7 +378,7 @@ function createBaseQueryValidatorsRequest(): QueryValidatorsRequest { }; } export const QueryValidatorsRequest = { - encode(message: QueryValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); } @@ -387,8 +387,8 @@ export const QueryValidatorsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorsRequest(); while (reader.pos < end) { @@ -420,7 +420,7 @@ export const QueryValidatorsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryValidatorsRequest { + fromPartial(object: Partial): QueryValidatorsRequest { const message = createBaseQueryValidatorsRequest(); message.status = object.status ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -436,7 +436,7 @@ function createBaseQueryValidatorsResponse(): QueryValidatorsResponse { }; } export const QueryValidatorsResponse = { - encode(message: QueryValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryValidatorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -445,8 +445,8 @@ export const QueryValidatorsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorsResponse(); while (reader.pos < end) { @@ -483,7 +483,7 @@ export const QueryValidatorsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryValidatorsResponse { + fromPartial(object: Partial): QueryValidatorsResponse { const message = createBaseQueryValidatorsResponse(); message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -498,14 +498,14 @@ function createBaseQueryValidatorRequest(): QueryValidatorRequest { }; } export const QueryValidatorRequest = { - encode(message: QueryValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryValidatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorRequest(); while (reader.pos < end) { @@ -531,7 +531,7 @@ export const QueryValidatorRequest = { message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial, I>>(object: I): QueryValidatorRequest { + fromPartial(object: Partial): QueryValidatorRequest { const message = createBaseQueryValidatorRequest(); message.validatorAddr = object.validatorAddr ?? ""; return message; @@ -543,14 +543,14 @@ function createBaseQueryValidatorResponse(): QueryValidatorResponse { }; } export const QueryValidatorResponse = { - encode(message: QueryValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorResponse(); while (reader.pos < end) { @@ -577,7 +577,7 @@ export const QueryValidatorResponse = { (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryValidatorResponse { + fromPartial(object: Partial): QueryValidatorResponse { const message = createBaseQueryValidatorResponse(); if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromPartial(object.validator); @@ -592,7 +592,10 @@ function createBaseQueryValidatorDelegationsRequest(): QueryValidatorDelegations }; } export const QueryValidatorDelegationsRequest = { - encode(message: QueryValidatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorDelegationsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } @@ -601,8 +604,8 @@ export const QueryValidatorDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorDelegationsRequest(); while (reader.pos < end) { @@ -634,9 +637,7 @@ export const QueryValidatorDelegationsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorDelegationsRequest { + fromPartial(object: Partial): QueryValidatorDelegationsRequest { const message = createBaseQueryValidatorDelegationsRequest(); message.validatorAddr = object.validatorAddr ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -652,7 +653,10 @@ function createBaseQueryValidatorDelegationsResponse(): QueryValidatorDelegation }; } export const QueryValidatorDelegationsResponse = { - encode(message: QueryValidatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorDelegationsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -661,8 +665,8 @@ export const QueryValidatorDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorDelegationsResponse(); while (reader.pos < end) { @@ -701,9 +705,7 @@ export const QueryValidatorDelegationsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorDelegationsResponse { + fromPartial(object: Partial): QueryValidatorDelegationsResponse { const message = createBaseQueryValidatorDelegationsResponse(); message.delegationResponses = object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || []; @@ -722,8 +724,8 @@ function createBaseQueryValidatorUnbondingDelegationsRequest(): QueryValidatorUn export const QueryValidatorUnbondingDelegationsRequest = { encode( message: QueryValidatorUnbondingDelegationsRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validatorAddr !== "") { writer.uint32(10).string(message.validatorAddr); } @@ -732,8 +734,8 @@ export const QueryValidatorUnbondingDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorUnbondingDelegationsRequest(); while (reader.pos < end) { @@ -765,8 +767,8 @@ export const QueryValidatorUnbondingDelegationsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryValidatorUnbondingDelegationsRequest { const message = createBaseQueryValidatorUnbondingDelegationsRequest(); message.validatorAddr = object.validatorAddr ?? ""; @@ -785,8 +787,8 @@ function createBaseQueryValidatorUnbondingDelegationsResponse(): QueryValidatorU export const QueryValidatorUnbondingDelegationsResponse = { encode( message: QueryValidatorUnbondingDelegationsResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -795,8 +797,8 @@ export const QueryValidatorUnbondingDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorUnbondingDelegationsResponse(); while (reader.pos < end) { @@ -835,8 +837,8 @@ export const QueryValidatorUnbondingDelegationsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryValidatorUnbondingDelegationsResponse { const message = createBaseQueryValidatorUnbondingDelegationsResponse(); message.unbondingResponses = @@ -854,7 +856,7 @@ function createBaseQueryDelegationRequest(): QueryDelegationRequest { }; } export const QueryDelegationRequest = { - encode(message: QueryDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDelegationRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -863,8 +865,8 @@ export const QueryDelegationRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationRequest(); while (reader.pos < end) { @@ -895,7 +897,7 @@ export const QueryDelegationRequest = { message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial, I>>(object: I): QueryDelegationRequest { + fromPartial(object: Partial): QueryDelegationRequest { const message = createBaseQueryDelegationRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; message.validatorAddr = object.validatorAddr ?? ""; @@ -908,14 +910,14 @@ function createBaseQueryDelegationResponse(): QueryDelegationResponse { }; } export const QueryDelegationResponse = { - encode(message: QueryDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegationResponse !== undefined) { DelegationResponse.encode(message.delegationResponse, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationResponse(); while (reader.pos < end) { @@ -945,7 +947,7 @@ export const QueryDelegationResponse = { : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDelegationResponse { + fromPartial(object: Partial): QueryDelegationResponse { const message = createBaseQueryDelegationResponse(); if (object.delegationResponse !== undefined && object.delegationResponse !== null) { message.delegationResponse = DelegationResponse.fromPartial(object.delegationResponse); @@ -960,7 +962,10 @@ function createBaseQueryUnbondingDelegationRequest(): QueryUnbondingDelegationRe }; } export const QueryUnbondingDelegationRequest = { - encode(message: QueryUnbondingDelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUnbondingDelegationRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -969,8 +974,8 @@ export const QueryUnbondingDelegationRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingDelegationRequest(); while (reader.pos < end) { @@ -1001,9 +1006,7 @@ export const QueryUnbondingDelegationRequest = { message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnbondingDelegationRequest { + fromPartial(object: Partial): QueryUnbondingDelegationRequest { const message = createBaseQueryUnbondingDelegationRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; message.validatorAddr = object.validatorAddr ?? ""; @@ -1016,14 +1019,17 @@ function createBaseQueryUnbondingDelegationResponse(): QueryUnbondingDelegationR }; } export const QueryUnbondingDelegationResponse = { - encode(message: QueryUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUnbondingDelegationResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.unbond !== undefined) { UnbondingDelegation.encode(message.unbond, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingDelegationResponse(); while (reader.pos < end) { @@ -1050,9 +1056,7 @@ export const QueryUnbondingDelegationResponse = { (obj.unbond = message.unbond ? UnbondingDelegation.toJSON(message.unbond) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnbondingDelegationResponse { + fromPartial(object: Partial): QueryUnbondingDelegationResponse { const message = createBaseQueryUnbondingDelegationResponse(); if (object.unbond !== undefined && object.unbond !== null) { message.unbond = UnbondingDelegation.fromPartial(object.unbond); @@ -1067,7 +1071,10 @@ function createBaseQueryDelegatorDelegationsRequest(): QueryDelegatorDelegations }; } export const QueryDelegatorDelegationsRequest = { - encode(message: QueryDelegatorDelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorDelegationsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1076,8 +1083,8 @@ export const QueryDelegatorDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorDelegationsRequest(); while (reader.pos < end) { @@ -1109,9 +1116,7 @@ export const QueryDelegatorDelegationsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorDelegationsRequest { + fromPartial(object: Partial): QueryDelegatorDelegationsRequest { const message = createBaseQueryDelegatorDelegationsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1127,7 +1132,10 @@ function createBaseQueryDelegatorDelegationsResponse(): QueryDelegatorDelegation }; } export const QueryDelegatorDelegationsResponse = { - encode(message: QueryDelegatorDelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorDelegationsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.delegationResponses) { DelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1136,8 +1144,8 @@ export const QueryDelegatorDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorDelegationsResponse(); while (reader.pos < end) { @@ -1176,9 +1184,7 @@ export const QueryDelegatorDelegationsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorDelegationsResponse { + fromPartial(object: Partial): QueryDelegatorDelegationsResponse { const message = createBaseQueryDelegatorDelegationsResponse(); message.delegationResponses = object.delegationResponses?.map((e) => DelegationResponse.fromPartial(e)) || []; @@ -1197,8 +1203,8 @@ function createBaseQueryDelegatorUnbondingDelegationsRequest(): QueryDelegatorUn export const QueryDelegatorUnbondingDelegationsRequest = { encode( message: QueryDelegatorUnbondingDelegationsRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1207,8 +1213,8 @@ export const QueryDelegatorUnbondingDelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); while (reader.pos < end) { @@ -1240,8 +1246,8 @@ export const QueryDelegatorUnbondingDelegationsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryDelegatorUnbondingDelegationsRequest { const message = createBaseQueryDelegatorUnbondingDelegationsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; @@ -1260,8 +1266,8 @@ function createBaseQueryDelegatorUnbondingDelegationsResponse(): QueryDelegatorU export const QueryDelegatorUnbondingDelegationsResponse = { encode( message: QueryDelegatorUnbondingDelegationsResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.unbondingResponses) { UnbondingDelegation.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1270,8 +1276,8 @@ export const QueryDelegatorUnbondingDelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingDelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); while (reader.pos < end) { @@ -1310,8 +1316,8 @@ export const QueryDelegatorUnbondingDelegationsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryDelegatorUnbondingDelegationsResponse { const message = createBaseQueryDelegatorUnbondingDelegationsResponse(); message.unbondingResponses = @@ -1331,7 +1337,7 @@ function createBaseQueryRedelegationsRequest(): QueryRedelegationsRequest { }; } export const QueryRedelegationsRequest = { - encode(message: QueryRedelegationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryRedelegationsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1346,8 +1352,8 @@ export const QueryRedelegationsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryRedelegationsRequest(); while (reader.pos < end) { @@ -1389,9 +1395,7 @@ export const QueryRedelegationsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryRedelegationsRequest { + fromPartial(object: Partial): QueryRedelegationsRequest { const message = createBaseQueryRedelegationsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; message.srcValidatorAddr = object.srcValidatorAddr ?? ""; @@ -1409,7 +1413,7 @@ function createBaseQueryRedelegationsResponse(): QueryRedelegationsResponse { }; } export const QueryRedelegationsResponse = { - encode(message: QueryRedelegationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryRedelegationsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.redelegationResponses) { RedelegationResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1418,8 +1422,8 @@ export const QueryRedelegationsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRedelegationsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryRedelegationsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryRedelegationsResponse(); while (reader.pos < end) { @@ -1460,9 +1464,7 @@ export const QueryRedelegationsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryRedelegationsResponse { + fromPartial(object: Partial): QueryRedelegationsResponse { const message = createBaseQueryRedelegationsResponse(); message.redelegationResponses = object.redelegationResponses?.map((e) => RedelegationResponse.fromPartial(e)) || []; @@ -1479,7 +1481,10 @@ function createBaseQueryDelegatorValidatorsRequest(): QueryDelegatorValidatorsRe }; } export const QueryDelegatorValidatorsRequest = { - encode(message: QueryDelegatorValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1488,8 +1493,8 @@ export const QueryDelegatorValidatorsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsRequest(); while (reader.pos < end) { @@ -1521,9 +1526,7 @@ export const QueryDelegatorValidatorsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorValidatorsRequest { + fromPartial(object: Partial): QueryDelegatorValidatorsRequest { const message = createBaseQueryDelegatorValidatorsRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1539,7 +1542,10 @@ function createBaseQueryDelegatorValidatorsResponse(): QueryDelegatorValidatorsR }; } export const QueryDelegatorValidatorsResponse = { - encode(message: QueryDelegatorValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1548,8 +1554,8 @@ export const QueryDelegatorValidatorsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorsResponse(); while (reader.pos < end) { @@ -1586,9 +1592,7 @@ export const QueryDelegatorValidatorsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorValidatorsResponse { + fromPartial(object: Partial): QueryDelegatorValidatorsResponse { const message = createBaseQueryDelegatorValidatorsResponse(); message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1604,7 +1608,10 @@ function createBaseQueryDelegatorValidatorRequest(): QueryDelegatorValidatorRequ }; } export const QueryDelegatorValidatorRequest = { - encode(message: QueryDelegatorValidatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddr !== "") { writer.uint32(10).string(message.delegatorAddr); } @@ -1613,8 +1620,8 @@ export const QueryDelegatorValidatorRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorRequest(); while (reader.pos < end) { @@ -1645,9 +1652,7 @@ export const QueryDelegatorValidatorRequest = { message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorValidatorRequest { + fromPartial(object: Partial): QueryDelegatorValidatorRequest { const message = createBaseQueryDelegatorValidatorRequest(); message.delegatorAddr = object.delegatorAddr ?? ""; message.validatorAddr = object.validatorAddr ?? ""; @@ -1660,14 +1665,17 @@ function createBaseQueryDelegatorValidatorResponse(): QueryDelegatorValidatorRes }; } export const QueryDelegatorValidatorResponse = { - encode(message: QueryDelegatorValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDelegatorValidatorResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorValidatorResponse(); while (reader.pos < end) { @@ -1694,9 +1702,7 @@ export const QueryDelegatorValidatorResponse = { (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegatorValidatorResponse { + fromPartial(object: Partial): QueryDelegatorValidatorResponse { const message = createBaseQueryDelegatorValidatorResponse(); if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromPartial(object.validator); @@ -1706,25 +1712,25 @@ export const QueryDelegatorValidatorResponse = { }; function createBaseQueryHistoricalInfoRequest(): QueryHistoricalInfoRequest { return { - height: Long.ZERO, + height: BigInt(0), }; } export const QueryHistoricalInfoRequest = { - encode(message: QueryHistoricalInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: QueryHistoricalInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHistoricalInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1735,20 +1741,18 @@ export const QueryHistoricalInfoRequest = { }, fromJSON(object: any): QueryHistoricalInfoRequest { const obj = createBaseQueryHistoricalInfoRequest(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); return obj; }, toJSON(message: QueryHistoricalInfoRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryHistoricalInfoRequest { + fromPartial(object: Partial): QueryHistoricalInfoRequest { const message = createBaseQueryHistoricalInfoRequest(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } return message; }, @@ -1759,14 +1763,14 @@ function createBaseQueryHistoricalInfoResponse(): QueryHistoricalInfoResponse { }; } export const QueryHistoricalInfoResponse = { - encode(message: QueryHistoricalInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryHistoricalInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hist !== undefined) { HistoricalInfo.encode(message.hist, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHistoricalInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHistoricalInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHistoricalInfoResponse(); while (reader.pos < end) { @@ -1792,9 +1796,7 @@ export const QueryHistoricalInfoResponse = { message.hist !== undefined && (obj.hist = message.hist ? HistoricalInfo.toJSON(message.hist) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryHistoricalInfoResponse { + fromPartial(object: Partial): QueryHistoricalInfoResponse { const message = createBaseQueryHistoricalInfoResponse(); if (object.hist !== undefined && object.hist !== null) { message.hist = HistoricalInfo.fromPartial(object.hist); @@ -1806,11 +1808,11 @@ function createBaseQueryPoolRequest(): QueryPoolRequest { return {}; } export const QueryPoolRequest = { - encode(_: QueryPoolRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryPoolRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPoolRequest(); while (reader.pos < end) { @@ -1831,7 +1833,7 @@ export const QueryPoolRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryPoolRequest { + fromPartial(_: Partial): QueryPoolRequest { const message = createBaseQueryPoolRequest(); return message; }, @@ -1842,14 +1844,14 @@ function createBaseQueryPoolResponse(): QueryPoolResponse { }; } export const QueryPoolResponse = { - encode(message: QueryPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pool !== undefined) { Pool.encode(message.pool, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPoolResponse(); while (reader.pos < end) { @@ -1875,7 +1877,7 @@ export const QueryPoolResponse = { message.pool !== undefined && (obj.pool = message.pool ? Pool.toJSON(message.pool) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryPoolResponse { + fromPartial(object: Partial): QueryPoolResponse { const message = createBaseQueryPoolResponse(); if (object.pool !== undefined && object.pool !== null) { message.pool = Pool.fromPartial(object.pool); @@ -1887,11 +1889,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -1912,7 +1914,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -1923,14 +1925,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -1956,7 +1958,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -1966,25 +1968,28 @@ export const QueryParamsResponse = { }; function createBaseQueryTokenizeShareRecordByIdRequest(): QueryTokenizeShareRecordByIdRequest { return { - id: Long.UZERO, + id: BigInt(0), }; } export const QueryTokenizeShareRecordByIdRequest = { - encode(message: QueryTokenizeShareRecordByIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + encode( + message: QueryTokenizeShareRecordByIdRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordByIdRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordByIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordByIdRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; + message.id = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1995,20 +2000,18 @@ export const QueryTokenizeShareRecordByIdRequest = { }, fromJSON(object: any): QueryTokenizeShareRecordByIdRequest { const obj = createBaseQueryTokenizeShareRecordByIdRequest(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); return obj; }, toJSON(message: QueryTokenizeShareRecordByIdRequest): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTokenizeShareRecordByIdRequest { + fromPartial(object: Partial): QueryTokenizeShareRecordByIdRequest { const message = createBaseQueryTokenizeShareRecordByIdRequest(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } return message; }, @@ -2021,15 +2024,15 @@ function createBaseQueryTokenizeShareRecordByIdResponse(): QueryTokenizeShareRec export const QueryTokenizeShareRecordByIdResponse = { encode( message: QueryTokenizeShareRecordByIdResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.record !== undefined) { TokenizeShareRecord.encode(message.record, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordByIdResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordByIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordByIdResponse(); while (reader.pos < end) { @@ -2056,9 +2059,7 @@ export const QueryTokenizeShareRecordByIdResponse = { (obj.record = message.record ? TokenizeShareRecord.toJSON(message.record) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTokenizeShareRecordByIdResponse { + fromPartial(object: Partial): QueryTokenizeShareRecordByIdResponse { const message = createBaseQueryTokenizeShareRecordByIdResponse(); if (object.record !== undefined && object.record !== null) { message.record = TokenizeShareRecord.fromPartial(object.record); @@ -2074,15 +2075,15 @@ function createBaseQueryTokenizeShareRecordByDenomRequest(): QueryTokenizeShareR export const QueryTokenizeShareRecordByDenomRequest = { encode( message: QueryTokenizeShareRecordByDenomRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordByDenomRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordByDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordByDenomRequest(); while (reader.pos < end) { @@ -2108,8 +2109,8 @@ export const QueryTokenizeShareRecordByDenomRequest = { message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryTokenizeShareRecordByDenomRequest { const message = createBaseQueryTokenizeShareRecordByDenomRequest(); message.denom = object.denom ?? ""; @@ -2124,15 +2125,15 @@ function createBaseQueryTokenizeShareRecordByDenomResponse(): QueryTokenizeShare export const QueryTokenizeShareRecordByDenomResponse = { encode( message: QueryTokenizeShareRecordByDenomResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.record !== undefined) { TokenizeShareRecord.encode(message.record, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordByDenomResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordByDenomResponse(); while (reader.pos < end) { @@ -2159,8 +2160,8 @@ export const QueryTokenizeShareRecordByDenomResponse = { (obj.record = message.record ? TokenizeShareRecord.toJSON(message.record) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryTokenizeShareRecordByDenomResponse { const message = createBaseQueryTokenizeShareRecordByDenomResponse(); if (object.record !== undefined && object.record !== null) { @@ -2177,15 +2178,15 @@ function createBaseQueryTokenizeShareRecordsOwnedRequest(): QueryTokenizeShareRe export const QueryTokenizeShareRecordsOwnedRequest = { encode( message: QueryTokenizeShareRecordsOwnedRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordsOwnedRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordsOwnedRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordsOwnedRequest(); while (reader.pos < end) { @@ -2211,9 +2212,7 @@ export const QueryTokenizeShareRecordsOwnedRequest = { message.owner !== undefined && (obj.owner = message.owner); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTokenizeShareRecordsOwnedRequest { + fromPartial(object: Partial): QueryTokenizeShareRecordsOwnedRequest { const message = createBaseQueryTokenizeShareRecordsOwnedRequest(); message.owner = object.owner ?? ""; return message; @@ -2227,15 +2226,15 @@ function createBaseQueryTokenizeShareRecordsOwnedResponse(): QueryTokenizeShareR export const QueryTokenizeShareRecordsOwnedResponse = { encode( message: QueryTokenizeShareRecordsOwnedResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.records) { TokenizeShareRecord.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareRecordsOwnedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareRecordsOwnedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareRecordsOwnedResponse(); while (reader.pos < end) { @@ -2266,8 +2265,8 @@ export const QueryTokenizeShareRecordsOwnedResponse = { } return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryTokenizeShareRecordsOwnedResponse { const message = createBaseQueryTokenizeShareRecordsOwnedResponse(); message.records = object.records?.map((e) => TokenizeShareRecord.fromPartial(e)) || []; @@ -2278,11 +2277,11 @@ function createBaseQueryAllTokenizeShareRecordsRequest(): QueryAllTokenizeShareR return {}; } export const QueryAllTokenizeShareRecordsRequest = { - encode(_: QueryAllTokenizeShareRecordsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryAllTokenizeShareRecordsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllTokenizeShareRecordsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllTokenizeShareRecordsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllTokenizeShareRecordsRequest(); while (reader.pos < end) { @@ -2303,9 +2302,7 @@ export const QueryAllTokenizeShareRecordsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryAllTokenizeShareRecordsRequest { + fromPartial(_: Partial): QueryAllTokenizeShareRecordsRequest { const message = createBaseQueryAllTokenizeShareRecordsRequest(); return message; }, @@ -2318,15 +2315,15 @@ function createBaseQueryAllTokenizeShareRecordsResponse(): QueryAllTokenizeShare export const QueryAllTokenizeShareRecordsResponse = { encode( message: QueryAllTokenizeShareRecordsResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.records) { TokenizeShareRecord.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllTokenizeShareRecordsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllTokenizeShareRecordsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllTokenizeShareRecordsResponse(); while (reader.pos < end) { @@ -2357,9 +2354,7 @@ export const QueryAllTokenizeShareRecordsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllTokenizeShareRecordsResponse { + fromPartial(object: Partial): QueryAllTokenizeShareRecordsResponse { const message = createBaseQueryAllTokenizeShareRecordsResponse(); message.records = object.records?.map((e) => TokenizeShareRecord.fromPartial(e)) || []; return message; @@ -2369,11 +2364,14 @@ function createBaseQueryLastTokenizeShareRecordIdRequest(): QueryLastTokenizeSha return {}; } export const QueryLastTokenizeShareRecordIdRequest = { - encode(_: QueryLastTokenizeShareRecordIdRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: QueryLastTokenizeShareRecordIdRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryLastTokenizeShareRecordIdRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastTokenizeShareRecordIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryLastTokenizeShareRecordIdRequest(); while (reader.pos < end) { @@ -2394,37 +2392,35 @@ export const QueryLastTokenizeShareRecordIdRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryLastTokenizeShareRecordIdRequest { + fromPartial(_: Partial): QueryLastTokenizeShareRecordIdRequest { const message = createBaseQueryLastTokenizeShareRecordIdRequest(); return message; }, }; function createBaseQueryLastTokenizeShareRecordIdResponse(): QueryLastTokenizeShareRecordIdResponse { return { - id: Long.UZERO, + id: BigInt(0), }; } export const QueryLastTokenizeShareRecordIdResponse = { encode( message: QueryLastTokenizeShareRecordIdResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (!message.id.isZero()) { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryLastTokenizeShareRecordIdResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryLastTokenizeShareRecordIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryLastTokenizeShareRecordIdResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; + message.id = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -2435,20 +2431,20 @@ export const QueryLastTokenizeShareRecordIdResponse = { }, fromJSON(object: any): QueryLastTokenizeShareRecordIdResponse { const obj = createBaseQueryLastTokenizeShareRecordIdResponse(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); return obj; }, toJSON(message: QueryLastTokenizeShareRecordIdResponse): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryLastTokenizeShareRecordIdResponse { const message = createBaseQueryLastTokenizeShareRecordIdResponse(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } return message; }, @@ -2457,11 +2453,14 @@ function createBaseQueryTotalTokenizeSharedAssetsRequest(): QueryTotalTokenizeSh return {}; } export const QueryTotalTokenizeSharedAssetsRequest = { - encode(_: QueryTotalTokenizeSharedAssetsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: QueryTotalTokenizeSharedAssetsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalTokenizeSharedAssetsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalTokenizeSharedAssetsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalTokenizeSharedAssetsRequest(); while (reader.pos < end) { @@ -2482,9 +2481,7 @@ export const QueryTotalTokenizeSharedAssetsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryTotalTokenizeSharedAssetsRequest { + fromPartial(_: Partial): QueryTotalTokenizeSharedAssetsRequest { const message = createBaseQueryTotalTokenizeSharedAssetsRequest(); return message; }, @@ -2497,15 +2494,15 @@ function createBaseQueryTotalTokenizeSharedAssetsResponse(): QueryTotalTokenizeS export const QueryTotalTokenizeSharedAssetsResponse = { encode( message: QueryTotalTokenizeSharedAssetsResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.value !== undefined) { Coin.encode(message.value, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalTokenizeSharedAssetsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalTokenizeSharedAssetsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalTokenizeSharedAssetsResponse(); while (reader.pos < end) { @@ -2531,8 +2528,8 @@ export const QueryTotalTokenizeSharedAssetsResponse = { message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryTotalTokenizeSharedAssetsResponse { const message = createBaseQueryTotalTokenizeSharedAssetsResponse(); if (object.value !== undefined && object.value !== null) { @@ -2545,11 +2542,11 @@ function createBaseQueryTotalLiquidStaked(): QueryTotalLiquidStaked { return {}; } export const QueryTotalLiquidStaked = { - encode(_: QueryTotalLiquidStaked, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryTotalLiquidStaked, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalLiquidStaked { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalLiquidStaked { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalLiquidStaked(); while (reader.pos < end) { @@ -2570,7 +2567,7 @@ export const QueryTotalLiquidStaked = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryTotalLiquidStaked { + fromPartial(_: Partial): QueryTotalLiquidStaked { const message = createBaseQueryTotalLiquidStaked(); return message; }, @@ -2581,14 +2578,17 @@ function createBaseQueryTotalLiquidStakedResponse(): QueryTotalLiquidStakedRespo }; } export const QueryTotalLiquidStakedResponse = { - encode(message: QueryTotalLiquidStakedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalLiquidStakedResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.tokens !== "") { writer.uint32(10).string(message.tokens); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalLiquidStakedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalLiquidStakedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalLiquidStakedResponse(); while (reader.pos < end) { @@ -2614,9 +2614,7 @@ export const QueryTotalLiquidStakedResponse = { message.tokens !== undefined && (obj.tokens = message.tokens); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalLiquidStakedResponse { + fromPartial(object: Partial): QueryTotalLiquidStakedResponse { const message = createBaseQueryTotalLiquidStakedResponse(); message.tokens = object.tokens ?? ""; return message; @@ -2628,14 +2626,14 @@ function createBaseQueryTokenizeShareLockInfo(): QueryTokenizeShareLockInfo { }; } export const QueryTokenizeShareLockInfo = { - encode(message: QueryTokenizeShareLockInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTokenizeShareLockInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareLockInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareLockInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareLockInfo(); while (reader.pos < end) { @@ -2661,9 +2659,7 @@ export const QueryTokenizeShareLockInfo = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTokenizeShareLockInfo { + fromPartial(object: Partial): QueryTokenizeShareLockInfo { const message = createBaseQueryTokenizeShareLockInfo(); message.address = object.address ?? ""; return message; @@ -2676,7 +2672,10 @@ function createBaseQueryTokenizeShareLockInfoResponse(): QueryTokenizeShareLockI }; } export const QueryTokenizeShareLockInfoResponse = { - encode(message: QueryTokenizeShareLockInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTokenizeShareLockInfoResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); } @@ -2685,8 +2684,8 @@ export const QueryTokenizeShareLockInfoResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTokenizeShareLockInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTokenizeShareLockInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTokenizeShareLockInfoResponse(); while (reader.pos < end) { @@ -2717,9 +2716,7 @@ export const QueryTokenizeShareLockInfoResponse = { message.expirationTime !== undefined && (obj.expirationTime = message.expirationTime); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTokenizeShareLockInfoResponse { + fromPartial(object: Partial): QueryTokenizeShareLockInfoResponse { const message = createBaseQueryTokenizeShareLockInfoResponse(); message.status = object.status ?? ""; message.expirationTime = object.expirationTime ?? ""; @@ -2894,131 +2891,131 @@ export class QueryClientImpl implements Query { Validators(request: QueryValidatorsRequest): Promise { const data = QueryValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validators", data); - return promise.then((data) => QueryValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorsResponse.decode(new BinaryReader(data))); } Validator(request: QueryValidatorRequest): Promise { const data = QueryValidatorRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Validator", data); - return promise.then((data) => QueryValidatorResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorResponse.decode(new BinaryReader(data))); } ValidatorDelegations( request: QueryValidatorDelegationsRequest, ): Promise { const data = QueryValidatorDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorDelegations", data); - return promise.then((data) => QueryValidatorDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorDelegationsResponse.decode(new BinaryReader(data))); } ValidatorUnbondingDelegations( request: QueryValidatorUnbondingDelegationsRequest, ): Promise { const data = QueryValidatorUnbondingDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "ValidatorUnbondingDelegations", data); - return promise.then((data) => QueryValidatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorUnbondingDelegationsResponse.decode(new BinaryReader(data))); } Delegation(request: QueryDelegationRequest): Promise { const data = QueryDelegationRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Delegation", data); - return promise.then((data) => QueryDelegationResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegationResponse.decode(new BinaryReader(data))); } UnbondingDelegation(request: QueryUnbondingDelegationRequest): Promise { const data = QueryUnbondingDelegationRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "UnbondingDelegation", data); - return promise.then((data) => QueryUnbondingDelegationResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnbondingDelegationResponse.decode(new BinaryReader(data))); } DelegatorDelegations( request: QueryDelegatorDelegationsRequest, ): Promise { const data = QueryDelegatorDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorDelegations", data); - return promise.then((data) => QueryDelegatorDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorDelegationsResponse.decode(new BinaryReader(data))); } DelegatorUnbondingDelegations( request: QueryDelegatorUnbondingDelegationsRequest, ): Promise { const data = QueryDelegatorUnbondingDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorUnbondingDelegations", data); - return promise.then((data) => QueryDelegatorUnbondingDelegationsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorUnbondingDelegationsResponse.decode(new BinaryReader(data))); } Redelegations(request: QueryRedelegationsRequest): Promise { const data = QueryRedelegationsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Redelegations", data); - return promise.then((data) => QueryRedelegationsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryRedelegationsResponse.decode(new BinaryReader(data))); } DelegatorValidators(request: QueryDelegatorValidatorsRequest): Promise { const data = QueryDelegatorValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidators", data); - return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorValidatorsResponse.decode(new BinaryReader(data))); } DelegatorValidator(request: QueryDelegatorValidatorRequest): Promise { const data = QueryDelegatorValidatorRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "DelegatorValidator", data); - return promise.then((data) => QueryDelegatorValidatorResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorValidatorResponse.decode(new BinaryReader(data))); } HistoricalInfo(request: QueryHistoricalInfoRequest): Promise { const data = QueryHistoricalInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "HistoricalInfo", data); - return promise.then((data) => QueryHistoricalInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryHistoricalInfoResponse.decode(new BinaryReader(data))); } Pool(request: QueryPoolRequest = {}): Promise { const data = QueryPoolRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Pool", data); - return promise.then((data) => QueryPoolResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPoolResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } TokenizeShareRecordById( request: QueryTokenizeShareRecordByIdRequest, ): Promise { const data = QueryTokenizeShareRecordByIdRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "TokenizeShareRecordById", data); - return promise.then((data) => QueryTokenizeShareRecordByIdResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTokenizeShareRecordByIdResponse.decode(new BinaryReader(data))); } TokenizeShareRecordByDenom( request: QueryTokenizeShareRecordByDenomRequest, ): Promise { const data = QueryTokenizeShareRecordByDenomRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "TokenizeShareRecordByDenom", data); - return promise.then((data) => QueryTokenizeShareRecordByDenomResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTokenizeShareRecordByDenomResponse.decode(new BinaryReader(data))); } TokenizeShareRecordsOwned( request: QueryTokenizeShareRecordsOwnedRequest, ): Promise { const data = QueryTokenizeShareRecordsOwnedRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "TokenizeShareRecordsOwned", data); - return promise.then((data) => QueryTokenizeShareRecordsOwnedResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTokenizeShareRecordsOwnedResponse.decode(new BinaryReader(data))); } AllTokenizeShareRecords( request: QueryAllTokenizeShareRecordsRequest = {}, ): Promise { const data = QueryAllTokenizeShareRecordsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "AllTokenizeShareRecords", data); - return promise.then((data) => QueryAllTokenizeShareRecordsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllTokenizeShareRecordsResponse.decode(new BinaryReader(data))); } LastTokenizeShareRecordId( request: QueryLastTokenizeShareRecordIdRequest = {}, ): Promise { const data = QueryLastTokenizeShareRecordIdRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "LastTokenizeShareRecordId", data); - return promise.then((data) => QueryLastTokenizeShareRecordIdResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryLastTokenizeShareRecordIdResponse.decode(new BinaryReader(data))); } TotalTokenizeSharedAssets( request: QueryTotalTokenizeSharedAssetsRequest = {}, ): Promise { const data = QueryTotalTokenizeSharedAssetsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "TotalTokenizeSharedAssets", data); - return promise.then((data) => QueryTotalTokenizeSharedAssetsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalTokenizeSharedAssetsResponse.decode(new BinaryReader(data))); } TotalLiquidStaked(request: QueryTotalLiquidStaked = {}): Promise { const data = QueryTotalLiquidStaked.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "TotalLiquidStaked", data); - return promise.then((data) => QueryTotalLiquidStakedResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalLiquidStakedResponse.decode(new BinaryReader(data))); } TokenizeShareLockInfo(request: QueryTokenizeShareLockInfo): Promise { const data = QueryTokenizeShareLockInfo.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Query", "TokenizeShareLockInfo", data); - return promise.then((data) => QueryTokenizeShareLockInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTokenizeShareLockInfoResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/staking/v1beta1/staking.ts b/src/cosmos/staking/v1beta1/staking.ts index 60f61c3..1c131ee 100644 --- a/src/cosmos/staking/v1beta1/staking.ts +++ b/src/cosmos/staking/v1beta1/staking.ts @@ -1,3 +1,4 @@ +//@ts-nocheck /* eslint-disable */ import { Header } from "../../../tendermint/types/types"; import { Timestamp } from "../../../google/protobuf/timestamp"; @@ -5,8 +6,8 @@ import { Any } from "../../../google/protobuf/any"; import { Duration } from "../../../google/protobuf/duration"; import { Coin } from "../../base/v1beta1/coin"; import { ValidatorUpdate } from "../../../tendermint/abci/types"; -import { Long, isSet, DeepPartial, Exact, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.staking.v1beta1"; /** BondStatus is the status of a validator. */ export enum BondStatus { @@ -214,7 +215,7 @@ export interface Validator { /** description defines the description terms for the validator. */ description: Description; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ - unbondingHeight: Long; + unbondingHeight: bigint; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ unbondingTime: Timestamp; /** commission defines the commission parameters. */ @@ -227,13 +228,13 @@ export interface Validator { * * Since: cosmos-sdk 0.47 */ - unbondingOnHoldRefCount: Long; + unbondingOnHoldRefCount: bigint; /** * list of unbonding ids, each uniquely identifing an unbonding of this validator * * Since: cosmos-sdk 0.47 */ - unbondingIds: Long[]; + unbondingIds: bigint[]; /** * validator_bond_shares is the number of shares self bonded from the validator. * @@ -313,7 +314,7 @@ export interface UnbondingDelegation { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntry { /** creation_height is the height which the unbonding took place. */ - creationHeight: Long; + creationHeight: bigint; /** completion_time is the unix time for unbonding completion. */ completionTime: Timestamp; /** initial_balance defines the tokens initially scheduled to receive at completion. */ @@ -321,9 +322,9 @@ export interface UnbondingDelegationEntry { /** balance defines the tokens to receive at completion. */ balance: string; /** Incrementing id that uniquely identifies this entry */ - unbondingId: Long; + unbondingId: bigint; /** Strictly positive if this entry's unbonding has been stopped by external modules */ - unbondingOnHoldRefCount: Long; + unbondingOnHoldRefCount: bigint; /** * validator_bond_factor is required for tokenize share and undelegation check for network safety * @@ -341,7 +342,7 @@ export interface UnbondingDelegationEntry { /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntry { /** creation_height defines the height which the redelegation took place. */ - creationHeight: Long; + creationHeight: bigint; /** completion_time defines the unix time for redelegation completion. */ completionTime: Timestamp; /** initial_balance defines the initial balance when redelegation started. */ @@ -349,9 +350,9 @@ export interface RedelegationEntry { /** shares_dst is the amount of destination-validator shares created by redelegation. */ sharesDst: string; /** Incrementing id that uniquely identifies this entry */ - unbondingId: Long; + unbondingId: bigint; /** Strictly positive if this entry's unbonding has been stopped by external modules */ - unbondingOnHoldRefCount: Long; + unbondingOnHoldRefCount: bigint; } /** * Redelegation contains the list of a particular delegator's redelegating bonds @@ -444,7 +445,7 @@ export interface ValidatorUpdates { * Since: cosmos-sdk 0.47-lsm */ export interface TokenizeShareRecord { - id: Long; + id: bigint; owner: string; /** module account take the role of delegator */ moduleAccount: string; @@ -466,7 +467,7 @@ function createBaseHistoricalInfo(): HistoricalInfo { }; } export const HistoricalInfo = { - encode(message: HistoricalInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -475,8 +476,8 @@ export const HistoricalInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HistoricalInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHistoricalInfo(); while (reader.pos < end) { @@ -511,7 +512,7 @@ export const HistoricalInfo = { } return obj; }, - fromPartial, I>>(object: I): HistoricalInfo { + fromPartial(object: Partial): HistoricalInfo { const message = createBaseHistoricalInfo(); if (object.header !== undefined && object.header !== null) { message.header = Header.fromPartial(object.header); @@ -528,7 +529,7 @@ function createBaseCommissionRates(): CommissionRates { }; } export const CommissionRates = { - encode(message: CommissionRates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rate !== "") { writer.uint32(10).string(message.rate); } @@ -540,8 +541,8 @@ export const CommissionRates = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommissionRates { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommissionRates(); while (reader.pos < end) { @@ -577,7 +578,7 @@ export const CommissionRates = { message.maxChangeRate !== undefined && (obj.maxChangeRate = message.maxChangeRate); return obj; }, - fromPartial, I>>(object: I): CommissionRates { + fromPartial(object: Partial): CommissionRates { const message = createBaseCommissionRates(); message.rate = object.rate ?? ""; message.maxRate = object.maxRate ?? ""; @@ -592,7 +593,7 @@ function createBaseCommission(): Commission { }; } export const Commission = { - encode(message: Commission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commissionRates !== undefined) { CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim(); } @@ -601,8 +602,8 @@ export const Commission = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Commission { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Commission { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommission(); while (reader.pos < end) { @@ -636,7 +637,7 @@ export const Commission = { message.updateTime !== undefined && (obj.updateTime = fromTimestamp(message.updateTime).toISOString()); return obj; }, - fromPartial, I>>(object: I): Commission { + fromPartial(object: Partial): Commission { const message = createBaseCommission(); if (object.commissionRates !== undefined && object.commissionRates !== null) { message.commissionRates = CommissionRates.fromPartial(object.commissionRates); @@ -657,7 +658,7 @@ function createBaseDescription(): Description { }; } export const Description = { - encode(message: Description, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moniker !== "") { writer.uint32(10).string(message.moniker); } @@ -675,8 +676,8 @@ export const Description = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Description { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Description { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescription(); while (reader.pos < end) { @@ -722,7 +723,7 @@ export const Description = { message.details !== undefined && (obj.details = message.details); return obj; }, - fromPartial, I>>(object: I): Description { + fromPartial(object: Partial): Description { const message = createBaseDescription(); message.moniker = object.moniker ?? ""; message.identity = object.identity ?? ""; @@ -741,18 +742,18 @@ function createBaseValidator(): Validator { tokens: "", delegatorShares: "", description: Description.fromPartial({}), - unbondingHeight: Long.ZERO, + unbondingHeight: BigInt(0), unbondingTime: Timestamp.fromPartial({}), commission: Commission.fromPartial({}), minSelfDelegation: "", - unbondingOnHoldRefCount: Long.ZERO, + unbondingOnHoldRefCount: BigInt(0), unbondingIds: [], validatorBondShares: "", liquidShares: "", }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.operatorAddress !== "") { writer.uint32(10).string(message.operatorAddress); } @@ -774,7 +775,7 @@ export const Validator = { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(58).fork()).ldelim(); } - if (!message.unbondingHeight.isZero()) { + if (message.unbondingHeight !== BigInt(0)) { writer.uint32(64).int64(message.unbondingHeight); } if (message.unbondingTime !== undefined) { @@ -786,7 +787,7 @@ export const Validator = { if (message.minSelfDelegation !== "") { writer.uint32(90).string(message.minSelfDelegation); } - if (!message.unbondingOnHoldRefCount.isZero()) { + if (message.unbondingOnHoldRefCount !== BigInt(0)) { writer.uint32(96).int64(message.unbondingOnHoldRefCount); } writer.uint32(106).fork(); @@ -802,8 +803,8 @@ export const Validator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -831,7 +832,7 @@ export const Validator = { message.description = Description.decode(reader, reader.uint32()); break; case 8: - message.unbondingHeight = reader.int64() as Long; + message.unbondingHeight = reader.int64(); break; case 9: message.unbondingTime = Timestamp.decode(reader, reader.uint32()); @@ -843,16 +844,16 @@ export const Validator = { message.minSelfDelegation = reader.string(); break; case 12: - message.unbondingOnHoldRefCount = reader.int64() as Long; + message.unbondingOnHoldRefCount = reader.int64(); break; case 13: if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.unbondingIds.push(reader.uint64() as Long); + message.unbondingIds.push(reader.uint64()); } } else { - message.unbondingIds.push(reader.uint64() as Long); + message.unbondingIds.push(reader.uint64()); } break; case 14: @@ -877,14 +878,14 @@ export const Validator = { if (isSet(object.tokens)) obj.tokens = String(object.tokens); if (isSet(object.delegatorShares)) obj.delegatorShares = String(object.delegatorShares); if (isSet(object.description)) obj.description = Description.fromJSON(object.description); - if (isSet(object.unbondingHeight)) obj.unbondingHeight = Long.fromValue(object.unbondingHeight); + if (isSet(object.unbondingHeight)) obj.unbondingHeight = BigInt(object.unbondingHeight.toString()); if (isSet(object.unbondingTime)) obj.unbondingTime = fromJsonTimestamp(object.unbondingTime); if (isSet(object.commission)) obj.commission = Commission.fromJSON(object.commission); if (isSet(object.minSelfDelegation)) obj.minSelfDelegation = String(object.minSelfDelegation); if (isSet(object.unbondingOnHoldRefCount)) - obj.unbondingOnHoldRefCount = Long.fromValue(object.unbondingOnHoldRefCount); + obj.unbondingOnHoldRefCount = BigInt(object.unbondingOnHoldRefCount.toString()); if (Array.isArray(object?.unbondingIds)) - obj.unbondingIds = object.unbondingIds.map((e: any) => Long.fromValue(e)); + obj.unbondingIds = object.unbondingIds.map((e: any) => BigInt(e.toString())); if (isSet(object.validatorBondShares)) obj.validatorBondShares = String(object.validatorBondShares); if (isSet(object.liquidShares)) obj.liquidShares = String(object.liquidShares); return obj; @@ -901,16 +902,16 @@ export const Validator = { message.description !== undefined && (obj.description = message.description ? Description.toJSON(message.description) : undefined); message.unbondingHeight !== undefined && - (obj.unbondingHeight = (message.unbondingHeight || Long.ZERO).toString()); + (obj.unbondingHeight = (message.unbondingHeight || BigInt(0)).toString()); message.unbondingTime !== undefined && (obj.unbondingTime = fromTimestamp(message.unbondingTime).toISOString()); message.commission !== undefined && (obj.commission = message.commission ? Commission.toJSON(message.commission) : undefined); message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); message.unbondingOnHoldRefCount !== undefined && - (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || Long.ZERO).toString()); + (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || BigInt(0)).toString()); if (message.unbondingIds) { - obj.unbondingIds = message.unbondingIds.map((e) => (e || Long.UZERO).toString()); + obj.unbondingIds = message.unbondingIds.map((e) => (e || BigInt(0)).toString()); } else { obj.unbondingIds = []; } @@ -918,7 +919,7 @@ export const Validator = { message.liquidShares !== undefined && (obj.liquidShares = message.liquidShares); return obj; }, - fromPartial, I>>(object: I): Validator { + fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.operatorAddress = object.operatorAddress ?? ""; if (object.consensusPubkey !== undefined && object.consensusPubkey !== null) { @@ -932,7 +933,7 @@ export const Validator = { message.description = Description.fromPartial(object.description); } if (object.unbondingHeight !== undefined && object.unbondingHeight !== null) { - message.unbondingHeight = Long.fromValue(object.unbondingHeight); + message.unbondingHeight = BigInt(object.unbondingHeight.toString()); } if (object.unbondingTime !== undefined && object.unbondingTime !== null) { message.unbondingTime = Timestamp.fromPartial(object.unbondingTime); @@ -942,9 +943,9 @@ export const Validator = { } message.minSelfDelegation = object.minSelfDelegation ?? ""; if (object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null) { - message.unbondingOnHoldRefCount = Long.fromValue(object.unbondingOnHoldRefCount); + message.unbondingOnHoldRefCount = BigInt(object.unbondingOnHoldRefCount.toString()); } - message.unbondingIds = object.unbondingIds?.map((e) => Long.fromValue(e)) || []; + message.unbondingIds = object.unbondingIds?.map((e) => BigInt(e.toString())) || []; message.validatorBondShares = object.validatorBondShares ?? ""; message.liquidShares = object.liquidShares ?? ""; return message; @@ -956,14 +957,14 @@ function createBaseValAddresses(): ValAddresses { }; } export const ValAddresses = { - encode(message: ValAddresses, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.addresses) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValAddresses { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValAddresses(); while (reader.pos < end) { @@ -993,7 +994,7 @@ export const ValAddresses = { } return obj; }, - fromPartial, I>>(object: I): ValAddresses { + fromPartial(object: Partial): ValAddresses { const message = createBaseValAddresses(); message.addresses = object.addresses?.map((e) => e) || []; return message; @@ -1006,7 +1007,7 @@ function createBaseDVPair(): DVPair { }; } export const DVPair = { - encode(message: DVPair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1015,8 +1016,8 @@ export const DVPair = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVPair { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVPair(); while (reader.pos < end) { @@ -1047,7 +1048,7 @@ export const DVPair = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>(object: I): DVPair { + fromPartial(object: Partial): DVPair { const message = createBaseDVPair(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -1060,14 +1061,14 @@ function createBaseDVPairs(): DVPairs { }; } export const DVPairs = { - encode(message: DVPairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pairs) { DVPair.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVPairs { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVPairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVPairs(); while (reader.pos < end) { @@ -1097,7 +1098,7 @@ export const DVPairs = { } return obj; }, - fromPartial, I>>(object: I): DVPairs { + fromPartial(object: Partial): DVPairs { const message = createBaseDVPairs(); message.pairs = object.pairs?.map((e) => DVPair.fromPartial(e)) || []; return message; @@ -1111,7 +1112,7 @@ function createBaseDVVTriplet(): DVVTriplet { }; } export const DVVTriplet = { - encode(message: DVVTriplet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1123,8 +1124,8 @@ export const DVVTriplet = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVVTriplet(); while (reader.pos < end) { @@ -1160,7 +1161,7 @@ export const DVVTriplet = { message.validatorDstAddress !== undefined && (obj.validatorDstAddress = message.validatorDstAddress); return obj; }, - fromPartial, I>>(object: I): DVVTriplet { + fromPartial(object: Partial): DVVTriplet { const message = createBaseDVVTriplet(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorSrcAddress = object.validatorSrcAddress ?? ""; @@ -1174,14 +1175,14 @@ function createBaseDVVTriplets(): DVVTriplets { }; } export const DVVTriplets = { - encode(message: DVVTriplets, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.triplets) { DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DVVTriplets { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDVVTriplets(); while (reader.pos < end) { @@ -1212,7 +1213,7 @@ export const DVVTriplets = { } return obj; }, - fromPartial, I>>(object: I): DVVTriplets { + fromPartial(object: Partial): DVVTriplets { const message = createBaseDVVTriplets(); message.triplets = object.triplets?.map((e) => DVVTriplet.fromPartial(e)) || []; return message; @@ -1227,7 +1228,7 @@ function createBaseDelegation(): Delegation { }; } export const Delegation = { - encode(message: Delegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Delegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1242,8 +1243,8 @@ export const Delegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Delegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Delegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegation(); while (reader.pos < end) { @@ -1284,7 +1285,7 @@ export const Delegation = { message.validatorBond !== undefined && (obj.validatorBond = message.validatorBond); return obj; }, - fromPartial, I>>(object: I): Delegation { + fromPartial(object: Partial): Delegation { const message = createBaseDelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -1301,7 +1302,7 @@ function createBaseUnbondingDelegation(): UnbondingDelegation { }; } export const UnbondingDelegation = { - encode(message: UnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1313,8 +1314,8 @@ export const UnbondingDelegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnbondingDelegation(); while (reader.pos < end) { @@ -1355,7 +1356,7 @@ export const UnbondingDelegation = { } return obj; }, - fromPartial, I>>(object: I): UnbondingDelegation { + fromPartial(object: Partial): UnbondingDelegation { const message = createBaseUnbondingDelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -1365,19 +1366,19 @@ export const UnbondingDelegation = { }; function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry { return { - creationHeight: Long.ZERO, + creationHeight: BigInt(0), completionTime: Timestamp.fromPartial({}), initialBalance: "", balance: "", - unbondingId: Long.UZERO, - unbondingOnHoldRefCount: Long.ZERO, + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0), validatorBondFactor: "", globalLiquidStakingCap: "", }; } export const UnbondingDelegationEntry = { - encode(message: UnbondingDelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.creationHeight.isZero()) { + encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { writer.uint32(8).int64(message.creationHeight); } if (message.completionTime !== undefined) { @@ -1389,10 +1390,10 @@ export const UnbondingDelegationEntry = { if (message.balance !== "") { writer.uint32(34).string(message.balance); } - if (!message.unbondingId.isZero()) { + if (message.unbondingId !== BigInt(0)) { writer.uint32(40).uint64(message.unbondingId); } - if (!message.unbondingOnHoldRefCount.isZero()) { + if (message.unbondingOnHoldRefCount !== BigInt(0)) { writer.uint32(48).int64(message.unbondingOnHoldRefCount); } if (message.validatorBondFactor !== "") { @@ -1403,15 +1404,15 @@ export const UnbondingDelegationEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingDelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnbondingDelegationEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creationHeight = reader.int64() as Long; + message.creationHeight = reader.int64(); break; case 2: message.completionTime = Timestamp.decode(reader, reader.uint32()); @@ -1423,10 +1424,10 @@ export const UnbondingDelegationEntry = { message.balance = reader.string(); break; case 5: - message.unbondingId = reader.uint64() as Long; + message.unbondingId = reader.uint64(); break; case 6: - message.unbondingOnHoldRefCount = reader.int64() as Long; + message.unbondingOnHoldRefCount = reader.int64(); break; case 7: message.validatorBondFactor = reader.string(); @@ -1443,13 +1444,13 @@ export const UnbondingDelegationEntry = { }, fromJSON(object: any): UnbondingDelegationEntry { const obj = createBaseUnbondingDelegationEntry(); - if (isSet(object.creationHeight)) obj.creationHeight = Long.fromValue(object.creationHeight); + if (isSet(object.creationHeight)) obj.creationHeight = BigInt(object.creationHeight.toString()); if (isSet(object.completionTime)) obj.completionTime = fromJsonTimestamp(object.completionTime); if (isSet(object.initialBalance)) obj.initialBalance = String(object.initialBalance); if (isSet(object.balance)) obj.balance = String(object.balance); - if (isSet(object.unbondingId)) obj.unbondingId = Long.fromValue(object.unbondingId); + if (isSet(object.unbondingId)) obj.unbondingId = BigInt(object.unbondingId.toString()); if (isSet(object.unbondingOnHoldRefCount)) - obj.unbondingOnHoldRefCount = Long.fromValue(object.unbondingOnHoldRefCount); + obj.unbondingOnHoldRefCount = BigInt(object.unbondingOnHoldRefCount.toString()); if (isSet(object.validatorBondFactor)) obj.validatorBondFactor = String(object.validatorBondFactor); if (isSet(object.globalLiquidStakingCap)) obj.globalLiquidStakingCap = String(object.globalLiquidStakingCap); @@ -1458,25 +1459,23 @@ export const UnbondingDelegationEntry = { toJSON(message: UnbondingDelegationEntry): unknown { const obj: any = {}; message.creationHeight !== undefined && - (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); message.completionTime !== undefined && (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); message.balance !== undefined && (obj.balance = message.balance); - message.unbondingId !== undefined && (obj.unbondingId = (message.unbondingId || Long.UZERO).toString()); + message.unbondingId !== undefined && (obj.unbondingId = (message.unbondingId || BigInt(0)).toString()); message.unbondingOnHoldRefCount !== undefined && - (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || Long.ZERO).toString()); + (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || BigInt(0)).toString()); message.validatorBondFactor !== undefined && (obj.validatorBondFactor = message.validatorBondFactor); message.globalLiquidStakingCap !== undefined && (obj.globalLiquidStakingCap = message.globalLiquidStakingCap); return obj; }, - fromPartial, I>>( - object: I, - ): UnbondingDelegationEntry { + fromPartial(object: Partial): UnbondingDelegationEntry { const message = createBaseUnbondingDelegationEntry(); if (object.creationHeight !== undefined && object.creationHeight !== null) { - message.creationHeight = Long.fromValue(object.creationHeight); + message.creationHeight = BigInt(object.creationHeight.toString()); } if (object.completionTime !== undefined && object.completionTime !== null) { message.completionTime = Timestamp.fromPartial(object.completionTime); @@ -1484,10 +1483,10 @@ export const UnbondingDelegationEntry = { message.initialBalance = object.initialBalance ?? ""; message.balance = object.balance ?? ""; if (object.unbondingId !== undefined && object.unbondingId !== null) { - message.unbondingId = Long.fromValue(object.unbondingId); + message.unbondingId = BigInt(object.unbondingId.toString()); } if (object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null) { - message.unbondingOnHoldRefCount = Long.fromValue(object.unbondingOnHoldRefCount); + message.unbondingOnHoldRefCount = BigInt(object.unbondingOnHoldRefCount.toString()); } message.validatorBondFactor = object.validatorBondFactor ?? ""; message.globalLiquidStakingCap = object.globalLiquidStakingCap ?? ""; @@ -1496,17 +1495,17 @@ export const UnbondingDelegationEntry = { }; function createBaseRedelegationEntry(): RedelegationEntry { return { - creationHeight: Long.ZERO, + creationHeight: BigInt(0), completionTime: Timestamp.fromPartial({}), initialBalance: "", sharesDst: "", - unbondingId: Long.UZERO, - unbondingOnHoldRefCount: Long.ZERO, + unbondingId: BigInt(0), + unbondingOnHoldRefCount: BigInt(0), }; } export const RedelegationEntry = { - encode(message: RedelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.creationHeight.isZero()) { + encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creationHeight !== BigInt(0)) { writer.uint32(8).int64(message.creationHeight); } if (message.completionTime !== undefined) { @@ -1518,23 +1517,23 @@ export const RedelegationEntry = { if (message.sharesDst !== "") { writer.uint32(34).string(message.sharesDst); } - if (!message.unbondingId.isZero()) { + if (message.unbondingId !== BigInt(0)) { writer.uint32(40).uint64(message.unbondingId); } - if (!message.unbondingOnHoldRefCount.isZero()) { + if (message.unbondingOnHoldRefCount !== BigInt(0)) { writer.uint32(48).int64(message.unbondingOnHoldRefCount); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegationEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.creationHeight = reader.int64() as Long; + message.creationHeight = reader.int64(); break; case 2: message.completionTime = Timestamp.decode(reader, reader.uint32()); @@ -1546,10 +1545,10 @@ export const RedelegationEntry = { message.sharesDst = reader.string(); break; case 5: - message.unbondingId = reader.uint64() as Long; + message.unbondingId = reader.uint64(); break; case 6: - message.unbondingOnHoldRefCount = reader.int64() as Long; + message.unbondingOnHoldRefCount = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1560,32 +1559,32 @@ export const RedelegationEntry = { }, fromJSON(object: any): RedelegationEntry { const obj = createBaseRedelegationEntry(); - if (isSet(object.creationHeight)) obj.creationHeight = Long.fromValue(object.creationHeight); + if (isSet(object.creationHeight)) obj.creationHeight = BigInt(object.creationHeight.toString()); if (isSet(object.completionTime)) obj.completionTime = fromJsonTimestamp(object.completionTime); if (isSet(object.initialBalance)) obj.initialBalance = String(object.initialBalance); if (isSet(object.sharesDst)) obj.sharesDst = String(object.sharesDst); - if (isSet(object.unbondingId)) obj.unbondingId = Long.fromValue(object.unbondingId); + if (isSet(object.unbondingId)) obj.unbondingId = BigInt(object.unbondingId.toString()); if (isSet(object.unbondingOnHoldRefCount)) - obj.unbondingOnHoldRefCount = Long.fromValue(object.unbondingOnHoldRefCount); + obj.unbondingOnHoldRefCount = BigInt(object.unbondingOnHoldRefCount.toString()); return obj; }, toJSON(message: RedelegationEntry): unknown { const obj: any = {}; message.creationHeight !== undefined && - (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); message.completionTime !== undefined && (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); message.initialBalance !== undefined && (obj.initialBalance = message.initialBalance); message.sharesDst !== undefined && (obj.sharesDst = message.sharesDst); - message.unbondingId !== undefined && (obj.unbondingId = (message.unbondingId || Long.UZERO).toString()); + message.unbondingId !== undefined && (obj.unbondingId = (message.unbondingId || BigInt(0)).toString()); message.unbondingOnHoldRefCount !== undefined && - (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || Long.ZERO).toString()); + (obj.unbondingOnHoldRefCount = (message.unbondingOnHoldRefCount || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): RedelegationEntry { + fromPartial(object: Partial): RedelegationEntry { const message = createBaseRedelegationEntry(); if (object.creationHeight !== undefined && object.creationHeight !== null) { - message.creationHeight = Long.fromValue(object.creationHeight); + message.creationHeight = BigInt(object.creationHeight.toString()); } if (object.completionTime !== undefined && object.completionTime !== null) { message.completionTime = Timestamp.fromPartial(object.completionTime); @@ -1593,10 +1592,10 @@ export const RedelegationEntry = { message.initialBalance = object.initialBalance ?? ""; message.sharesDst = object.sharesDst ?? ""; if (object.unbondingId !== undefined && object.unbondingId !== null) { - message.unbondingId = Long.fromValue(object.unbondingId); + message.unbondingId = BigInt(object.unbondingId.toString()); } if (object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null) { - message.unbondingOnHoldRefCount = Long.fromValue(object.unbondingOnHoldRefCount); + message.unbondingOnHoldRefCount = BigInt(object.unbondingOnHoldRefCount.toString()); } return message; }, @@ -1610,7 +1609,7 @@ function createBaseRedelegation(): Redelegation { }; } export const Redelegation = { - encode(message: Redelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1625,8 +1624,8 @@ export const Redelegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Redelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegation(); while (reader.pos < end) { @@ -1672,7 +1671,7 @@ export const Redelegation = { } return obj; }, - fromPartial, I>>(object: I): Redelegation { + fromPartial(object: Partial): Redelegation { const message = createBaseRedelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorSrcAddress = object.validatorSrcAddress ?? ""; @@ -1695,7 +1694,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.unbondingTime !== undefined) { Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim(); } @@ -1725,8 +1724,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -1798,7 +1797,7 @@ export const Params = { (obj.validatorLiquidStakingCap = message.validatorLiquidStakingCap); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); if (object.unbondingTime !== undefined && object.unbondingTime !== null) { message.unbondingTime = Duration.fromPartial(object.unbondingTime); @@ -1821,7 +1820,7 @@ function createBaseDelegationResponse(): DelegationResponse { }; } export const DelegationResponse = { - encode(message: DelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegation !== undefined) { Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim(); } @@ -1830,8 +1829,8 @@ export const DelegationResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegationResponse(); while (reader.pos < end) { @@ -1864,7 +1863,7 @@ export const DelegationResponse = { (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial, I>>(object: I): DelegationResponse { + fromPartial(object: Partial): DelegationResponse { const message = createBaseDelegationResponse(); if (object.delegation !== undefined && object.delegation !== null) { message.delegation = Delegation.fromPartial(object.delegation); @@ -1882,7 +1881,7 @@ function createBaseRedelegationEntryResponse(): RedelegationEntryResponse { }; } export const RedelegationEntryResponse = { - encode(message: RedelegationEntryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.redelegationEntry !== undefined) { RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim(); } @@ -1891,8 +1890,8 @@ export const RedelegationEntryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationEntryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegationEntryResponse(); while (reader.pos < end) { @@ -1927,9 +1926,7 @@ export const RedelegationEntryResponse = { message.balance !== undefined && (obj.balance = message.balance); return obj; }, - fromPartial, I>>( - object: I, - ): RedelegationEntryResponse { + fromPartial(object: Partial): RedelegationEntryResponse { const message = createBaseRedelegationEntryResponse(); if (object.redelegationEntry !== undefined && object.redelegationEntry !== null) { message.redelegationEntry = RedelegationEntry.fromPartial(object.redelegationEntry); @@ -1945,7 +1942,7 @@ function createBaseRedelegationResponse(): RedelegationResponse { }; } export const RedelegationResponse = { - encode(message: RedelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.redelegation !== undefined) { Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim(); } @@ -1954,8 +1951,8 @@ export const RedelegationResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RedelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedelegationResponse(); while (reader.pos < end) { @@ -1992,7 +1989,7 @@ export const RedelegationResponse = { } return obj; }, - fromPartial, I>>(object: I): RedelegationResponse { + fromPartial(object: Partial): RedelegationResponse { const message = createBaseRedelegationResponse(); if (object.redelegation !== undefined && object.redelegation !== null) { message.redelegation = Redelegation.fromPartial(object.redelegation); @@ -2008,7 +2005,7 @@ function createBasePool(): Pool { }; } export const Pool = { - encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.notBondedTokens !== "") { writer.uint32(10).string(message.notBondedTokens); } @@ -2017,8 +2014,8 @@ export const Pool = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Pool { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Pool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePool(); while (reader.pos < end) { @@ -2049,7 +2046,7 @@ export const Pool = { message.bondedTokens !== undefined && (obj.bondedTokens = message.bondedTokens); return obj; }, - fromPartial, I>>(object: I): Pool { + fromPartial(object: Partial): Pool { const message = createBasePool(); message.notBondedTokens = object.notBondedTokens ?? ""; message.bondedTokens = object.bondedTokens ?? ""; @@ -2062,14 +2059,14 @@ function createBaseValidatorUpdates(): ValidatorUpdates { }; } export const ValidatorUpdates = { - encode(message: ValidatorUpdates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorUpdates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.updates) { ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdates { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorUpdates(); while (reader.pos < end) { @@ -2100,7 +2097,7 @@ export const ValidatorUpdates = { } return obj; }, - fromPartial, I>>(object: I): ValidatorUpdates { + fromPartial(object: Partial): ValidatorUpdates { const message = createBaseValidatorUpdates(); message.updates = object.updates?.map((e) => ValidatorUpdate.fromPartial(e)) || []; return message; @@ -2108,15 +2105,15 @@ export const ValidatorUpdates = { }; function createBaseTokenizeShareRecord(): TokenizeShareRecord { return { - id: Long.UZERO, + id: BigInt(0), owner: "", moduleAccount: "", validator: "", }; } export const TokenizeShareRecord = { - encode(message: TokenizeShareRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { + encode(message: TokenizeShareRecord, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { writer.uint32(8).uint64(message.id); } if (message.owner !== "") { @@ -2130,15 +2127,15 @@ export const TokenizeShareRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TokenizeShareRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TokenizeShareRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTokenizeShareRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.uint64() as Long; + message.id = reader.uint64(); break; case 2: message.owner = reader.string(); @@ -2158,7 +2155,7 @@ export const TokenizeShareRecord = { }, fromJSON(object: any): TokenizeShareRecord { const obj = createBaseTokenizeShareRecord(); - if (isSet(object.id)) obj.id = Long.fromValue(object.id); + if (isSet(object.id)) obj.id = BigInt(object.id.toString()); if (isSet(object.owner)) obj.owner = String(object.owner); if (isSet(object.moduleAccount)) obj.moduleAccount = String(object.moduleAccount); if (isSet(object.validator)) obj.validator = String(object.validator); @@ -2166,16 +2163,16 @@ export const TokenizeShareRecord = { }, toJSON(message: TokenizeShareRecord): unknown { const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.owner !== undefined && (obj.owner = message.owner); message.moduleAccount !== undefined && (obj.moduleAccount = message.moduleAccount); message.validator !== undefined && (obj.validator = message.validator); return obj; }, - fromPartial, I>>(object: I): TokenizeShareRecord { + fromPartial(object: Partial): TokenizeShareRecord { const message = createBaseTokenizeShareRecord(); if (object.id !== undefined && object.id !== null) { - message.id = Long.fromValue(object.id); + message.id = BigInt(object.id.toString()); } message.owner = object.owner ?? ""; message.moduleAccount = object.moduleAccount ?? ""; @@ -2189,14 +2186,17 @@ function createBasePendingTokenizeShareAuthorizations(): PendingTokenizeShareAut }; } export const PendingTokenizeShareAuthorizations = { - encode(message: PendingTokenizeShareAuthorizations, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PendingTokenizeShareAuthorizations, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.addresses) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PendingTokenizeShareAuthorizations { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PendingTokenizeShareAuthorizations { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePendingTokenizeShareAuthorizations(); while (reader.pos < end) { @@ -2226,9 +2226,7 @@ export const PendingTokenizeShareAuthorizations = { } return obj; }, - fromPartial, I>>( - object: I, - ): PendingTokenizeShareAuthorizations { + fromPartial(object: Partial): PendingTokenizeShareAuthorizations { const message = createBasePendingTokenizeShareAuthorizations(); message.addresses = object.addresses?.map((e) => e) || []; return message; diff --git a/src/cosmos/staking/v1beta1/tx.amino.ts b/src/cosmos/staking/v1beta1/tx.amino.ts new file mode 100644 index 0000000..0c22cf2 --- /dev/null +++ b/src/cosmos/staking/v1beta1/tx.amino.ts @@ -0,0 +1,608 @@ +//@ts-nocheck +/* eslint-disable */ +import { AminoMsg, Pubkey } from "@cosmjs/amino"; +import { decodePubkey, encodePubkey } from "@cosmjs/proto-signing"; +import { + MsgCreateValidator, + MsgEditValidator, + MsgDelegate, + MsgBeginRedelegate, + MsgUndelegate, + MsgCancelUnbondingDelegation, + MsgUpdateParams, + MsgUnbondValidator, + MsgTokenizeShares, + MsgRedeemTokensForShares, + MsgTransferTokenizeShareRecord, + MsgDisableTokenizeShares, + MsgEnableTokenizeShares, + MsgValidatorBond, +} from "./tx"; +export interface MsgCreateValidatorAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreateValidator"; + value: { + description: { + moniker: string; + identity: string; + website: string; + security_contact: string; + details: string; + }; + commission: { + rate: string; + max_rate: string; + max_change_rate: string; + }; + min_self_delegation: string; + delegator_address: string; + validator_address: string; + pubkey: Pubkey; + value: { + denom: string; + amount: string; + }; + }; +} +export interface MsgEditValidatorAminoType extends AminoMsg { + type: "cosmos-sdk/MsgEditValidator"; + value: { + description: { + moniker: string; + identity: string; + website: string; + security_contact: string; + details: string; + }; + validator_address: string; + commission_rate: string; + min_self_delegation: string; + }; +} +export interface MsgDelegateAminoType extends AminoMsg { + type: "cosmos-sdk/MsgDelegate"; + value: { + delegator_address: string; + validator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgBeginRedelegateAminoType extends AminoMsg { + type: "cosmos-sdk/MsgBeginRedelegate"; + value: { + delegator_address: string; + validator_src_address: string; + validator_dst_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgUndelegateAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUndelegate"; + value: { + delegator_address: string; + validator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgCancelUnbondingDelegationAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegation"; + value: { + delegator_address: string; + validator_address: string; + amount: { + denom: string; + amount: string; + }; + creation_height: string; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "cosmos-sdk/x/staking/MsgUpdateParams"; + value: { + authority: string; + params: { + unbonding_time: { + seconds: string; + nanos: number; + }; + max_validators: number; + max_entries: number; + historical_entries: number; + bond_denom: string; + min_commission_rate: string; + validator_bond_factor: string; + global_liquid_staking_cap: string; + validator_liquid_staking_cap: string; + }; + }; +} +export interface MsgUnbondValidatorAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUnbondValidator"; + value: { + validator_address: string; + }; +} +export interface MsgTokenizeSharesAminoType extends AminoMsg { + type: "cosmos-sdk/MsgTokenizeShares"; + value: { + delegator_address: string; + validator_address: string; + amount: { + denom: string; + amount: string; + }; + tokenized_share_owner: string; + }; +} +export interface MsgRedeemTokensForSharesAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRedeemTokensForShares"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgTransferTokenizeShareRecordAminoType extends AminoMsg { + type: "cosmos-sdk/MsgTransferTokenizeShareRecord"; + value: { + tokenize_share_record_id: string; + sender: string; + new_owner: string; + }; +} +export interface MsgDisableTokenizeSharesAminoType extends AminoMsg { + type: "cosmos-sdk/MsgDisableTokenizeShares"; + value: { + delegator_address: string; + }; +} +export interface MsgEnableTokenizeSharesAminoType extends AminoMsg { + type: "cosmos-sdk/MsgEnableTokenizeShares"; + value: { + delegator_address: string; + }; +} +export interface MsgValidatorBondAminoType extends AminoMsg { + type: "cosmos-sdk/MsgValidatorBond"; + value: { + delegator_address: string; + validator_address: string; + }; +} +export const AminoConverter = { + "/cosmos.staking.v1beta1.MsgCreateValidator": { + aminoType: "cosmos-sdk/MsgCreateValidator", + toAmino: ({ + description, + commission, + minSelfDelegation, + delegatorAddress, + validatorAddress, + pubkey, + value, + }: MsgCreateValidator): MsgCreateValidatorAminoType["value"] => { + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + security_contact: description.securityContact, + details: description.details, + }, + commission: { + rate: commission.rate, + max_rate: commission.maxRate, + max_change_rate: commission.maxChangeRate, + }, + min_self_delegation: minSelfDelegation, + delegator_address: delegatorAddress, + validator_address: validatorAddress, + pubkey: decodePubkey(pubkey)!, + value: { + denom: value.denom, + amount: value.amount, + }, + }; + }, + fromAmino: ({ + description, + commission, + min_self_delegation, + delegator_address, + validator_address, + pubkey, + value, + }: MsgCreateValidatorAminoType["value"]): MsgCreateValidator => { + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + securityContact: description.security_contact, + details: description.details, + }, + commission: { + rate: commission.rate, + maxRate: commission.max_rate, + maxChangeRate: commission.max_change_rate, + }, + minSelfDelegation: min_self_delegation, + delegatorAddress: delegator_address, + validatorAddress: validator_address, + pubkey: encodePubkey(pubkey), + value: { + denom: value.denom, + amount: value.amount, + }, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgEditValidator": { + aminoType: "cosmos-sdk/MsgEditValidator", + toAmino: ({ + description, + validatorAddress, + commissionRate, + minSelfDelegation, + }: MsgEditValidator): MsgEditValidatorAminoType["value"] => { + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + security_contact: description.securityContact, + details: description.details, + }, + validator_address: validatorAddress, + commission_rate: commissionRate, + min_self_delegation: minSelfDelegation, + }; + }, + fromAmino: ({ + description, + validator_address, + commission_rate, + min_self_delegation, + }: MsgEditValidatorAminoType["value"]): MsgEditValidator => { + return { + description: { + moniker: description.moniker, + identity: description.identity, + website: description.website, + securityContact: description.security_contact, + details: description.details, + }, + validatorAddress: validator_address, + commissionRate: commission_rate, + minSelfDelegation: min_self_delegation, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgDelegate": { + aminoType: "cosmos-sdk/MsgDelegate", + toAmino: ({ delegatorAddress, validatorAddress, amount }: MsgDelegate): MsgDelegateAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ + delegator_address, + validator_address, + amount, + }: MsgDelegateAminoType["value"]): MsgDelegate => { + return { + delegatorAddress: delegator_address, + validatorAddress: validator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgBeginRedelegate": { + aminoType: "cosmos-sdk/MsgBeginRedelegate", + toAmino: ({ + delegatorAddress, + validatorSrcAddress, + validatorDstAddress, + amount, + }: MsgBeginRedelegate): MsgBeginRedelegateAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_src_address: validatorSrcAddress, + validator_dst_address: validatorDstAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ + delegator_address, + validator_src_address, + validator_dst_address, + amount, + }: MsgBeginRedelegateAminoType["value"]): MsgBeginRedelegate => { + return { + delegatorAddress: delegator_address, + validatorSrcAddress: validator_src_address, + validatorDstAddress: validator_dst_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgUndelegate": { + aminoType: "cosmos-sdk/MsgUndelegate", + toAmino: ({ + delegatorAddress, + validatorAddress, + amount, + }: MsgUndelegate): MsgUndelegateAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ + delegator_address, + validator_address, + amount, + }: MsgUndelegateAminoType["value"]): MsgUndelegate => { + return { + delegatorAddress: delegator_address, + validatorAddress: validator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": { + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + toAmino: ({ + delegatorAddress, + validatorAddress, + amount, + creationHeight, + }: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + creation_height: creationHeight.toString(), + }; + }, + fromAmino: ({ + delegator_address, + validator_address, + amount, + creation_height, + }: MsgCancelUnbondingDelegationAminoType["value"]): MsgCancelUnbondingDelegation => { + return { + delegatorAddress: delegator_address, + validatorAddress: validator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + creationHeight: BigInt(creation_height), + }; + }, + }, + "/cosmos.staking.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + unbonding_time: (params.unbondingTime * 1_000_000_000).toString(), + max_validators: params.maxValidators, + max_entries: params.maxEntries, + historical_entries: params.historicalEntries, + bond_denom: params.bondDenom, + min_commission_rate: params.minCommissionRate, + validator_bond_factor: params.validatorBondFactor, + global_liquid_staking_cap: params.globalLiquidStakingCap, + validator_liquid_staking_cap: params.validatorLiquidStakingCap, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + unbondingTime: { + seconds: BigInt(Math.floor(parseInt(params.unbonding_time) / 1_000_000_000)), + nanos: parseInt(params.unbonding_time) % 1_000_000_000, + }, + maxValidators: params.max_validators, + maxEntries: params.max_entries, + historicalEntries: params.historical_entries, + bondDenom: params.bond_denom, + minCommissionRate: params.min_commission_rate, + validatorBondFactor: params.validator_bond_factor, + globalLiquidStakingCap: params.global_liquid_staking_cap, + validatorLiquidStakingCap: params.validator_liquid_staking_cap, + }, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgUnbondValidator": { + aminoType: "cosmos-sdk/MsgUnbondValidator", + toAmino: ({ validatorAddress }: MsgUnbondValidator): MsgUnbondValidatorAminoType["value"] => { + return { + validator_address: validatorAddress, + }; + }, + fromAmino: ({ validator_address }: MsgUnbondValidatorAminoType["value"]): MsgUnbondValidator => { + return { + validatorAddress: validator_address, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgTokenizeShares": { + aminoType: "cosmos-sdk/MsgTokenizeShares", + toAmino: ({ + delegatorAddress, + validatorAddress, + amount, + tokenizedShareOwner, + }: MsgTokenizeShares): MsgTokenizeSharesAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + tokenized_share_owner: tokenizedShareOwner, + }; + }, + fromAmino: ({ + delegator_address, + validator_address, + amount, + tokenized_share_owner, + }: MsgTokenizeSharesAminoType["value"]): MsgTokenizeShares => { + return { + delegatorAddress: delegator_address, + validatorAddress: validator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + tokenizedShareOwner: tokenized_share_owner, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgRedeemTokensForShares": { + aminoType: "cosmos-sdk/MsgRedeemTokensForShares", + toAmino: ({ + delegatorAddress, + amount, + }: MsgRedeemTokensForShares): MsgRedeemTokensForSharesAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ + delegator_address, + amount, + }: MsgRedeemTokensForSharesAminoType["value"]): MsgRedeemTokensForShares => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord": { + aminoType: "cosmos-sdk/MsgTransferTokenizeShareRecord", + toAmino: ({ + tokenizeShareRecordId, + sender, + newOwner, + }: MsgTransferTokenizeShareRecord): MsgTransferTokenizeShareRecordAminoType["value"] => { + return { + tokenize_share_record_id: tokenizeShareRecordId.toString(), + sender, + new_owner: newOwner, + }; + }, + fromAmino: ({ + tokenize_share_record_id, + sender, + new_owner, + }: MsgTransferTokenizeShareRecordAminoType["value"]): MsgTransferTokenizeShareRecord => { + return { + tokenizeShareRecordId: BigInt(tokenize_share_record_id), + sender, + newOwner: new_owner, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgDisableTokenizeShares": { + aminoType: "cosmos-sdk/MsgDisableTokenizeShares", + toAmino: ({ delegatorAddress }: MsgDisableTokenizeShares): MsgDisableTokenizeSharesAminoType["value"] => { + return { + delegator_address: delegatorAddress, + }; + }, + fromAmino: ({ + delegator_address, + }: MsgDisableTokenizeSharesAminoType["value"]): MsgDisableTokenizeShares => { + return { + delegatorAddress: delegator_address, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgEnableTokenizeShares": { + aminoType: "cosmos-sdk/MsgEnableTokenizeShares", + toAmino: ({ delegatorAddress }: MsgEnableTokenizeShares): MsgEnableTokenizeSharesAminoType["value"] => { + return { + delegator_address: delegatorAddress, + }; + }, + fromAmino: ({ + delegator_address, + }: MsgEnableTokenizeSharesAminoType["value"]): MsgEnableTokenizeShares => { + return { + delegatorAddress: delegator_address, + }; + }, + }, + "/cosmos.staking.v1beta1.MsgValidatorBond": { + aminoType: "cosmos-sdk/MsgValidatorBond", + toAmino: ({ + delegatorAddress, + validatorAddress, + }: MsgValidatorBond): MsgValidatorBondAminoType["value"] => { + return { + delegator_address: delegatorAddress, + validator_address: validatorAddress, + }; + }, + fromAmino: ({ + delegator_address, + validator_address, + }: MsgValidatorBondAminoType["value"]): MsgValidatorBond => { + return { + delegatorAddress: delegator_address, + validatorAddress: validator_address, + }; + }, + }, +}; diff --git a/src/cosmos/staking/v1beta1/tx.registry.ts b/src/cosmos/staking/v1beta1/tx.registry.ts new file mode 100644 index 0000000..a0c5dd0 --- /dev/null +++ b/src/cosmos/staking/v1beta1/tx.registry.ts @@ -0,0 +1,472 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgCreateValidator, + MsgEditValidator, + MsgDelegate, + MsgBeginRedelegate, + MsgUndelegate, + MsgCancelUnbondingDelegation, + MsgUpdateParams, + MsgUnbondValidator, + MsgTokenizeShares, + MsgRedeemTokensForShares, + MsgTransferTokenizeShareRecord, + MsgDisableTokenizeShares, + MsgEnableTokenizeShares, + MsgValidatorBond, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], + ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], + ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], + ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], + ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], + ["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", MsgCancelUnbondingDelegation], + ["/cosmos.staking.v1beta1.MsgUpdateParams", MsgUpdateParams], + ["/cosmos.staking.v1beta1.MsgUnbondValidator", MsgUnbondValidator], + ["/cosmos.staking.v1beta1.MsgTokenizeShares", MsgTokenizeShares], + ["/cosmos.staking.v1beta1.MsgRedeemTokensForShares", MsgRedeemTokensForShares], + ["/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord", MsgTransferTokenizeShareRecord], + ["/cosmos.staking.v1beta1.MsgDisableTokenizeShares", MsgDisableTokenizeShares], + ["/cosmos.staking.v1beta1.MsgEnableTokenizeShares", MsgEnableTokenizeShares], + ["/cosmos.staking.v1beta1.MsgValidatorBond", MsgValidatorBond], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.encode(value).finish(), + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.encode(value).finish(), + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.encode(value).finish(), + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.encode(value).finish(), + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.encode(value).finish(), + }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + unbondValidator(value: MsgUnbondValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUnbondValidator", + value: MsgUnbondValidator.encode(value).finish(), + }; + }, + tokenizeShares(value: MsgTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTokenizeShares", + value: MsgTokenizeShares.encode(value).finish(), + }; + }, + redeemTokensForShares(value: MsgRedeemTokensForShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgRedeemTokensForShares", + value: MsgRedeemTokensForShares.encode(value).finish(), + }; + }, + transferTokenizeShareRecord(value: MsgTransferTokenizeShareRecord) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord", + value: MsgTransferTokenizeShareRecord.encode(value).finish(), + }; + }, + disableTokenizeShares(value: MsgDisableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDisableTokenizeShares", + value: MsgDisableTokenizeShares.encode(value).finish(), + }; + }, + enableTokenizeShares(value: MsgEnableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEnableTokenizeShares", + value: MsgEnableTokenizeShares.encode(value).finish(), + }; + }, + validatorBond(value: MsgValidatorBond) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgValidatorBond", + value: MsgValidatorBond.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value, + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value, + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value, + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value, + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value, + }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value, + }; + }, + unbondValidator(value: MsgUnbondValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUnbondValidator", + value, + }; + }, + tokenizeShares(value: MsgTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTokenizeShares", + value, + }; + }, + redeemTokensForShares(value: MsgRedeemTokensForShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgRedeemTokensForShares", + value, + }; + }, + transferTokenizeShareRecord(value: MsgTransferTokenizeShareRecord) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord", + value, + }; + }, + disableTokenizeShares(value: MsgDisableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDisableTokenizeShares", + value, + }; + }, + enableTokenizeShares(value: MsgEnableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEnableTokenizeShares", + value, + }; + }, + validatorBond(value: MsgValidatorBond) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgValidatorBond", + value, + }; + }, + }, + toJSON: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.toJSON(value), + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.toJSON(value), + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.toJSON(value), + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.toJSON(value), + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.toJSON(value), + }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + unbondValidator(value: MsgUnbondValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUnbondValidator", + value: MsgUnbondValidator.toJSON(value), + }; + }, + tokenizeShares(value: MsgTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTokenizeShares", + value: MsgTokenizeShares.toJSON(value), + }; + }, + redeemTokensForShares(value: MsgRedeemTokensForShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgRedeemTokensForShares", + value: MsgRedeemTokensForShares.toJSON(value), + }; + }, + transferTokenizeShareRecord(value: MsgTransferTokenizeShareRecord) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord", + value: MsgTransferTokenizeShareRecord.toJSON(value), + }; + }, + disableTokenizeShares(value: MsgDisableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDisableTokenizeShares", + value: MsgDisableTokenizeShares.toJSON(value), + }; + }, + enableTokenizeShares(value: MsgEnableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEnableTokenizeShares", + value: MsgEnableTokenizeShares.toJSON(value), + }; + }, + validatorBond(value: MsgValidatorBond) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgValidatorBond", + value: MsgValidatorBond.toJSON(value), + }; + }, + }, + fromJSON: { + createValidator(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.fromJSON(value), + }; + }, + editValidator(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.fromJSON(value), + }; + }, + delegate(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.fromJSON(value), + }; + }, + beginRedelegate(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.fromJSON(value), + }; + }, + undelegate(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.fromJSON(value), + }; + }, + cancelUnbondingDelegation(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + unbondValidator(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUnbondValidator", + value: MsgUnbondValidator.fromJSON(value), + }; + }, + tokenizeShares(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTokenizeShares", + value: MsgTokenizeShares.fromJSON(value), + }; + }, + redeemTokensForShares(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgRedeemTokensForShares", + value: MsgRedeemTokensForShares.fromJSON(value), + }; + }, + transferTokenizeShareRecord(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord", + value: MsgTransferTokenizeShareRecord.fromJSON(value), + }; + }, + disableTokenizeShares(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDisableTokenizeShares", + value: MsgDisableTokenizeShares.fromJSON(value), + }; + }, + enableTokenizeShares(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEnableTokenizeShares", + value: MsgEnableTokenizeShares.fromJSON(value), + }; + }, + validatorBond(value: any) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgValidatorBond", + value: MsgValidatorBond.fromJSON(value), + }; + }, + }, + fromPartial: { + createValidator(value: MsgCreateValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator", + value: MsgCreateValidator.fromPartial(value), + }; + }, + editValidator(value: MsgEditValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator", + value: MsgEditValidator.fromPartial(value), + }; + }, + delegate(value: MsgDelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDelegate", + value: MsgDelegate.fromPartial(value), + }; + }, + beginRedelegate(value: MsgBeginRedelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate", + value: MsgBeginRedelegate.fromPartial(value), + }; + }, + undelegate(value: MsgUndelegate) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", + value: MsgUndelegate.fromPartial(value), + }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + unbondValidator(value: MsgUnbondValidator) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUnbondValidator", + value: MsgUnbondValidator.fromPartial(value), + }; + }, + tokenizeShares(value: MsgTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTokenizeShares", + value: MsgTokenizeShares.fromPartial(value), + }; + }, + redeemTokensForShares(value: MsgRedeemTokensForShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgRedeemTokensForShares", + value: MsgRedeemTokensForShares.fromPartial(value), + }; + }, + transferTokenizeShareRecord(value: MsgTransferTokenizeShareRecord) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgTransferTokenizeShareRecord", + value: MsgTransferTokenizeShareRecord.fromPartial(value), + }; + }, + disableTokenizeShares(value: MsgDisableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgDisableTokenizeShares", + value: MsgDisableTokenizeShares.fromPartial(value), + }; + }, + enableTokenizeShares(value: MsgEnableTokenizeShares) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgEnableTokenizeShares", + value: MsgEnableTokenizeShares.fromPartial(value), + }; + }, + validatorBond(value: MsgValidatorBond) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgValidatorBond", + value: MsgValidatorBond.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/staking/v1beta1/tx.ts b/src/cosmos/staking/v1beta1/tx.ts index c7a649c..3033dc1 100644 --- a/src/cosmos/staking/v1beta1/tx.ts +++ b/src/cosmos/staking/v1beta1/tx.ts @@ -1,10 +1,11 @@ +//@ts-nocheck /* eslint-disable */ import { Description, CommissionRates, Params } from "./staking"; import { Any } from "../../../google/protobuf/any"; import { Coin } from "../../base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Long, isSet, DeepPartial, Exact, fromJsonTimestamp, fromTimestamp, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.staking.v1beta1"; /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidator { @@ -84,7 +85,7 @@ export interface MsgCancelUnbondingDelegation { /** amount is always less than or equal to unbonding delegation entry balance */ amount: Coin; /** creation_height is the height which the unbonding took place. */ - creationHeight: Long; + creationHeight: bigint; } /** * MsgCancelUnbondingDelegationResponse @@ -171,7 +172,7 @@ export interface MsgRedeemTokensForSharesResponse { * Since: cosmos-sdk 0.47-lsm */ export interface MsgTransferTokenizeShareRecord { - tokenizeShareRecordId: Long; + tokenizeShareRecordId: bigint; sender: string; newOwner: string; } @@ -239,7 +240,7 @@ function createBaseMsgCreateValidator(): MsgCreateValidator { }; } export const MsgCreateValidator = { - encode(message: MsgCreateValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(10).fork()).ldelim(); } @@ -263,8 +264,8 @@ export const MsgCreateValidator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateValidator(); while (reader.pos < end) { @@ -322,7 +323,7 @@ export const MsgCreateValidator = { message.value !== undefined && (obj.value = message.value ? Coin.toJSON(message.value) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgCreateValidator { + fromPartial(object: Partial): MsgCreateValidator { const message = createBaseMsgCreateValidator(); if (object.description !== undefined && object.description !== null) { message.description = Description.fromPartial(object.description); @@ -346,11 +347,11 @@ function createBaseMsgCreateValidatorResponse(): MsgCreateValidatorResponse { return {}; } export const MsgCreateValidatorResponse = { - encode(_: MsgCreateValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgCreateValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateValidatorResponse(); while (reader.pos < end) { @@ -371,7 +372,7 @@ export const MsgCreateValidatorResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgCreateValidatorResponse { + fromPartial(_: Partial): MsgCreateValidatorResponse { const message = createBaseMsgCreateValidatorResponse(); return message; }, @@ -385,7 +386,7 @@ function createBaseMsgEditValidator(): MsgEditValidator { }; } export const MsgEditValidator = { - encode(message: MsgEditValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgEditValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.description !== undefined) { Description.encode(message.description, writer.uint32(10).fork()).ldelim(); } @@ -400,8 +401,8 @@ export const MsgEditValidator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgEditValidator(); while (reader.pos < end) { @@ -443,7 +444,7 @@ export const MsgEditValidator = { message.minSelfDelegation !== undefined && (obj.minSelfDelegation = message.minSelfDelegation); return obj; }, - fromPartial, I>>(object: I): MsgEditValidator { + fromPartial(object: Partial): MsgEditValidator { const message = createBaseMsgEditValidator(); if (object.description !== undefined && object.description !== null) { message.description = Description.fromPartial(object.description); @@ -458,11 +459,11 @@ function createBaseMsgEditValidatorResponse(): MsgEditValidatorResponse { return {}; } export const MsgEditValidatorResponse = { - encode(_: MsgEditValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgEditValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgEditValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgEditValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgEditValidatorResponse(); while (reader.pos < end) { @@ -483,7 +484,7 @@ export const MsgEditValidatorResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgEditValidatorResponse { + fromPartial(_: Partial): MsgEditValidatorResponse { const message = createBaseMsgEditValidatorResponse(); return message; }, @@ -496,7 +497,7 @@ function createBaseMsgDelegate(): MsgDelegate { }; } export const MsgDelegate = { - encode(message: MsgDelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgDelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -508,8 +509,8 @@ export const MsgDelegate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDelegate(); while (reader.pos < end) { @@ -545,7 +546,7 @@ export const MsgDelegate = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgDelegate { + fromPartial(object: Partial): MsgDelegate { const message = createBaseMsgDelegate(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -559,11 +560,11 @@ function createBaseMsgDelegateResponse(): MsgDelegateResponse { return {}; } export const MsgDelegateResponse = { - encode(_: MsgDelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgDelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDelegateResponse(); while (reader.pos < end) { @@ -584,7 +585,7 @@ export const MsgDelegateResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgDelegateResponse { + fromPartial(_: Partial): MsgDelegateResponse { const message = createBaseMsgDelegateResponse(); return message; }, @@ -598,7 +599,7 @@ function createBaseMsgBeginRedelegate(): MsgBeginRedelegate { }; } export const MsgBeginRedelegate = { - encode(message: MsgBeginRedelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgBeginRedelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -613,8 +614,8 @@ export const MsgBeginRedelegate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBeginRedelegate(); while (reader.pos < end) { @@ -655,7 +656,7 @@ export const MsgBeginRedelegate = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgBeginRedelegate { + fromPartial(object: Partial): MsgBeginRedelegate { const message = createBaseMsgBeginRedelegate(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorSrcAddress = object.validatorSrcAddress ?? ""; @@ -672,14 +673,14 @@ function createBaseMsgBeginRedelegateResponse(): MsgBeginRedelegateResponse { }; } export const MsgBeginRedelegateResponse = { - encode(message: MsgBeginRedelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgBeginRedelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(message.completionTime, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgBeginRedelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgBeginRedelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgBeginRedelegateResponse(); while (reader.pos < end) { @@ -706,9 +707,7 @@ export const MsgBeginRedelegateResponse = { (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgBeginRedelegateResponse { + fromPartial(object: Partial): MsgBeginRedelegateResponse { const message = createBaseMsgBeginRedelegateResponse(); if (object.completionTime !== undefined && object.completionTime !== null) { message.completionTime = Timestamp.fromPartial(object.completionTime); @@ -724,7 +723,7 @@ function createBaseMsgUndelegate(): MsgUndelegate { }; } export const MsgUndelegate = { - encode(message: MsgUndelegate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUndelegate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -736,8 +735,8 @@ export const MsgUndelegate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUndelegate(); while (reader.pos < end) { @@ -773,7 +772,7 @@ export const MsgUndelegate = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUndelegate { + fromPartial(object: Partial): MsgUndelegate { const message = createBaseMsgUndelegate(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -789,14 +788,14 @@ function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { }; } export const MsgUndelegateResponse = { - encode(message: MsgUndelegateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUndelegateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(message.completionTime, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUndelegateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUndelegateResponse(); while (reader.pos < end) { @@ -823,7 +822,7 @@ export const MsgUndelegateResponse = { (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); return obj; }, - fromPartial, I>>(object: I): MsgUndelegateResponse { + fromPartial(object: Partial): MsgUndelegateResponse { const message = createBaseMsgUndelegateResponse(); if (object.completionTime !== undefined && object.completionTime !== null) { message.completionTime = Timestamp.fromPartial(object.completionTime); @@ -836,11 +835,11 @@ function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation delegatorAddress: "", validatorAddress: "", amount: Coin.fromPartial({}), - creationHeight: Long.ZERO, + creationHeight: BigInt(0), }; } export const MsgCancelUnbondingDelegation = { - encode(message: MsgCancelUnbondingDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCancelUnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -850,13 +849,13 @@ export const MsgCancelUnbondingDelegation = { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); } - if (!message.creationHeight.isZero()) { + if (message.creationHeight !== BigInt(0)) { writer.uint32(32).int64(message.creationHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUnbondingDelegation(); while (reader.pos < end) { @@ -872,7 +871,7 @@ export const MsgCancelUnbondingDelegation = { message.amount = Coin.decode(reader, reader.uint32()); break; case 4: - message.creationHeight = reader.int64() as Long; + message.creationHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -886,7 +885,7 @@ export const MsgCancelUnbondingDelegation = { if (isSet(object.delegatorAddress)) obj.delegatorAddress = String(object.delegatorAddress); if (isSet(object.validatorAddress)) obj.validatorAddress = String(object.validatorAddress); if (isSet(object.amount)) obj.amount = Coin.fromJSON(object.amount); - if (isSet(object.creationHeight)) obj.creationHeight = Long.fromValue(object.creationHeight); + if (isSet(object.creationHeight)) obj.creationHeight = BigInt(object.creationHeight.toString()); return obj; }, toJSON(message: MsgCancelUnbondingDelegation): unknown { @@ -895,12 +894,10 @@ export const MsgCancelUnbondingDelegation = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); message.creationHeight !== undefined && - (obj.creationHeight = (message.creationHeight || Long.ZERO).toString()); + (obj.creationHeight = (message.creationHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgCancelUnbondingDelegation { + fromPartial(object: Partial): MsgCancelUnbondingDelegation { const message = createBaseMsgCancelUnbondingDelegation(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -908,7 +905,7 @@ export const MsgCancelUnbondingDelegation = { message.amount = Coin.fromPartial(object.amount); } if (object.creationHeight !== undefined && object.creationHeight !== null) { - message.creationHeight = Long.fromValue(object.creationHeight); + message.creationHeight = BigInt(object.creationHeight.toString()); } return message; }, @@ -917,11 +914,14 @@ function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDel return {}; } export const MsgCancelUnbondingDelegationResponse = { - encode(_: MsgCancelUnbondingDelegationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: MsgCancelUnbondingDelegationResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUnbondingDelegationResponse(); while (reader.pos < end) { @@ -942,9 +942,7 @@ export const MsgCancelUnbondingDelegationResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgCancelUnbondingDelegationResponse { + fromPartial(_: Partial): MsgCancelUnbondingDelegationResponse { const message = createBaseMsgCancelUnbondingDelegationResponse(); return message; }, @@ -956,7 +954,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -965,8 +963,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -997,7 +995,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -1010,11 +1008,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -1035,7 +1033,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -1046,14 +1044,14 @@ function createBaseMsgUnbondValidator(): MsgUnbondValidator { }; } export const MsgUnbondValidator = { - encode(message: MsgUnbondValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUnbondValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnbondValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnbondValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnbondValidator(); while (reader.pos < end) { @@ -1079,7 +1077,7 @@ export const MsgUnbondValidator = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>(object: I): MsgUnbondValidator { + fromPartial(object: Partial): MsgUnbondValidator { const message = createBaseMsgUnbondValidator(); message.validatorAddress = object.validatorAddress ?? ""; return message; @@ -1089,11 +1087,11 @@ function createBaseMsgUnbondValidatorResponse(): MsgUnbondValidatorResponse { return {}; } export const MsgUnbondValidatorResponse = { - encode(_: MsgUnbondValidatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUnbondValidatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnbondValidatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnbondValidatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnbondValidatorResponse(); while (reader.pos < end) { @@ -1114,7 +1112,7 @@ export const MsgUnbondValidatorResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUnbondValidatorResponse { + fromPartial(_: Partial): MsgUnbondValidatorResponse { const message = createBaseMsgUnbondValidatorResponse(); return message; }, @@ -1128,7 +1126,7 @@ function createBaseMsgTokenizeShares(): MsgTokenizeShares { }; } export const MsgTokenizeShares = { - encode(message: MsgTokenizeShares, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTokenizeShares, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1143,8 +1141,8 @@ export const MsgTokenizeShares = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTokenizeShares { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTokenizeShares { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTokenizeShares(); while (reader.pos < end) { @@ -1185,7 +1183,7 @@ export const MsgTokenizeShares = { message.tokenizedShareOwner !== undefined && (obj.tokenizedShareOwner = message.tokenizedShareOwner); return obj; }, - fromPartial, I>>(object: I): MsgTokenizeShares { + fromPartial(object: Partial): MsgTokenizeShares { const message = createBaseMsgTokenizeShares(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -1202,14 +1200,14 @@ function createBaseMsgTokenizeSharesResponse(): MsgTokenizeSharesResponse { }; } export const MsgTokenizeSharesResponse = { - encode(message: MsgTokenizeSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTokenizeSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTokenizeSharesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTokenizeSharesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTokenizeSharesResponse(); while (reader.pos < end) { @@ -1235,9 +1233,7 @@ export const MsgTokenizeSharesResponse = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): MsgTokenizeSharesResponse { + fromPartial(object: Partial): MsgTokenizeSharesResponse { const message = createBaseMsgTokenizeSharesResponse(); if (object.amount !== undefined && object.amount !== null) { message.amount = Coin.fromPartial(object.amount); @@ -1252,7 +1248,7 @@ function createBaseMsgRedeemTokensForShares(): MsgRedeemTokensForShares { }; } export const MsgRedeemTokensForShares = { - encode(message: MsgRedeemTokensForShares, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRedeemTokensForShares, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1261,8 +1257,8 @@ export const MsgRedeemTokensForShares = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRedeemTokensForShares { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRedeemTokensForShares { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRedeemTokensForShares(); while (reader.pos < end) { @@ -1293,9 +1289,7 @@ export const MsgRedeemTokensForShares = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): MsgRedeemTokensForShares { + fromPartial(object: Partial): MsgRedeemTokensForShares { const message = createBaseMsgRedeemTokensForShares(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -1310,14 +1304,17 @@ function createBaseMsgRedeemTokensForSharesResponse(): MsgRedeemTokensForSharesR }; } export const MsgRedeemTokensForSharesResponse = { - encode(message: MsgRedeemTokensForSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgRedeemTokensForSharesResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRedeemTokensForSharesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRedeemTokensForSharesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRedeemTokensForSharesResponse(); while (reader.pos < end) { @@ -1343,9 +1340,7 @@ export const MsgRedeemTokensForSharesResponse = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): MsgRedeemTokensForSharesResponse { + fromPartial(object: Partial): MsgRedeemTokensForSharesResponse { const message = createBaseMsgRedeemTokensForSharesResponse(); if (object.amount !== undefined && object.amount !== null) { message.amount = Coin.fromPartial(object.amount); @@ -1355,14 +1350,17 @@ export const MsgRedeemTokensForSharesResponse = { }; function createBaseMsgTransferTokenizeShareRecord(): MsgTransferTokenizeShareRecord { return { - tokenizeShareRecordId: Long.UZERO, + tokenizeShareRecordId: BigInt(0), sender: "", newOwner: "", }; } export const MsgTransferTokenizeShareRecord = { - encode(message: MsgTransferTokenizeShareRecord, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.tokenizeShareRecordId.isZero()) { + encode( + message: MsgTransferTokenizeShareRecord, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.tokenizeShareRecordId !== BigInt(0)) { writer.uint32(8).uint64(message.tokenizeShareRecordId); } if (message.sender !== "") { @@ -1373,15 +1371,15 @@ export const MsgTransferTokenizeShareRecord = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferTokenizeShareRecord { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferTokenizeShareRecord { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTransferTokenizeShareRecord(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.tokenizeShareRecordId = reader.uint64() as Long; + message.tokenizeShareRecordId = reader.uint64(); break; case 2: message.sender = reader.string(); @@ -1399,7 +1397,7 @@ export const MsgTransferTokenizeShareRecord = { fromJSON(object: any): MsgTransferTokenizeShareRecord { const obj = createBaseMsgTransferTokenizeShareRecord(); if (isSet(object.tokenizeShareRecordId)) - obj.tokenizeShareRecordId = Long.fromValue(object.tokenizeShareRecordId); + obj.tokenizeShareRecordId = BigInt(object.tokenizeShareRecordId.toString()); if (isSet(object.sender)) obj.sender = String(object.sender); if (isSet(object.newOwner)) obj.newOwner = String(object.newOwner); return obj; @@ -1407,17 +1405,15 @@ export const MsgTransferTokenizeShareRecord = { toJSON(message: MsgTransferTokenizeShareRecord): unknown { const obj: any = {}; message.tokenizeShareRecordId !== undefined && - (obj.tokenizeShareRecordId = (message.tokenizeShareRecordId || Long.UZERO).toString()); + (obj.tokenizeShareRecordId = (message.tokenizeShareRecordId || BigInt(0)).toString()); message.sender !== undefined && (obj.sender = message.sender); message.newOwner !== undefined && (obj.newOwner = message.newOwner); return obj; }, - fromPartial, I>>( - object: I, - ): MsgTransferTokenizeShareRecord { + fromPartial(object: Partial): MsgTransferTokenizeShareRecord { const message = createBaseMsgTransferTokenizeShareRecord(); if (object.tokenizeShareRecordId !== undefined && object.tokenizeShareRecordId !== null) { - message.tokenizeShareRecordId = Long.fromValue(object.tokenizeShareRecordId); + message.tokenizeShareRecordId = BigInt(object.tokenizeShareRecordId.toString()); } message.sender = object.sender ?? ""; message.newOwner = object.newOwner ?? ""; @@ -1428,11 +1424,14 @@ function createBaseMsgTransferTokenizeShareRecordResponse(): MsgTransferTokenize return {}; } export const MsgTransferTokenizeShareRecordResponse = { - encode(_: MsgTransferTokenizeShareRecordResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: MsgTransferTokenizeShareRecordResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferTokenizeShareRecordResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferTokenizeShareRecordResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTransferTokenizeShareRecordResponse(); while (reader.pos < end) { @@ -1453,9 +1452,7 @@ export const MsgTransferTokenizeShareRecordResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgTransferTokenizeShareRecordResponse { + fromPartial(_: Partial): MsgTransferTokenizeShareRecordResponse { const message = createBaseMsgTransferTokenizeShareRecordResponse(); return message; }, @@ -1466,14 +1463,14 @@ function createBaseMsgDisableTokenizeShares(): MsgDisableTokenizeShares { }; } export const MsgDisableTokenizeShares = { - encode(message: MsgDisableTokenizeShares, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgDisableTokenizeShares, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDisableTokenizeShares { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDisableTokenizeShares { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDisableTokenizeShares(); while (reader.pos < end) { @@ -1499,9 +1496,7 @@ export const MsgDisableTokenizeShares = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): MsgDisableTokenizeShares { + fromPartial(object: Partial): MsgDisableTokenizeShares { const message = createBaseMsgDisableTokenizeShares(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -1511,11 +1506,11 @@ function createBaseMsgDisableTokenizeSharesResponse(): MsgDisableTokenizeSharesR return {}; } export const MsgDisableTokenizeSharesResponse = { - encode(_: MsgDisableTokenizeSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgDisableTokenizeSharesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgDisableTokenizeSharesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgDisableTokenizeSharesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgDisableTokenizeSharesResponse(); while (reader.pos < end) { @@ -1536,9 +1531,7 @@ export const MsgDisableTokenizeSharesResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgDisableTokenizeSharesResponse { + fromPartial(_: Partial): MsgDisableTokenizeSharesResponse { const message = createBaseMsgDisableTokenizeSharesResponse(); return message; }, @@ -1549,14 +1542,14 @@ function createBaseMsgEnableTokenizeShares(): MsgEnableTokenizeShares { }; } export const MsgEnableTokenizeShares = { - encode(message: MsgEnableTokenizeShares, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgEnableTokenizeShares, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgEnableTokenizeShares { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgEnableTokenizeShares { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgEnableTokenizeShares(); while (reader.pos < end) { @@ -1582,7 +1575,7 @@ export const MsgEnableTokenizeShares = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>(object: I): MsgEnableTokenizeShares { + fromPartial(object: Partial): MsgEnableTokenizeShares { const message = createBaseMsgEnableTokenizeShares(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -1594,14 +1587,17 @@ function createBaseMsgEnableTokenizeSharesResponse(): MsgEnableTokenizeSharesRes }; } export const MsgEnableTokenizeSharesResponse = { - encode(message: MsgEnableTokenizeSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgEnableTokenizeSharesResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.completionTime !== undefined) { Timestamp.encode(message.completionTime, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgEnableTokenizeSharesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgEnableTokenizeSharesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgEnableTokenizeSharesResponse(); while (reader.pos < end) { @@ -1628,9 +1624,7 @@ export const MsgEnableTokenizeSharesResponse = { (obj.completionTime = fromTimestamp(message.completionTime).toISOString()); return obj; }, - fromPartial, I>>( - object: I, - ): MsgEnableTokenizeSharesResponse { + fromPartial(object: Partial): MsgEnableTokenizeSharesResponse { const message = createBaseMsgEnableTokenizeSharesResponse(); if (object.completionTime !== undefined && object.completionTime !== null) { message.completionTime = Timestamp.fromPartial(object.completionTime); @@ -1645,7 +1639,7 @@ function createBaseMsgValidatorBond(): MsgValidatorBond { }; } export const MsgValidatorBond = { - encode(message: MsgValidatorBond, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgValidatorBond, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -1654,8 +1648,8 @@ export const MsgValidatorBond = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgValidatorBond { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgValidatorBond { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgValidatorBond(); while (reader.pos < end) { @@ -1686,7 +1680,7 @@ export const MsgValidatorBond = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>(object: I): MsgValidatorBond { + fromPartial(object: Partial): MsgValidatorBond { const message = createBaseMsgValidatorBond(); message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -1697,11 +1691,11 @@ function createBaseMsgValidatorBondResponse(): MsgValidatorBondResponse { return {}; } export const MsgValidatorBondResponse = { - encode(_: MsgValidatorBondResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgValidatorBondResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgValidatorBondResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgValidatorBondResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgValidatorBondResponse(); while (reader.pos < end) { @@ -1722,7 +1716,7 @@ export const MsgValidatorBondResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgValidatorBondResponse { + fromPartial(_: Partial): MsgValidatorBondResponse { const message = createBaseMsgValidatorBondResponse(); return message; }, @@ -1842,75 +1836,75 @@ export class MsgClientImpl implements Msg { CreateValidator(request: MsgCreateValidator): Promise { const data = MsgCreateValidator.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CreateValidator", data); - return promise.then((data) => MsgCreateValidatorResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreateValidatorResponse.decode(new BinaryReader(data))); } EditValidator(request: MsgEditValidator): Promise { const data = MsgEditValidator.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EditValidator", data); - return promise.then((data) => MsgEditValidatorResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgEditValidatorResponse.decode(new BinaryReader(data))); } Delegate(request: MsgDelegate): Promise { const data = MsgDelegate.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Delegate", data); - return promise.then((data) => MsgDelegateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgDelegateResponse.decode(new BinaryReader(data))); } BeginRedelegate(request: MsgBeginRedelegate): Promise { const data = MsgBeginRedelegate.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "BeginRedelegate", data); - return promise.then((data) => MsgBeginRedelegateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgBeginRedelegateResponse.decode(new BinaryReader(data))); } Undelegate(request: MsgUndelegate): Promise { const data = MsgUndelegate.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); - return promise.then((data) => MsgUndelegateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUndelegateResponse.decode(new BinaryReader(data))); } CancelUnbondingDelegation( request: MsgCancelUnbondingDelegation, ): Promise { const data = MsgCancelUnbondingDelegation.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CancelUnbondingDelegation", data); - return promise.then((data) => MsgCancelUnbondingDelegationResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCancelUnbondingDelegationResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } UnbondValidator(request: MsgUnbondValidator): Promise { const data = MsgUnbondValidator.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "UnbondValidator", data); - return promise.then((data) => MsgUnbondValidatorResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUnbondValidatorResponse.decode(new BinaryReader(data))); } TokenizeShares(request: MsgTokenizeShares): Promise { const data = MsgTokenizeShares.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "TokenizeShares", data); - return promise.then((data) => MsgTokenizeSharesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgTokenizeSharesResponse.decode(new BinaryReader(data))); } RedeemTokensForShares(request: MsgRedeemTokensForShares): Promise { const data = MsgRedeemTokensForShares.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "RedeemTokensForShares", data); - return promise.then((data) => MsgRedeemTokensForSharesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRedeemTokensForSharesResponse.decode(new BinaryReader(data))); } TransferTokenizeShareRecord( request: MsgTransferTokenizeShareRecord, ): Promise { const data = MsgTransferTokenizeShareRecord.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "TransferTokenizeShareRecord", data); - return promise.then((data) => MsgTransferTokenizeShareRecordResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgTransferTokenizeShareRecordResponse.decode(new BinaryReader(data))); } DisableTokenizeShares(request: MsgDisableTokenizeShares): Promise { const data = MsgDisableTokenizeShares.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "DisableTokenizeShares", data); - return promise.then((data) => MsgDisableTokenizeSharesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgDisableTokenizeSharesResponse.decode(new BinaryReader(data))); } EnableTokenizeShares(request: MsgEnableTokenizeShares): Promise { const data = MsgEnableTokenizeShares.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "EnableTokenizeShares", data); - return promise.then((data) => MsgEnableTokenizeSharesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgEnableTokenizeSharesResponse.decode(new BinaryReader(data))); } ValidatorBond(request: MsgValidatorBond): Promise { const data = MsgValidatorBond.encode(request).finish(); const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "ValidatorBond", data); - return promise.then((data) => MsgValidatorBondResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgValidatorBondResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/tx/config/v1/config.ts b/src/cosmos/tx/config/v1/config.ts index 52d135f..8303f9c 100644 --- a/src/cosmos/tx/config/v1/config.ts +++ b/src/cosmos/tx/config/v1/config.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.tx.config.v1"; /** Config is the config object of the x/auth/tx package. */ export interface Config { @@ -22,7 +22,7 @@ function createBaseConfig(): Config { }; } export const Config = { - encode(message: Config, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.skipAnteHandler === true) { writer.uint32(8).bool(message.skipAnteHandler); } @@ -31,8 +31,8 @@ export const Config = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Config { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfig(); while (reader.pos < end) { @@ -63,7 +63,7 @@ export const Config = { message.skipPostHandler !== undefined && (obj.skipPostHandler = message.skipPostHandler); return obj; }, - fromPartial, I>>(object: I): Config { + fromPartial(object: Partial): Config { const message = createBaseConfig(); message.skipAnteHandler = object.skipAnteHandler ?? false; message.skipPostHandler = object.skipPostHandler ?? false; diff --git a/src/cosmos/tx/signing/v1beta1/signing.ts b/src/cosmos/tx/signing/v1beta1/signing.ts index 82c10e5..f7e32c8 100644 --- a/src/cosmos/tx/signing/v1beta1/signing.ts +++ b/src/cosmos/tx/signing/v1beta1/signing.ts @@ -1,8 +1,9 @@ +//@ts-nocheck /* eslint-disable */ import { CompactBitArray } from "../../../crypto/multisig/v1beta1/multisig"; import { Any } from "../../../../google/protobuf/any"; -import { Long, DeepPartial, Exact, isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "cosmos.tx.signing.v1beta1"; /** * SignMode represents a signing mode with its own security guarantees. @@ -125,7 +126,7 @@ export interface SignatureDescriptor { * number of committed transactions signed by a given address. It is used to prevent * replay attacks. */ - sequence: Long; + sequence: bigint; } /** Data represents signature data */ export interface SignatureDescriptor_Data { @@ -154,14 +155,14 @@ function createBaseSignatureDescriptors(): SignatureDescriptors { }; } export const SignatureDescriptors = { - encode(message: SignatureDescriptors, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignatureDescriptors, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signatures) { SignatureDescriptor.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptors { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptors { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptors(); while (reader.pos < end) { @@ -192,7 +193,7 @@ export const SignatureDescriptors = { } return obj; }, - fromPartial, I>>(object: I): SignatureDescriptors { + fromPartial(object: Partial): SignatureDescriptors { const message = createBaseSignatureDescriptors(); message.signatures = object.signatures?.map((e) => SignatureDescriptor.fromPartial(e)) || []; return message; @@ -202,24 +203,24 @@ function createBaseSignatureDescriptor(): SignatureDescriptor { return { publicKey: Any.fromPartial({}), data: SignatureDescriptor_Data.fromPartial({}), - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const SignatureDescriptor = { - encode(message: SignatureDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignatureDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } if (message.data !== undefined) { SignatureDescriptor_Data.encode(message.data, writer.uint32(18).fork()).ldelim(); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor(); while (reader.pos < end) { @@ -232,7 +233,7 @@ export const SignatureDescriptor = { message.data = SignatureDescriptor_Data.decode(reader, reader.uint32()); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -245,7 +246,7 @@ export const SignatureDescriptor = { const obj = createBaseSignatureDescriptor(); if (isSet(object.publicKey)) obj.publicKey = Any.fromJSON(object.publicKey); if (isSet(object.data)) obj.data = SignatureDescriptor_Data.fromJSON(object.data); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: SignatureDescriptor): unknown { @@ -254,10 +255,10 @@ export const SignatureDescriptor = { (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.data !== undefined && (obj.data = message.data ? SignatureDescriptor_Data.toJSON(message.data) : undefined); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): SignatureDescriptor { + fromPartial(object: Partial): SignatureDescriptor { const message = createBaseSignatureDescriptor(); if (object.publicKey !== undefined && object.publicKey !== null) { message.publicKey = Any.fromPartial(object.publicKey); @@ -266,7 +267,7 @@ export const SignatureDescriptor = { message.data = SignatureDescriptor_Data.fromPartial(object.data); } if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -278,7 +279,7 @@ function createBaseSignatureDescriptor_Data(): SignatureDescriptor_Data { }; } export const SignatureDescriptor_Data = { - encode(message: SignatureDescriptor_Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignatureDescriptor_Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.single !== undefined) { SignatureDescriptor_Data_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); } @@ -287,8 +288,8 @@ export const SignatureDescriptor_Data = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor_Data(); while (reader.pos < end) { @@ -321,9 +322,7 @@ export const SignatureDescriptor_Data = { (obj.multi = message.multi ? SignatureDescriptor_Data_Multi.toJSON(message.multi) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): SignatureDescriptor_Data { + fromPartial(object: Partial): SignatureDescriptor_Data { const message = createBaseSignatureDescriptor_Data(); if (object.single !== undefined && object.single !== null) { message.single = SignatureDescriptor_Data_Single.fromPartial(object.single); @@ -341,7 +340,10 @@ function createBaseSignatureDescriptor_Data_Single(): SignatureDescriptor_Data_S }; } export const SignatureDescriptor_Data_Single = { - encode(message: SignatureDescriptor_Data_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptor_Data_Single, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); } @@ -350,8 +352,8 @@ export const SignatureDescriptor_Data_Single = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor_Data_Single(); while (reader.pos < end) { @@ -385,9 +387,7 @@ export const SignatureDescriptor_Data_Single = { )); return obj; }, - fromPartial, I>>( - object: I, - ): SignatureDescriptor_Data_Single { + fromPartial(object: Partial): SignatureDescriptor_Data_Single { const message = createBaseSignatureDescriptor_Data_Single(); message.mode = object.mode ?? 0; message.signature = object.signature ?? new Uint8Array(); @@ -401,7 +401,10 @@ function createBaseSignatureDescriptor_Data_Multi(): SignatureDescriptor_Data_Mu }; } export const SignatureDescriptor_Data_Multi = { - encode(message: SignatureDescriptor_Data_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: SignatureDescriptor_Data_Multi, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.bitarray !== undefined) { CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); } @@ -410,8 +413,8 @@ export const SignatureDescriptor_Data_Multi = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureDescriptor_Data_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureDescriptor_Data_Multi(); while (reader.pos < end) { @@ -448,9 +451,7 @@ export const SignatureDescriptor_Data_Multi = { } return obj; }, - fromPartial, I>>( - object: I, - ): SignatureDescriptor_Data_Multi { + fromPartial(object: Partial): SignatureDescriptor_Data_Multi { const message = createBaseSignatureDescriptor_Data_Multi(); if (object.bitarray !== undefined && object.bitarray !== null) { message.bitarray = CompactBitArray.fromPartial(object.bitarray); diff --git a/src/cosmos/tx/v1beta1/service.ts b/src/cosmos/tx/v1beta1/service.ts index 24c354b..818d7a8 100644 --- a/src/cosmos/tx/v1beta1/service.ts +++ b/src/cosmos/tx/v1beta1/service.ts @@ -4,8 +4,8 @@ import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination"; import { TxResponse, GasInfo, Result } from "../../base/abci/v1beta1/abci"; import { BlockID } from "../../../tendermint/types/types"; import { Block } from "../../../tendermint/types/block"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.tx.v1beta1"; /** OrderBy defines the sorting order */ export enum OrderBy { @@ -118,12 +118,12 @@ export interface GetTxsEventRequest { pagination: PageRequest; orderBy: OrderBy; /** page is the page number to query, starts at 1. If not provided, will default to first page. */ - page: Long; + page: bigint; /** * limit is the total number of results to be returned in the result page. * If left empty it will default to a value to be set by each app. */ - limit: Long; + limit: bigint; } /** * GetTxsEventResponse is the response type for the Service.TxsByEvents @@ -141,7 +141,7 @@ export interface GetTxsEventResponse { /** @deprecated */ pagination: PageResponse; /** total is total number of results available */ - total: Long; + total: bigint; } /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -211,7 +211,7 @@ export interface GetTxResponse { */ export interface GetBlockWithTxsRequest { /** height is the height of the block to query. */ - height: Long; + height: bigint; /** pagination defines a pagination for the request. */ pagination: PageRequest; } @@ -309,12 +309,12 @@ function createBaseGetTxsEventRequest(): GetTxsEventRequest { events: [], pagination: PageRequest.fromPartial({}), orderBy: 0, - page: Long.UZERO, - limit: Long.UZERO, + page: BigInt(0), + limit: BigInt(0), }; } export const GetTxsEventRequest = { - encode(message: GetTxsEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetTxsEventRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { writer.uint32(10).string(v!); } @@ -324,16 +324,16 @@ export const GetTxsEventRequest = { if (message.orderBy !== 0) { writer.uint32(24).int32(message.orderBy); } - if (!message.page.isZero()) { + if (message.page !== BigInt(0)) { writer.uint32(32).uint64(message.page); } - if (!message.limit.isZero()) { + if (message.limit !== BigInt(0)) { writer.uint32(40).uint64(message.limit); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxsEventRequest(); while (reader.pos < end) { @@ -349,10 +349,10 @@ export const GetTxsEventRequest = { message.orderBy = reader.int32() as any; break; case 4: - message.page = reader.uint64() as Long; + message.page = reader.uint64(); break; case 5: - message.limit = reader.uint64() as Long; + message.limit = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -366,8 +366,8 @@ export const GetTxsEventRequest = { if (Array.isArray(object?.events)) obj.events = object.events.map((e: any) => String(e)); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); if (isSet(object.orderBy)) obj.orderBy = orderByFromJSON(object.orderBy); - if (isSet(object.page)) obj.page = Long.fromValue(object.page); - if (isSet(object.limit)) obj.limit = Long.fromValue(object.limit); + if (isSet(object.page)) obj.page = BigInt(object.page.toString()); + if (isSet(object.limit)) obj.limit = BigInt(object.limit.toString()); return obj; }, toJSON(message: GetTxsEventRequest): unknown { @@ -380,11 +380,11 @@ export const GetTxsEventRequest = { message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); message.orderBy !== undefined && (obj.orderBy = orderByToJSON(message.orderBy)); - message.page !== undefined && (obj.page = (message.page || Long.UZERO).toString()); - message.limit !== undefined && (obj.limit = (message.limit || Long.UZERO).toString()); + message.page !== undefined && (obj.page = (message.page || BigInt(0)).toString()); + message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): GetTxsEventRequest { + fromPartial(object: Partial): GetTxsEventRequest { const message = createBaseGetTxsEventRequest(); message.events = object.events?.map((e) => e) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -392,10 +392,10 @@ export const GetTxsEventRequest = { } message.orderBy = object.orderBy ?? 0; if (object.page !== undefined && object.page !== null) { - message.page = Long.fromValue(object.page); + message.page = BigInt(object.page.toString()); } if (object.limit !== undefined && object.limit !== null) { - message.limit = Long.fromValue(object.limit); + message.limit = BigInt(object.limit.toString()); } return message; }, @@ -405,11 +405,11 @@ function createBaseGetTxsEventResponse(): GetTxsEventResponse { txs: [], txResponses: [], pagination: PageResponse.fromPartial({}), - total: Long.UZERO, + total: BigInt(0), }; } export const GetTxsEventResponse = { - encode(message: GetTxsEventResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetTxsEventResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -419,13 +419,13 @@ export const GetTxsEventResponse = { if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } - if (!message.total.isZero()) { + if (message.total !== BigInt(0)) { writer.uint32(32).uint64(message.total); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxsEventResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxsEventResponse(); while (reader.pos < end) { @@ -441,7 +441,7 @@ export const GetTxsEventResponse = { message.pagination = PageResponse.decode(reader, reader.uint32()); break; case 4: - message.total = reader.uint64() as Long; + message.total = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -456,7 +456,7 @@ export const GetTxsEventResponse = { if (Array.isArray(object?.txResponses)) obj.txResponses = object.txResponses.map((e: any) => TxResponse.fromJSON(e)); if (isSet(object.pagination)) obj.pagination = PageResponse.fromJSON(object.pagination); - if (isSet(object.total)) obj.total = Long.fromValue(object.total); + if (isSet(object.total)) obj.total = BigInt(object.total.toString()); return obj; }, toJSON(message: GetTxsEventResponse): unknown { @@ -473,10 +473,10 @@ export const GetTxsEventResponse = { } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - message.total !== undefined && (obj.total = (message.total || Long.UZERO).toString()); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): GetTxsEventResponse { + fromPartial(object: Partial): GetTxsEventResponse { const message = createBaseGetTxsEventResponse(); message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || []; message.txResponses = object.txResponses?.map((e) => TxResponse.fromPartial(e)) || []; @@ -484,7 +484,7 @@ export const GetTxsEventResponse = { message.pagination = PageResponse.fromPartial(object.pagination); } if (object.total !== undefined && object.total !== null) { - message.total = Long.fromValue(object.total); + message.total = BigInt(object.total.toString()); } return message; }, @@ -496,7 +496,7 @@ function createBaseBroadcastTxRequest(): BroadcastTxRequest { }; } export const BroadcastTxRequest = { - encode(message: BroadcastTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BroadcastTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txBytes.length !== 0) { writer.uint32(10).bytes(message.txBytes); } @@ -505,8 +505,8 @@ export const BroadcastTxRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBroadcastTxRequest(); while (reader.pos < end) { @@ -538,7 +538,7 @@ export const BroadcastTxRequest = { message.mode !== undefined && (obj.mode = broadcastModeToJSON(message.mode)); return obj; }, - fromPartial, I>>(object: I): BroadcastTxRequest { + fromPartial(object: Partial): BroadcastTxRequest { const message = createBaseBroadcastTxRequest(); message.txBytes = object.txBytes ?? new Uint8Array(); message.mode = object.mode ?? 0; @@ -551,14 +551,14 @@ function createBaseBroadcastTxResponse(): BroadcastTxResponse { }; } export const BroadcastTxResponse = { - encode(message: BroadcastTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BroadcastTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txResponse !== undefined) { TxResponse.encode(message.txResponse, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BroadcastTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BroadcastTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBroadcastTxResponse(); while (reader.pos < end) { @@ -585,7 +585,7 @@ export const BroadcastTxResponse = { (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); return obj; }, - fromPartial, I>>(object: I): BroadcastTxResponse { + fromPartial(object: Partial): BroadcastTxResponse { const message = createBaseBroadcastTxResponse(); if (object.txResponse !== undefined && object.txResponse !== null) { message.txResponse = TxResponse.fromPartial(object.txResponse); @@ -600,7 +600,7 @@ function createBaseSimulateRequest(): SimulateRequest { }; } export const SimulateRequest = { - encode(message: SimulateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SimulateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } @@ -609,8 +609,8 @@ export const SimulateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimulateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimulateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimulateRequest(); while (reader.pos < end) { @@ -642,7 +642,7 @@ export const SimulateRequest = { (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): SimulateRequest { + fromPartial(object: Partial): SimulateRequest { const message = createBaseSimulateRequest(); if (object.tx !== undefined && object.tx !== null) { message.tx = Tx.fromPartial(object.tx); @@ -658,7 +658,7 @@ function createBaseSimulateResponse(): SimulateResponse { }; } export const SimulateResponse = { - encode(message: SimulateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SimulateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.gasInfo !== undefined) { GasInfo.encode(message.gasInfo, writer.uint32(10).fork()).ldelim(); } @@ -667,8 +667,8 @@ export const SimulateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimulateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimulateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimulateResponse(); while (reader.pos < end) { @@ -700,7 +700,7 @@ export const SimulateResponse = { message.result !== undefined && (obj.result = message.result ? Result.toJSON(message.result) : undefined); return obj; }, - fromPartial, I>>(object: I): SimulateResponse { + fromPartial(object: Partial): SimulateResponse { const message = createBaseSimulateResponse(); if (object.gasInfo !== undefined && object.gasInfo !== null) { message.gasInfo = GasInfo.fromPartial(object.gasInfo); @@ -717,14 +717,14 @@ function createBaseGetTxRequest(): GetTxRequest { }; } export const GetTxRequest = { - encode(message: GetTxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetTxRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxRequest(); while (reader.pos < end) { @@ -750,7 +750,7 @@ export const GetTxRequest = { message.hash !== undefined && (obj.hash = message.hash); return obj; }, - fromPartial, I>>(object: I): GetTxRequest { + fromPartial(object: Partial): GetTxRequest { const message = createBaseGetTxRequest(); message.hash = object.hash ?? ""; return message; @@ -763,7 +763,7 @@ function createBaseGetTxResponse(): GetTxResponse { }; } export const GetTxResponse = { - encode(message: GetTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } @@ -772,8 +772,8 @@ export const GetTxResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetTxResponse(); while (reader.pos < end) { @@ -805,7 +805,7 @@ export const GetTxResponse = { (obj.txResponse = message.txResponse ? TxResponse.toJSON(message.txResponse) : undefined); return obj; }, - fromPartial, I>>(object: I): GetTxResponse { + fromPartial(object: Partial): GetTxResponse { const message = createBaseGetTxResponse(); if (object.tx !== undefined && object.tx !== null) { message.tx = Tx.fromPartial(object.tx); @@ -818,13 +818,13 @@ export const GetTxResponse = { }; function createBaseGetBlockWithTxsRequest(): GetBlockWithTxsRequest { return { - height: Long.ZERO, + height: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const GetBlockWithTxsRequest = { - encode(message: GetBlockWithTxsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: GetBlockWithTxsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.pagination !== undefined) { @@ -832,15 +832,15 @@ export const GetBlockWithTxsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockWithTxsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -854,21 +854,21 @@ export const GetBlockWithTxsRequest = { }, fromJSON(object: any): GetBlockWithTxsRequest { const obj = createBaseGetBlockWithTxsRequest(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: GetBlockWithTxsRequest): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): GetBlockWithTxsRequest { + fromPartial(object: Partial): GetBlockWithTxsRequest { const message = createBaseGetBlockWithTxsRequest(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -885,7 +885,7 @@ function createBaseGetBlockWithTxsResponse(): GetBlockWithTxsResponse { }; } export const GetBlockWithTxsResponse = { - encode(message: GetBlockWithTxsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetBlockWithTxsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { Tx.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -900,8 +900,8 @@ export const GetBlockWithTxsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GetBlockWithTxsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GetBlockWithTxsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGetBlockWithTxsResponse(); while (reader.pos < end) { @@ -948,7 +948,7 @@ export const GetBlockWithTxsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): GetBlockWithTxsResponse { + fromPartial(object: Partial): GetBlockWithTxsResponse { const message = createBaseGetBlockWithTxsResponse(); message.txs = object.txs?.map((e) => Tx.fromPartial(e)) || []; if (object.blockId !== undefined && object.blockId !== null) { @@ -969,14 +969,14 @@ function createBaseTxDecodeRequest(): TxDecodeRequest { }; } export const TxDecodeRequest = { - encode(message: TxDecodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxDecodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txBytes.length !== 0) { writer.uint32(10).bytes(message.txBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxDecodeRequest(); while (reader.pos < end) { @@ -1003,7 +1003,7 @@ export const TxDecodeRequest = { (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): TxDecodeRequest { + fromPartial(object: Partial): TxDecodeRequest { const message = createBaseTxDecodeRequest(); message.txBytes = object.txBytes ?? new Uint8Array(); return message; @@ -1015,14 +1015,14 @@ function createBaseTxDecodeResponse(): TxDecodeResponse { }; } export const TxDecodeResponse = { - encode(message: TxDecodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxDecodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxDecodeResponse(); while (reader.pos < end) { @@ -1048,7 +1048,7 @@ export const TxDecodeResponse = { message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); return obj; }, - fromPartial, I>>(object: I): TxDecodeResponse { + fromPartial(object: Partial): TxDecodeResponse { const message = createBaseTxDecodeResponse(); if (object.tx !== undefined && object.tx !== null) { message.tx = Tx.fromPartial(object.tx); @@ -1062,14 +1062,14 @@ function createBaseTxEncodeRequest(): TxEncodeRequest { }; } export const TxEncodeRequest = { - encode(message: TxEncodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxEncodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx !== undefined) { Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxEncodeRequest(); while (reader.pos < end) { @@ -1095,7 +1095,7 @@ export const TxEncodeRequest = { message.tx !== undefined && (obj.tx = message.tx ? Tx.toJSON(message.tx) : undefined); return obj; }, - fromPartial, I>>(object: I): TxEncodeRequest { + fromPartial(object: Partial): TxEncodeRequest { const message = createBaseTxEncodeRequest(); if (object.tx !== undefined && object.tx !== null) { message.tx = Tx.fromPartial(object.tx); @@ -1109,14 +1109,14 @@ function createBaseTxEncodeResponse(): TxEncodeResponse { }; } export const TxEncodeResponse = { - encode(message: TxEncodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxEncodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txBytes.length !== 0) { writer.uint32(10).bytes(message.txBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxEncodeResponse(); while (reader.pos < end) { @@ -1143,7 +1143,7 @@ export const TxEncodeResponse = { (obj.txBytes = base64FromBytes(message.txBytes !== undefined ? message.txBytes : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): TxEncodeResponse { + fromPartial(object: Partial): TxEncodeResponse { const message = createBaseTxEncodeResponse(); message.txBytes = object.txBytes ?? new Uint8Array(); return message; @@ -1155,14 +1155,14 @@ function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { }; } export const TxEncodeAminoRequest = { - encode(message: TxEncodeAminoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxEncodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.aminoJson !== "") { writer.uint32(10).string(message.aminoJson); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeAminoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxEncodeAminoRequest(); while (reader.pos < end) { @@ -1188,7 +1188,7 @@ export const TxEncodeAminoRequest = { message.aminoJson !== undefined && (obj.aminoJson = message.aminoJson); return obj; }, - fromPartial, I>>(object: I): TxEncodeAminoRequest { + fromPartial(object: Partial): TxEncodeAminoRequest { const message = createBaseTxEncodeAminoRequest(); message.aminoJson = object.aminoJson ?? ""; return message; @@ -1200,14 +1200,14 @@ function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { }; } export const TxEncodeAminoResponse = { - encode(message: TxEncodeAminoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxEncodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.aminoBinary.length !== 0) { writer.uint32(10).bytes(message.aminoBinary); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxEncodeAminoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxEncodeAminoResponse(); while (reader.pos < end) { @@ -1236,7 +1236,7 @@ export const TxEncodeAminoResponse = { )); return obj; }, - fromPartial, I>>(object: I): TxEncodeAminoResponse { + fromPartial(object: Partial): TxEncodeAminoResponse { const message = createBaseTxEncodeAminoResponse(); message.aminoBinary = object.aminoBinary ?? new Uint8Array(); return message; @@ -1248,14 +1248,14 @@ function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { }; } export const TxDecodeAminoRequest = { - encode(message: TxDecodeAminoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxDecodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.aminoBinary.length !== 0) { writer.uint32(10).bytes(message.aminoBinary); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeAminoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxDecodeAminoRequest(); while (reader.pos < end) { @@ -1284,7 +1284,7 @@ export const TxDecodeAminoRequest = { )); return obj; }, - fromPartial, I>>(object: I): TxDecodeAminoRequest { + fromPartial(object: Partial): TxDecodeAminoRequest { const message = createBaseTxDecodeAminoRequest(); message.aminoBinary = object.aminoBinary ?? new Uint8Array(); return message; @@ -1296,14 +1296,14 @@ function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { }; } export const TxDecodeAminoResponse = { - encode(message: TxDecodeAminoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxDecodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.aminoJson !== "") { writer.uint32(10).string(message.aminoJson); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxDecodeAminoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxDecodeAminoResponse(); while (reader.pos < end) { @@ -1329,7 +1329,7 @@ export const TxDecodeAminoResponse = { message.aminoJson !== undefined && (obj.aminoJson = message.aminoJson); return obj; }, - fromPartial, I>>(object: I): TxDecodeAminoResponse { + fromPartial(object: Partial): TxDecodeAminoResponse { const message = createBaseTxDecodeAminoResponse(); message.aminoJson = object.aminoJson ?? ""; return message; @@ -1393,46 +1393,46 @@ export class ServiceClientImpl implements Service { Simulate(request: SimulateRequest): Promise { const data = SimulateRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "Simulate", data); - return promise.then((data) => SimulateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => SimulateResponse.decode(new BinaryReader(data))); } GetTx(request: GetTxRequest): Promise { const data = GetTxRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTx", data); - return promise.then((data) => GetTxResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetTxResponse.decode(new BinaryReader(data))); } BroadcastTx(request: BroadcastTxRequest): Promise { const data = BroadcastTxRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "BroadcastTx", data); - return promise.then((data) => BroadcastTxResponse.decode(new _m0.Reader(data))); + return promise.then((data) => BroadcastTxResponse.decode(new BinaryReader(data))); } GetTxsEvent(request: GetTxsEventRequest): Promise { const data = GetTxsEventRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetTxsEvent", data); - return promise.then((data) => GetTxsEventResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetTxsEventResponse.decode(new BinaryReader(data))); } GetBlockWithTxs(request: GetBlockWithTxsRequest): Promise { const data = GetBlockWithTxsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetBlockWithTxs", data); - return promise.then((data) => GetBlockWithTxsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => GetBlockWithTxsResponse.decode(new BinaryReader(data))); } TxDecode(request: TxDecodeRequest): Promise { const data = TxDecodeRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecode", data); - return promise.then((data) => TxDecodeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => TxDecodeResponse.decode(new BinaryReader(data))); } TxEncode(request: TxEncodeRequest): Promise { const data = TxEncodeRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncode", data); - return promise.then((data) => TxEncodeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => TxEncodeResponse.decode(new BinaryReader(data))); } TxEncodeAmino(request: TxEncodeAminoRequest): Promise { const data = TxEncodeAminoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncodeAmino", data); - return promise.then((data) => TxEncodeAminoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => TxEncodeAminoResponse.decode(new BinaryReader(data))); } TxDecodeAmino(request: TxDecodeAminoRequest): Promise { const data = TxDecodeAminoRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecodeAmino", data); - return promise.then((data) => TxDecodeAminoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => TxDecodeAminoResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/tx/v1beta1/tx.ts b/src/cosmos/tx/v1beta1/tx.ts index 52bff03..d96c5b8 100644 --- a/src/cosmos/tx/v1beta1/tx.ts +++ b/src/cosmos/tx/v1beta1/tx.ts @@ -3,8 +3,8 @@ import { Any } from "../../../google/protobuf/any"; import { SignMode, signModeFromJSON, signModeToJSON } from "../signing/v1beta1/signing"; import { CompactBitArray } from "../../crypto/multisig/v1beta1/multisig"; import { Coin } from "../../base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmos.tx.v1beta1"; /** Tx is the standard type used for broadcasting transactions. */ export interface Tx { @@ -66,7 +66,7 @@ export interface SignDoc { */ chainId: string; /** account_number is the account number of the account in state */ - accountNumber: Long; + accountNumber: bigint; } /** * SignDocDirectAux is the type used for generating sign bytes for @@ -89,9 +89,9 @@ export interface SignDocDirectAux { */ chainId: string; /** account_number is the account number of the account in state. */ - accountNumber: Long; + accountNumber: bigint; /** sequence is the sequence number of the signing account. */ - sequence: Long; + sequence: bigint; /** * Tip is the optional tip used for transactions fees paid in another denom. * It should be left empty if the signer is not the tipper for this @@ -124,7 +124,7 @@ export interface TxBody { * timeout is the block height after which this transaction will not * be processed by the chain */ - timeoutHeight: Long; + timeoutHeight: bigint; /** * extension_options are arbitrary options that can be added by chains * when the default options are not sufficient. If any of these are present @@ -188,7 +188,7 @@ export interface SignerInfo { * number of committed transactions signed by a given address. It is used to * prevent replay attacks. */ - sequence: Long; + sequence: bigint; } /** ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface ModeInfo { @@ -228,7 +228,7 @@ export interface Fee { * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs */ - gasLimit: Long; + gasLimit: bigint; /** * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. * the payer must be a tx signer (and thus have signed this field in AuthInfo). @@ -287,7 +287,7 @@ function createBaseTx(): Tx { }; } export const Tx = { - encode(message: Tx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Tx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.body !== undefined) { TxBody.encode(message.body, writer.uint32(10).fork()).ldelim(); } @@ -299,8 +299,8 @@ export const Tx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Tx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Tx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTx(); while (reader.pos < end) { @@ -342,7 +342,7 @@ export const Tx = { } return obj; }, - fromPartial, I>>(object: I): Tx { + fromPartial(object: Partial): Tx { const message = createBaseTx(); if (object.body !== undefined && object.body !== null) { message.body = TxBody.fromPartial(object.body); @@ -362,7 +362,7 @@ function createBaseTxRaw(): TxRaw { }; } export const TxRaw = { - encode(message: TxRaw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxRaw, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); } @@ -374,8 +374,8 @@ export const TxRaw = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxRaw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxRaw { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxRaw(); while (reader.pos < end) { @@ -422,7 +422,7 @@ export const TxRaw = { } return obj; }, - fromPartial, I>>(object: I): TxRaw { + fromPartial(object: Partial): TxRaw { const message = createBaseTxRaw(); message.bodyBytes = object.bodyBytes ?? new Uint8Array(); message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); @@ -435,11 +435,11 @@ function createBaseSignDoc(): SignDoc { bodyBytes: new Uint8Array(), authInfoBytes: new Uint8Array(), chainId: "", - accountNumber: Long.UZERO, + accountNumber: BigInt(0), }; } export const SignDoc = { - encode(message: SignDoc, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignDoc, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); } @@ -449,13 +449,13 @@ export const SignDoc = { if (message.chainId !== "") { writer.uint32(26).string(message.chainId); } - if (!message.accountNumber.isZero()) { + if (message.accountNumber !== BigInt(0)) { writer.uint32(32).uint64(message.accountNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignDoc { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignDoc { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignDoc(); while (reader.pos < end) { @@ -471,7 +471,7 @@ export const SignDoc = { message.chainId = reader.string(); break; case 4: - message.accountNumber = reader.uint64() as Long; + message.accountNumber = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -485,7 +485,7 @@ export const SignDoc = { if (isSet(object.bodyBytes)) obj.bodyBytes = bytesFromBase64(object.bodyBytes); if (isSet(object.authInfoBytes)) obj.authInfoBytes = bytesFromBase64(object.authInfoBytes); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.accountNumber)) obj.accountNumber = Long.fromValue(object.accountNumber); + if (isSet(object.accountNumber)) obj.accountNumber = BigInt(object.accountNumber.toString()); return obj; }, toJSON(message: SignDoc): unknown { @@ -500,16 +500,16 @@ export const SignDoc = { )); message.chainId !== undefined && (obj.chainId = message.chainId); message.accountNumber !== undefined && - (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); + (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): SignDoc { + fromPartial(object: Partial): SignDoc { const message = createBaseSignDoc(); message.bodyBytes = object.bodyBytes ?? new Uint8Array(); message.authInfoBytes = object.authInfoBytes ?? new Uint8Array(); message.chainId = object.chainId ?? ""; if (object.accountNumber !== undefined && object.accountNumber !== null) { - message.accountNumber = Long.fromValue(object.accountNumber); + message.accountNumber = BigInt(object.accountNumber.toString()); } return message; }, @@ -519,13 +519,13 @@ function createBaseSignDocDirectAux(): SignDocDirectAux { bodyBytes: new Uint8Array(), publicKey: Any.fromPartial({}), chainId: "", - accountNumber: Long.UZERO, - sequence: Long.UZERO, + accountNumber: BigInt(0), + sequence: BigInt(0), tip: Tip.fromPartial({}), }; } export const SignDocDirectAux = { - encode(message: SignDocDirectAux, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignDocDirectAux, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bodyBytes.length !== 0) { writer.uint32(10).bytes(message.bodyBytes); } @@ -535,10 +535,10 @@ export const SignDocDirectAux = { if (message.chainId !== "") { writer.uint32(26).string(message.chainId); } - if (!message.accountNumber.isZero()) { + if (message.accountNumber !== BigInt(0)) { writer.uint32(32).uint64(message.accountNumber); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(40).uint64(message.sequence); } if (message.tip !== undefined) { @@ -546,8 +546,8 @@ export const SignDocDirectAux = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignDocDirectAux { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignDocDirectAux(); while (reader.pos < end) { @@ -563,10 +563,10 @@ export const SignDocDirectAux = { message.chainId = reader.string(); break; case 4: - message.accountNumber = reader.uint64() as Long; + message.accountNumber = reader.uint64(); break; case 5: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; case 6: message.tip = Tip.decode(reader, reader.uint32()); @@ -583,8 +583,8 @@ export const SignDocDirectAux = { if (isSet(object.bodyBytes)) obj.bodyBytes = bytesFromBase64(object.bodyBytes); if (isSet(object.publicKey)) obj.publicKey = Any.fromJSON(object.publicKey); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.accountNumber)) obj.accountNumber = Long.fromValue(object.accountNumber); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.accountNumber)) obj.accountNumber = BigInt(object.accountNumber.toString()); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); if (isSet(object.tip)) obj.tip = Tip.fromJSON(object.tip); return obj; }, @@ -598,12 +598,12 @@ export const SignDocDirectAux = { (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.chainId !== undefined && (obj.chainId = message.chainId); message.accountNumber !== undefined && - (obj.accountNumber = (message.accountNumber || Long.UZERO).toString()); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + (obj.accountNumber = (message.accountNumber || BigInt(0)).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); return obj; }, - fromPartial, I>>(object: I): SignDocDirectAux { + fromPartial(object: Partial): SignDocDirectAux { const message = createBaseSignDocDirectAux(); message.bodyBytes = object.bodyBytes ?? new Uint8Array(); if (object.publicKey !== undefined && object.publicKey !== null) { @@ -611,10 +611,10 @@ export const SignDocDirectAux = { } message.chainId = object.chainId ?? ""; if (object.accountNumber !== undefined && object.accountNumber !== null) { - message.accountNumber = Long.fromValue(object.accountNumber); + message.accountNumber = BigInt(object.accountNumber.toString()); } if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } if (object.tip !== undefined && object.tip !== null) { message.tip = Tip.fromPartial(object.tip); @@ -626,20 +626,20 @@ function createBaseTxBody(): TxBody { return { messages: [], memo: "", - timeoutHeight: Long.UZERO, + timeoutHeight: BigInt(0), extensionOptions: [], nonCriticalExtensionOptions: [], }; } export const TxBody = { - encode(message: TxBody, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxBody, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.memo !== "") { writer.uint32(18).string(message.memo); } - if (!message.timeoutHeight.isZero()) { + if (message.timeoutHeight !== BigInt(0)) { writer.uint32(24).uint64(message.timeoutHeight); } for (const v of message.extensionOptions) { @@ -650,8 +650,8 @@ export const TxBody = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxBody { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxBody { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxBody(); while (reader.pos < end) { @@ -664,7 +664,7 @@ export const TxBody = { message.memo = reader.string(); break; case 3: - message.timeoutHeight = reader.uint64() as Long; + message.timeoutHeight = reader.uint64(); break; case 1023: message.extensionOptions.push(Any.decode(reader, reader.uint32())); @@ -683,7 +683,7 @@ export const TxBody = { const obj = createBaseTxBody(); if (Array.isArray(object?.messages)) obj.messages = object.messages.map((e: any) => Any.fromJSON(e)); if (isSet(object.memo)) obj.memo = String(object.memo); - if (isSet(object.timeoutHeight)) obj.timeoutHeight = Long.fromValue(object.timeoutHeight); + if (isSet(object.timeoutHeight)) obj.timeoutHeight = BigInt(object.timeoutHeight.toString()); if (Array.isArray(object?.extensionOptions)) obj.extensionOptions = object.extensionOptions.map((e: any) => Any.fromJSON(e)); if (Array.isArray(object?.nonCriticalExtensionOptions)) @@ -699,7 +699,7 @@ export const TxBody = { } message.memo !== undefined && (obj.memo = message.memo); message.timeoutHeight !== undefined && - (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + (obj.timeoutHeight = (message.timeoutHeight || BigInt(0)).toString()); if (message.extensionOptions) { obj.extensionOptions = message.extensionOptions.map((e) => (e ? Any.toJSON(e) : undefined)); } else { @@ -714,12 +714,12 @@ export const TxBody = { } return obj; }, - fromPartial, I>>(object: I): TxBody { + fromPartial(object: Partial): TxBody { const message = createBaseTxBody(); message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; message.memo = object.memo ?? ""; if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { - message.timeoutHeight = Long.fromValue(object.timeoutHeight); + message.timeoutHeight = BigInt(object.timeoutHeight.toString()); } message.extensionOptions = object.extensionOptions?.map((e) => Any.fromPartial(e)) || []; message.nonCriticalExtensionOptions = @@ -735,7 +735,7 @@ function createBaseAuthInfo(): AuthInfo { }; } export const AuthInfo = { - encode(message: AuthInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AuthInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.signerInfos) { SignerInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -747,8 +747,8 @@ export const AuthInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AuthInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AuthInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAuthInfo(); while (reader.pos < end) { @@ -789,7 +789,7 @@ export const AuthInfo = { message.tip !== undefined && (obj.tip = message.tip ? Tip.toJSON(message.tip) : undefined); return obj; }, - fromPartial, I>>(object: I): AuthInfo { + fromPartial(object: Partial): AuthInfo { const message = createBaseAuthInfo(); message.signerInfos = object.signerInfos?.map((e) => SignerInfo.fromPartial(e)) || []; if (object.fee !== undefined && object.fee !== null) { @@ -805,24 +805,24 @@ function createBaseSignerInfo(): SignerInfo { return { publicKey: Any.fromPartial({}), modeInfo: ModeInfo.fromPartial({}), - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const SignerInfo = { - encode(message: SignerInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignerInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } if (message.modeInfo !== undefined) { ModeInfo.encode(message.modeInfo, writer.uint32(18).fork()).ldelim(); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignerInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignerInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignerInfo(); while (reader.pos < end) { @@ -835,7 +835,7 @@ export const SignerInfo = { message.modeInfo = ModeInfo.decode(reader, reader.uint32()); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -848,7 +848,7 @@ export const SignerInfo = { const obj = createBaseSignerInfo(); if (isSet(object.publicKey)) obj.publicKey = Any.fromJSON(object.publicKey); if (isSet(object.modeInfo)) obj.modeInfo = ModeInfo.fromJSON(object.modeInfo); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: SignerInfo): unknown { @@ -857,10 +857,10 @@ export const SignerInfo = { (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.modeInfo !== undefined && (obj.modeInfo = message.modeInfo ? ModeInfo.toJSON(message.modeInfo) : undefined); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): SignerInfo { + fromPartial(object: Partial): SignerInfo { const message = createBaseSignerInfo(); if (object.publicKey !== undefined && object.publicKey !== null) { message.publicKey = Any.fromPartial(object.publicKey); @@ -869,7 +869,7 @@ export const SignerInfo = { message.modeInfo = ModeInfo.fromPartial(object.modeInfo); } if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -881,7 +881,7 @@ function createBaseModeInfo(): ModeInfo { }; } export const ModeInfo = { - encode(message: ModeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.single !== undefined) { ModeInfo_Single.encode(message.single, writer.uint32(10).fork()).ldelim(); } @@ -890,8 +890,8 @@ export const ModeInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModeInfo(); while (reader.pos < end) { @@ -924,7 +924,7 @@ export const ModeInfo = { (obj.multi = message.multi ? ModeInfo_Multi.toJSON(message.multi) : undefined); return obj; }, - fromPartial, I>>(object: I): ModeInfo { + fromPartial(object: Partial): ModeInfo { const message = createBaseModeInfo(); if (object.single !== undefined && object.single !== null) { message.single = ModeInfo_Single.fromPartial(object.single); @@ -941,14 +941,14 @@ function createBaseModeInfo_Single(): ModeInfo_Single { }; } export const ModeInfo_Single = { - encode(message: ModeInfo_Single, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModeInfo_Single, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.mode !== 0) { writer.uint32(8).int32(message.mode); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Single { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Single { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModeInfo_Single(); while (reader.pos < end) { @@ -974,7 +974,7 @@ export const ModeInfo_Single = { message.mode !== undefined && (obj.mode = signModeToJSON(message.mode)); return obj; }, - fromPartial, I>>(object: I): ModeInfo_Single { + fromPartial(object: Partial): ModeInfo_Single { const message = createBaseModeInfo_Single(); message.mode = object.mode ?? 0; return message; @@ -987,7 +987,7 @@ function createBaseModeInfo_Multi(): ModeInfo_Multi { }; } export const ModeInfo_Multi = { - encode(message: ModeInfo_Multi, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModeInfo_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.bitarray !== undefined) { CompactBitArray.encode(message.bitarray, writer.uint32(10).fork()).ldelim(); } @@ -996,8 +996,8 @@ export const ModeInfo_Multi = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModeInfo_Multi { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModeInfo_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModeInfo_Multi(); while (reader.pos < end) { @@ -1034,7 +1034,7 @@ export const ModeInfo_Multi = { } return obj; }, - fromPartial, I>>(object: I): ModeInfo_Multi { + fromPartial(object: Partial): ModeInfo_Multi { const message = createBaseModeInfo_Multi(); if (object.bitarray !== undefined && object.bitarray !== null) { message.bitarray = CompactBitArray.fromPartial(object.bitarray); @@ -1046,17 +1046,17 @@ export const ModeInfo_Multi = { function createBaseFee(): Fee { return { amount: [], - gasLimit: Long.UZERO, + gasLimit: BigInt(0), payer: "", granter: "", }; } export const Fee = { - encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } - if (!message.gasLimit.isZero()) { + if (message.gasLimit !== BigInt(0)) { writer.uint32(16).uint64(message.gasLimit); } if (message.payer !== "") { @@ -1067,8 +1067,8 @@ export const Fee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Fee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFee(); while (reader.pos < end) { @@ -1078,7 +1078,7 @@ export const Fee = { message.amount.push(Coin.decode(reader, reader.uint32())); break; case 2: - message.gasLimit = reader.uint64() as Long; + message.gasLimit = reader.uint64(); break; case 3: message.payer = reader.string(); @@ -1096,7 +1096,7 @@ export const Fee = { fromJSON(object: any): Fee { const obj = createBaseFee(); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); - if (isSet(object.gasLimit)) obj.gasLimit = Long.fromValue(object.gasLimit); + if (isSet(object.gasLimit)) obj.gasLimit = BigInt(object.gasLimit.toString()); if (isSet(object.payer)) obj.payer = String(object.payer); if (isSet(object.granter)) obj.granter = String(object.granter); return obj; @@ -1108,16 +1108,16 @@ export const Fee = { } else { obj.amount = []; } - message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || Long.UZERO).toString()); + message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || BigInt(0)).toString()); message.payer !== undefined && (obj.payer = message.payer); message.granter !== undefined && (obj.granter = message.granter); return obj; }, - fromPartial, I>>(object: I): Fee { + fromPartial(object: Partial): Fee { const message = createBaseFee(); message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; if (object.gasLimit !== undefined && object.gasLimit !== null) { - message.gasLimit = Long.fromValue(object.gasLimit); + message.gasLimit = BigInt(object.gasLimit.toString()); } message.payer = object.payer ?? ""; message.granter = object.granter ?? ""; @@ -1131,7 +1131,7 @@ function createBaseTip(): Tip { }; } export const Tip = { - encode(message: Tip, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Tip, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amount) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1140,8 +1140,8 @@ export const Tip = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Tip { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Tip { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTip(); while (reader.pos < end) { @@ -1176,7 +1176,7 @@ export const Tip = { message.tipper !== undefined && (obj.tipper = message.tipper); return obj; }, - fromPartial, I>>(object: I): Tip { + fromPartial(object: Partial): Tip { const message = createBaseTip(); message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; message.tipper = object.tipper ?? ""; @@ -1192,7 +1192,7 @@ function createBaseAuxSignerData(): AuxSignerData { }; } export const AuxSignerData = { - encode(message: AuxSignerData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AuxSignerData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -1207,8 +1207,8 @@ export const AuxSignerData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AuxSignerData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAuxSignerData(); while (reader.pos < end) { @@ -1251,7 +1251,7 @@ export const AuxSignerData = { (obj.sig = base64FromBytes(message.sig !== undefined ? message.sig : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): AuxSignerData { + fromPartial(object: Partial): AuxSignerData { const message = createBaseAuxSignerData(); message.address = object.address ?? ""; if (object.signDoc !== undefined && object.signDoc !== null) { diff --git a/src/cosmos/upgrade/module/v1/module.ts b/src/cosmos/upgrade/module/v1/module.ts index 87fdbdc..c3c3193 100644 --- a/src/cosmos/upgrade/module/v1/module.ts +++ b/src/cosmos/upgrade/module/v1/module.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "cosmos.upgrade.module.v1"; /** Module is the config object of the upgrade module. */ export interface Module { @@ -13,14 +13,14 @@ function createBaseModule(): Module { }; } export const Module = { - encode(message: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -46,7 +46,7 @@ export const Module = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): Module { + fromPartial(object: Partial): Module { const message = createBaseModule(); message.authority = object.authority ?? ""; return message; diff --git a/src/cosmos/upgrade/v1beta1/query.ts b/src/cosmos/upgrade/v1beta1/query.ts index a6d6053..2eb2bc2 100644 --- a/src/cosmos/upgrade/v1beta1/query.ts +++ b/src/cosmos/upgrade/v1beta1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Plan, ModuleVersion } from "./upgrade"; -import { Long, DeepPartial, Exact, isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.upgrade.v1beta1"; /** * QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC @@ -30,7 +30,7 @@ export interface QueryAppliedPlanRequest { */ export interface QueryAppliedPlanResponse { /** height is the block height at which the plan was applied. */ - height: Long; + height: bigint; } /** * QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState @@ -42,7 +42,7 @@ export interface QueryUpgradedConsensusStateRequest { * last height of the current chain must be sent in request * as this is the height under which next consensus state is stored */ - lastHeight: Long; + lastHeight: bigint; } /** * QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState @@ -95,11 +95,11 @@ function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { return {}; } export const QueryCurrentPlanRequest = { - encode(_: QueryCurrentPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryCurrentPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentPlanRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentPlanRequest(); while (reader.pos < end) { @@ -120,7 +120,7 @@ export const QueryCurrentPlanRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryCurrentPlanRequest { + fromPartial(_: Partial): QueryCurrentPlanRequest { const message = createBaseQueryCurrentPlanRequest(); return message; }, @@ -131,14 +131,14 @@ function createBaseQueryCurrentPlanResponse(): QueryCurrentPlanResponse { }; } export const QueryCurrentPlanResponse = { - encode(message: QueryCurrentPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCurrentPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.plan !== undefined) { Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentPlanResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentPlanResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentPlanResponse(); while (reader.pos < end) { @@ -164,9 +164,7 @@ export const QueryCurrentPlanResponse = { message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryCurrentPlanResponse { + fromPartial(object: Partial): QueryCurrentPlanResponse { const message = createBaseQueryCurrentPlanResponse(); if (object.plan !== undefined && object.plan !== null) { message.plan = Plan.fromPartial(object.plan); @@ -180,14 +178,14 @@ function createBaseQueryAppliedPlanRequest(): QueryAppliedPlanRequest { }; } export const QueryAppliedPlanRequest = { - encode(message: QueryAppliedPlanRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAppliedPlanRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAppliedPlanRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAppliedPlanRequest(); while (reader.pos < end) { @@ -213,7 +211,7 @@ export const QueryAppliedPlanRequest = { message.name !== undefined && (obj.name = message.name); return obj; }, - fromPartial, I>>(object: I): QueryAppliedPlanRequest { + fromPartial(object: Partial): QueryAppliedPlanRequest { const message = createBaseQueryAppliedPlanRequest(); message.name = object.name ?? ""; return message; @@ -221,25 +219,25 @@ export const QueryAppliedPlanRequest = { }; function createBaseQueryAppliedPlanResponse(): QueryAppliedPlanResponse { return { - height: Long.ZERO, + height: BigInt(0), }; } export const QueryAppliedPlanResponse = { - encode(message: QueryAppliedPlanResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: QueryAppliedPlanResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAppliedPlanResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAppliedPlanResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAppliedPlanResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -250,45 +248,46 @@ export const QueryAppliedPlanResponse = { }, fromJSON(object: any): QueryAppliedPlanResponse { const obj = createBaseQueryAppliedPlanResponse(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); return obj; }, toJSON(message: QueryAppliedPlanResponse): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAppliedPlanResponse { + fromPartial(object: Partial): QueryAppliedPlanResponse { const message = createBaseQueryAppliedPlanResponse(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } return message; }, }; function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusStateRequest { return { - lastHeight: Long.ZERO, + lastHeight: BigInt(0), }; } export const QueryUpgradedConsensusStateRequest = { - encode(message: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.lastHeight.isZero()) { + encode( + message: QueryUpgradedConsensusStateRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.lastHeight !== BigInt(0)) { writer.uint32(8).int64(message.lastHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.lastHeight = reader.int64() as Long; + message.lastHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -299,20 +298,18 @@ export const QueryUpgradedConsensusStateRequest = { }, fromJSON(object: any): QueryUpgradedConsensusStateRequest { const obj = createBaseQueryUpgradedConsensusStateRequest(); - if (isSet(object.lastHeight)) obj.lastHeight = Long.fromValue(object.lastHeight); + if (isSet(object.lastHeight)) obj.lastHeight = BigInt(object.lastHeight.toString()); return obj; }, toJSON(message: QueryUpgradedConsensusStateRequest): unknown { const obj: any = {}; - message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || Long.ZERO).toString()); + message.lastHeight !== undefined && (obj.lastHeight = (message.lastHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUpgradedConsensusStateRequest { + fromPartial(object: Partial): QueryUpgradedConsensusStateRequest { const message = createBaseQueryUpgradedConsensusStateRequest(); if (object.lastHeight !== undefined && object.lastHeight !== null) { - message.lastHeight = Long.fromValue(object.lastHeight); + message.lastHeight = BigInt(object.lastHeight.toString()); } return message; }, @@ -323,14 +320,17 @@ function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensus }; } export const QueryUpgradedConsensusStateResponse = { - encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUpgradedConsensusStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.upgradedConsensusState.length !== 0) { writer.uint32(18).bytes(message.upgradedConsensusState); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateResponse(); while (reader.pos < end) { @@ -360,9 +360,7 @@ export const QueryUpgradedConsensusStateResponse = { )); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUpgradedConsensusStateResponse { + fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { const message = createBaseQueryUpgradedConsensusStateResponse(); message.upgradedConsensusState = object.upgradedConsensusState ?? new Uint8Array(); return message; @@ -374,14 +372,14 @@ function createBaseQueryModuleVersionsRequest(): QueryModuleVersionsRequest { }; } export const QueryModuleVersionsRequest = { - encode(message: QueryModuleVersionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryModuleVersionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moduleName !== "") { writer.uint32(10).string(message.moduleName); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleVersionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleVersionsRequest(); while (reader.pos < end) { @@ -407,9 +405,7 @@ export const QueryModuleVersionsRequest = { message.moduleName !== undefined && (obj.moduleName = message.moduleName); return obj; }, - fromPartial, I>>( - object: I, - ): QueryModuleVersionsRequest { + fromPartial(object: Partial): QueryModuleVersionsRequest { const message = createBaseQueryModuleVersionsRequest(); message.moduleName = object.moduleName ?? ""; return message; @@ -421,14 +417,14 @@ function createBaseQueryModuleVersionsResponse(): QueryModuleVersionsResponse { }; } export const QueryModuleVersionsResponse = { - encode(message: QueryModuleVersionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryModuleVersionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.moduleVersions) { ModuleVersion.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleVersionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleVersionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleVersionsResponse(); while (reader.pos < end) { @@ -459,9 +455,7 @@ export const QueryModuleVersionsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryModuleVersionsResponse { + fromPartial(object: Partial): QueryModuleVersionsResponse { const message = createBaseQueryModuleVersionsResponse(); message.moduleVersions = object.moduleVersions?.map((e) => ModuleVersion.fromPartial(e)) || []; return message; @@ -471,11 +465,11 @@ function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { return {}; } export const QueryAuthorityRequest = { - encode(_: QueryAuthorityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryAuthorityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAuthorityRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAuthorityRequest(); while (reader.pos < end) { @@ -496,7 +490,7 @@ export const QueryAuthorityRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryAuthorityRequest { + fromPartial(_: Partial): QueryAuthorityRequest { const message = createBaseQueryAuthorityRequest(); return message; }, @@ -507,14 +501,14 @@ function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { }; } export const QueryAuthorityResponse = { - encode(message: QueryAuthorityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAuthorityResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAuthorityResponse(); while (reader.pos < end) { @@ -540,7 +534,7 @@ export const QueryAuthorityResponse = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): QueryAuthorityResponse { + fromPartial(object: Partial): QueryAuthorityResponse { const message = createBaseQueryAuthorityResponse(); message.address = object.address ?? ""; return message; @@ -589,28 +583,28 @@ export class QueryClientImpl implements Query { CurrentPlan(request: QueryCurrentPlanRequest = {}): Promise { const data = QueryCurrentPlanRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "CurrentPlan", data); - return promise.then((data) => QueryCurrentPlanResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCurrentPlanResponse.decode(new BinaryReader(data))); } AppliedPlan(request: QueryAppliedPlanRequest): Promise { const data = QueryAppliedPlanRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "AppliedPlan", data); - return promise.then((data) => QueryAppliedPlanResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAppliedPlanResponse.decode(new BinaryReader(data))); } UpgradedConsensusState( request: QueryUpgradedConsensusStateRequest, ): Promise { const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "UpgradedConsensusState", data); - return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); } ModuleVersions(request: QueryModuleVersionsRequest): Promise { const data = QueryModuleVersionsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); - return promise.then((data) => QueryModuleVersionsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryModuleVersionsResponse.decode(new BinaryReader(data))); } Authority(request: QueryAuthorityRequest = {}): Promise { const data = QueryAuthorityRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); - return promise.then((data) => QueryAuthorityResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAuthorityResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/upgrade/v1beta1/tx.amino.ts b/src/cosmos/upgrade/v1beta1/tx.amino.ts new file mode 100644 index 0000000..0eb2d97 --- /dev/null +++ b/src/cosmos/upgrade/v1beta1/tx.amino.ts @@ -0,0 +1,77 @@ +//@ts-nocheck +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export interface MsgSoftwareUpgradeAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgrade"; + value: { + authority: string; + plan: { + name: string; + time: { + seconds: string; + nanos: number; + }; + height: string; + info: string; + upgraded_client_state: { + type_url: string; + value: Uint8Array; + }; + }; + }; +} +export interface MsgCancelUpgradeAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCancelUpgrade"; + value: { + authority: string; + }; +} +export const AminoConverter = { + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgSoftwareUpgrade", + toAmino: ({ authority, plan }: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoType["value"] => { + return { + authority, + plan: { + name: plan.name, + time: plan.time, + height: plan.height.toString(), + info: plan.info, + upgraded_client_state: { + type_url: plan.upgradedClientState.typeUrl, + value: plan.upgradedClientState.value, + }, + }, + }; + }, + fromAmino: ({ authority, plan }: MsgSoftwareUpgradeAminoType["value"]): MsgSoftwareUpgrade => { + return { + authority, + plan: { + name: plan.name, + time: plan.time, + height: BigInt(plan.height), + info: plan.info, + upgradedClientState: { + typeUrl: plan.upgraded_client_state.type_url, + value: plan.upgraded_client_state.value, + }, + }, + }; + }, + }, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": { + aminoType: "cosmos-sdk/MsgCancelUpgrade", + toAmino: ({ authority }: MsgCancelUpgrade): MsgCancelUpgradeAminoType["value"] => { + return { + authority, + }; + }, + fromAmino: ({ authority }: MsgCancelUpgradeAminoType["value"]): MsgCancelUpgrade => { + return { + authority, + }; + }, + }, +}; diff --git a/src/cosmos/upgrade/v1beta1/tx.registry.ts b/src/cosmos/upgrade/v1beta1/tx.registry.ts new file mode 100644 index 0000000..b34612a --- /dev/null +++ b/src/cosmos/upgrade/v1beta1/tx.registry.ts @@ -0,0 +1,85 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], + ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(value).finish(), + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value, + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value, + }; + }, + }, + toJSON: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.toJSON(value), + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.toJSON(value), + }; + }, + }, + fromJSON: { + softwareUpgrade(value: any) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromJSON(value), + }; + }, + cancelUpgrade(value: any) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromJSON(value), + }; + }, + }, + fromPartial: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromPartial(value), + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/upgrade/v1beta1/tx.ts b/src/cosmos/upgrade/v1beta1/tx.ts index ade12a7..3ff7e16 100644 --- a/src/cosmos/upgrade/v1beta1/tx.ts +++ b/src/cosmos/upgrade/v1beta1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Plan } from "./upgrade"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.upgrade.v1beta1"; /** * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. @@ -42,7 +42,7 @@ function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { }; } export const MsgSoftwareUpgrade = { - encode(message: MsgSoftwareUpgrade, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -51,8 +51,8 @@ export const MsgSoftwareUpgrade = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSoftwareUpgrade { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSoftwareUpgrade(); while (reader.pos < end) { @@ -83,7 +83,7 @@ export const MsgSoftwareUpgrade = { message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgSoftwareUpgrade { + fromPartial(object: Partial): MsgSoftwareUpgrade { const message = createBaseMsgSoftwareUpgrade(); message.authority = object.authority ?? ""; if (object.plan !== undefined && object.plan !== null) { @@ -96,11 +96,11 @@ function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { return {}; } export const MsgSoftwareUpgradeResponse = { - encode(_: MsgSoftwareUpgradeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSoftwareUpgradeResponse(); while (reader.pos < end) { @@ -121,7 +121,7 @@ export const MsgSoftwareUpgradeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgSoftwareUpgradeResponse { + fromPartial(_: Partial): MsgSoftwareUpgradeResponse { const message = createBaseMsgSoftwareUpgradeResponse(); return message; }, @@ -132,14 +132,14 @@ function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { }; } export const MsgCancelUpgrade = { - encode(message: MsgCancelUpgrade, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCancelUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUpgrade { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUpgrade(); while (reader.pos < end) { @@ -165,7 +165,7 @@ export const MsgCancelUpgrade = { message.authority !== undefined && (obj.authority = message.authority); return obj; }, - fromPartial, I>>(object: I): MsgCancelUpgrade { + fromPartial(object: Partial): MsgCancelUpgrade { const message = createBaseMsgCancelUpgrade(); message.authority = object.authority ?? ""; return message; @@ -175,11 +175,11 @@ function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { return {}; } export const MsgCancelUpgradeResponse = { - encode(_: MsgCancelUpgradeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgCancelUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCancelUpgradeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCancelUpgradeResponse(); while (reader.pos < end) { @@ -200,7 +200,7 @@ export const MsgCancelUpgradeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgCancelUpgradeResponse { + fromPartial(_: Partial): MsgCancelUpgradeResponse { const message = createBaseMsgCancelUpgradeResponse(); return message; }, @@ -231,11 +231,11 @@ export class MsgClientImpl implements Msg { SoftwareUpgrade(request: MsgSoftwareUpgrade): Promise { const data = MsgSoftwareUpgrade.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); - return promise.then((data) => MsgSoftwareUpgradeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSoftwareUpgradeResponse.decode(new BinaryReader(data))); } CancelUpgrade(request: MsgCancelUpgrade): Promise { const data = MsgCancelUpgrade.encode(request).finish(); const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); - return promise.then((data) => MsgCancelUpgradeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCancelUpgradeResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/upgrade/v1beta1/upgrade.ts b/src/cosmos/upgrade/v1beta1/upgrade.ts index aef00a7..5f9b999 100644 --- a/src/cosmos/upgrade/v1beta1/upgrade.ts +++ b/src/cosmos/upgrade/v1beta1/upgrade.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Any } from "../../../google/protobuf/any"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "cosmos.upgrade.v1beta1"; /** Plan specifies information about a planned upgrade and when it should occur. */ export interface Plan { @@ -24,7 +24,7 @@ export interface Plan { /** @deprecated */ time: Timestamp; /** The height at which the upgrade must be performed. */ - height: Long; + height: bigint; /** * Any application specific upgrade info to be included on-chain * such as a git commit that validators could automatically upgrade to @@ -75,26 +75,26 @@ export interface ModuleVersion { /** name of the app module */ name: string; /** consensus version of the app module */ - version: Long; + version: bigint; } function createBasePlan(): Plan { return { name: "", time: Timestamp.fromPartial({}), - height: Long.ZERO, + height: BigInt(0), info: "", upgradedClientState: Any.fromPartial({}), }; } export const Plan = { - encode(message: Plan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Plan, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(18).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.info !== "") { @@ -105,8 +105,8 @@ export const Plan = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Plan { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePlan(); while (reader.pos < end) { @@ -119,7 +119,7 @@ export const Plan = { message.time = Timestamp.decode(reader, reader.uint32()); break; case 3: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 4: message.info = reader.string(); @@ -138,7 +138,7 @@ export const Plan = { const obj = createBasePlan(); if (isSet(object.name)) obj.name = String(object.name); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.info)) obj.info = String(object.info); if (isSet(object.upgradedClientState)) obj.upgradedClientState = Any.fromJSON(object.upgradedClientState); return obj; @@ -147,7 +147,7 @@ export const Plan = { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.info !== undefined && (obj.info = message.info); message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState @@ -155,14 +155,14 @@ export const Plan = { : undefined); return obj; }, - fromPartial, I>>(object: I): Plan { + fromPartial(object: Partial): Plan { const message = createBasePlan(); message.name = object.name ?? ""; if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); } if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.info = object.info ?? ""; if (object.upgradedClientState !== undefined && object.upgradedClientState !== null) { @@ -179,7 +179,7 @@ function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { }; } export const SoftwareUpgradeProposal = { - encode(message: SoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -191,8 +191,8 @@ export const SoftwareUpgradeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SoftwareUpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSoftwareUpgradeProposal(); while (reader.pos < end) { @@ -228,7 +228,7 @@ export const SoftwareUpgradeProposal = { message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); return obj; }, - fromPartial, I>>(object: I): SoftwareUpgradeProposal { + fromPartial(object: Partial): SoftwareUpgradeProposal { const message = createBaseSoftwareUpgradeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -245,7 +245,7 @@ function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposa }; } export const CancelSoftwareUpgradeProposal = { - encode(message: CancelSoftwareUpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -254,8 +254,8 @@ export const CancelSoftwareUpgradeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCancelSoftwareUpgradeProposal(); while (reader.pos < end) { @@ -286,9 +286,7 @@ export const CancelSoftwareUpgradeProposal = { message.description !== undefined && (obj.description = message.description); return obj; }, - fromPartial, I>>( - object: I, - ): CancelSoftwareUpgradeProposal { + fromPartial(object: Partial): CancelSoftwareUpgradeProposal { const message = createBaseCancelSoftwareUpgradeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -298,21 +296,21 @@ export const CancelSoftwareUpgradeProposal = { function createBaseModuleVersion(): ModuleVersion { return { name: "", - version: Long.UZERO, + version: BigInt(0), }; } export const ModuleVersion = { - encode(message: ModuleVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ModuleVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (!message.version.isZero()) { + if (message.version !== BigInt(0)) { writer.uint32(16).uint64(message.version); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleVersion { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModuleVersion(); while (reader.pos < end) { @@ -322,7 +320,7 @@ export const ModuleVersion = { message.name = reader.string(); break; case 2: - message.version = reader.uint64() as Long; + message.version = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -334,20 +332,20 @@ export const ModuleVersion = { fromJSON(object: any): ModuleVersion { const obj = createBaseModuleVersion(); if (isSet(object.name)) obj.name = String(object.name); - if (isSet(object.version)) obj.version = Long.fromValue(object.version); + if (isSet(object.version)) obj.version = BigInt(object.version.toString()); return obj; }, toJSON(message: ModuleVersion): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.version !== undefined && (obj.version = (message.version || Long.UZERO).toString()); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ModuleVersion { + fromPartial(object: Partial): ModuleVersion { const message = createBaseModuleVersion(); message.name = object.name ?? ""; if (object.version !== undefined && object.version !== null) { - message.version = Long.fromValue(object.version); + message.version = BigInt(object.version.toString()); } return message; }, diff --git a/src/cosmos/vesting/module/v1/module.ts b/src/cosmos/vesting/module/v1/module.ts index 33bbf97..75270f2 100644 --- a/src/cosmos/vesting/module/v1/module.ts +++ b/src/cosmos/vesting/module/v1/module.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; export const protobufPackage = "cosmos.vesting.module.v1"; /** Module is the config object of the vesting module. */ export interface Module {} @@ -8,11 +7,11 @@ function createBaseModule(): Module { return {}; } export const Module = { - encode(_: Module, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Module { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModule(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Module = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Module { + fromPartial(_: Partial): Module { const message = createBaseModule(); return message; }, diff --git a/src/cosmos/vesting/v1beta1/tx.amino.ts b/src/cosmos/vesting/v1beta1/tx.amino.ts new file mode 100644 index 0000000..c550db6 --- /dev/null +++ b/src/cosmos/vesting/v1beta1/tx.amino.ts @@ -0,0 +1,159 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { + MsgCreateVestingAccount, + MsgCreatePermanentLockedAccount, + MsgCreatePeriodicVestingAccount, +} from "./tx"; +export interface MsgCreateVestingAccountAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreateVestingAccount"; + value: { + from_address: string; + to_address: string; + amount: { + denom: string; + amount: string; + }[]; + end_time: string; + delayed: boolean; + }; +} +export interface MsgCreatePermanentLockedAccountAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreatePermLockedAccount"; + value: { + from_address: string; + to_address: string; + amount: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgCreatePeriodicVestingAccountAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccount"; + value: { + from_address: string; + to_address: string; + start_time: string; + vesting_periods: { + length: string; + amount: { + denom: string; + amount: string; + }[]; + }[]; + }; +} +export const AminoConverter = { + "/cosmos.vesting.v1beta1.MsgCreateVestingAccount": { + aminoType: "cosmos-sdk/MsgCreateVestingAccount", + toAmino: ({ + fromAddress, + toAddress, + amount, + endTime, + delayed, + }: MsgCreateVestingAccount): MsgCreateVestingAccountAminoType["value"] => { + return { + from_address: fromAddress, + to_address: toAddress, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + end_time: endTime.toString(), + delayed, + }; + }, + fromAmino: ({ + from_address, + to_address, + amount, + end_time, + delayed, + }: MsgCreateVestingAccountAminoType["value"]): MsgCreateVestingAccount => { + return { + fromAddress: from_address, + toAddress: to_address, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + endTime: BigInt(end_time), + delayed, + }; + }, + }, + "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount": { + aminoType: "cosmos-sdk/MsgCreatePermLockedAccount", + toAmino: ({ + fromAddress, + toAddress, + amount, + }: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountAminoType["value"] => { + return { + from_address: fromAddress, + to_address: toAddress, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ + from_address, + to_address, + amount, + }: MsgCreatePermanentLockedAccountAminoType["value"]): MsgCreatePermanentLockedAccount => { + return { + fromAddress: from_address, + toAddress: to_address, + amount: amount.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount": { + aminoType: "cosmos-sdk/MsgCreatePeriodicVestingAccount", + toAmino: ({ + fromAddress, + toAddress, + startTime, + vestingPeriods, + }: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountAminoType["value"] => { + return { + from_address: fromAddress, + to_address: toAddress, + start_time: startTime.toString(), + vesting_periods: vestingPeriods.map((el0) => ({ + length: el0.length.toString(), + amount: el0.amount.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + })), + }; + }, + fromAmino: ({ + from_address, + to_address, + start_time, + vesting_periods, + }: MsgCreatePeriodicVestingAccountAminoType["value"]): MsgCreatePeriodicVestingAccount => { + return { + fromAddress: from_address, + toAddress: to_address, + startTime: BigInt(start_time), + vestingPeriods: vesting_periods.map((el0) => ({ + length: BigInt(el0.length), + amount: el0.amount.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + })), + }; + }, + }, +}; diff --git a/src/cosmos/vesting/v1beta1/tx.registry.ts b/src/cosmos/vesting/v1beta1/tx.registry.ts new file mode 100644 index 0000000..3acedb7 --- /dev/null +++ b/src/cosmos/vesting/v1beta1/tx.registry.ts @@ -0,0 +1,120 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgCreateVestingAccount, + MsgCreatePermanentLockedAccount, + MsgCreatePeriodicVestingAccount, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount], + ["/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", MsgCreatePermanentLockedAccount], + ["/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", MsgCreatePeriodicVestingAccount], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.encode(value).finish(), + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.encode(value).finish(), + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value, + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value, + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value, + }; + }, + }, + toJSON: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.toJSON(value), + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.toJSON(value), + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.toJSON(value), + }; + }, + }, + fromJSON: { + createVestingAccount(value: any) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.fromJSON(value), + }; + }, + createPermanentLockedAccount(value: any) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.fromJSON(value), + }; + }, + createPeriodicVestingAccount(value: any) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.fromJSON(value), + }; + }, + }, + fromPartial: { + createVestingAccount(value: MsgCreateVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", + value: MsgCreateVestingAccount.fromPartial(value), + }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.fromPartial(value), + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmos/vesting/v1beta1/tx.ts b/src/cosmos/vesting/v1beta1/tx.ts index 5bc2c1e..6289ad8 100644 --- a/src/cosmos/vesting/v1beta1/tx.ts +++ b/src/cosmos/vesting/v1beta1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../base/v1beta1/coin"; import { Period } from "./vesting"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "cosmos.vesting.v1beta1"; /** * MsgCreateVestingAccount defines a message that enables creating a vesting @@ -13,7 +13,7 @@ export interface MsgCreateVestingAccount { toAddress: string; amount: Coin[]; /** end of vesting as unix time (in seconds). */ - endTime: Long; + endTime: bigint; delayed: boolean; } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ @@ -45,7 +45,7 @@ export interface MsgCreatePeriodicVestingAccount { fromAddress: string; toAddress: string; /** start of vesting as unix time (in seconds). */ - startTime: Long; + startTime: bigint; vestingPeriods: Period[]; } /** @@ -60,12 +60,12 @@ function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { fromAddress: "", toAddress: "", amount: [], - endTime: Long.ZERO, + endTime: BigInt(0), delayed: false, }; } export const MsgCreateVestingAccount = { - encode(message: MsgCreateVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } @@ -75,7 +75,7 @@ export const MsgCreateVestingAccount = { for (const v of message.amount) { Coin.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (!message.endTime.isZero()) { + if (message.endTime !== BigInt(0)) { writer.uint32(32).int64(message.endTime); } if (message.delayed === true) { @@ -83,8 +83,8 @@ export const MsgCreateVestingAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateVestingAccount(); while (reader.pos < end) { @@ -100,7 +100,7 @@ export const MsgCreateVestingAccount = { message.amount.push(Coin.decode(reader, reader.uint32())); break; case 4: - message.endTime = reader.int64() as Long; + message.endTime = reader.int64(); break; case 5: message.delayed = reader.bool(); @@ -117,7 +117,7 @@ export const MsgCreateVestingAccount = { if (isSet(object.fromAddress)) obj.fromAddress = String(object.fromAddress); if (isSet(object.toAddress)) obj.toAddress = String(object.toAddress); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); - if (isSet(object.endTime)) obj.endTime = Long.fromValue(object.endTime); + if (isSet(object.endTime)) obj.endTime = BigInt(object.endTime.toString()); if (isSet(object.delayed)) obj.delayed = Boolean(object.delayed); return obj; }, @@ -130,17 +130,17 @@ export const MsgCreateVestingAccount = { } else { obj.amount = []; } - message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); + message.endTime !== undefined && (obj.endTime = (message.endTime || BigInt(0)).toString()); message.delayed !== undefined && (obj.delayed = message.delayed); return obj; }, - fromPartial, I>>(object: I): MsgCreateVestingAccount { + fromPartial(object: Partial): MsgCreateVestingAccount { const message = createBaseMsgCreateVestingAccount(); message.fromAddress = object.fromAddress ?? ""; message.toAddress = object.toAddress ?? ""; message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; if (object.endTime !== undefined && object.endTime !== null) { - message.endTime = Long.fromValue(object.endTime); + message.endTime = BigInt(object.endTime.toString()); } message.delayed = object.delayed ?? false; return message; @@ -150,11 +150,11 @@ function createBaseMsgCreateVestingAccountResponse(): MsgCreateVestingAccountRes return {}; } export const MsgCreateVestingAccountResponse = { - encode(_: MsgCreateVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgCreateVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateVestingAccountResponse(); while (reader.pos < end) { @@ -175,9 +175,7 @@ export const MsgCreateVestingAccountResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgCreateVestingAccountResponse { + fromPartial(_: Partial): MsgCreateVestingAccountResponse { const message = createBaseMsgCreateVestingAccountResponse(); return message; }, @@ -190,7 +188,10 @@ function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAc }; } export const MsgCreatePermanentLockedAccount = { - encode(message: MsgCreatePermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgCreatePermanentLockedAccount, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } @@ -202,8 +203,8 @@ export const MsgCreatePermanentLockedAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePermanentLockedAccount(); while (reader.pos < end) { @@ -243,9 +244,7 @@ export const MsgCreatePermanentLockedAccount = { } return obj; }, - fromPartial, I>>( - object: I, - ): MsgCreatePermanentLockedAccount { + fromPartial(object: Partial): MsgCreatePermanentLockedAccount { const message = createBaseMsgCreatePermanentLockedAccount(); message.fromAddress = object.fromAddress ?? ""; message.toAddress = object.toAddress ?? ""; @@ -257,11 +256,14 @@ function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanent return {}; } export const MsgCreatePermanentLockedAccountResponse = { - encode(_: MsgCreatePermanentLockedAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: MsgCreatePermanentLockedAccountResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePermanentLockedAccountResponse(); while (reader.pos < end) { @@ -282,9 +284,7 @@ export const MsgCreatePermanentLockedAccountResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgCreatePermanentLockedAccountResponse { + fromPartial(_: Partial): MsgCreatePermanentLockedAccountResponse { const message = createBaseMsgCreatePermanentLockedAccountResponse(); return message; }, @@ -293,19 +293,22 @@ function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAc return { fromAddress: "", toAddress: "", - startTime: Long.ZERO, + startTime: BigInt(0), vestingPeriods: [], }; } export const MsgCreatePeriodicVestingAccount = { - encode(message: MsgCreatePeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgCreatePeriodicVestingAccount, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } if (message.toAddress !== "") { writer.uint32(18).string(message.toAddress); } - if (!message.startTime.isZero()) { + if (message.startTime !== BigInt(0)) { writer.uint32(24).int64(message.startTime); } for (const v of message.vestingPeriods) { @@ -313,8 +316,8 @@ export const MsgCreatePeriodicVestingAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePeriodicVestingAccount(); while (reader.pos < end) { @@ -327,7 +330,7 @@ export const MsgCreatePeriodicVestingAccount = { message.toAddress = reader.string(); break; case 3: - message.startTime = reader.int64() as Long; + message.startTime = reader.int64(); break; case 4: message.vestingPeriods.push(Period.decode(reader, reader.uint32())); @@ -343,7 +346,7 @@ export const MsgCreatePeriodicVestingAccount = { const obj = createBaseMsgCreatePeriodicVestingAccount(); if (isSet(object.fromAddress)) obj.fromAddress = String(object.fromAddress); if (isSet(object.toAddress)) obj.toAddress = String(object.toAddress); - if (isSet(object.startTime)) obj.startTime = Long.fromValue(object.startTime); + if (isSet(object.startTime)) obj.startTime = BigInt(object.startTime.toString()); if (Array.isArray(object?.vestingPeriods)) obj.vestingPeriods = object.vestingPeriods.map((e: any) => Period.fromJSON(e)); return obj; @@ -352,7 +355,7 @@ export const MsgCreatePeriodicVestingAccount = { const obj: any = {}; message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); message.toAddress !== undefined && (obj.toAddress = message.toAddress); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + message.startTime !== undefined && (obj.startTime = (message.startTime || BigInt(0)).toString()); if (message.vestingPeriods) { obj.vestingPeriods = message.vestingPeriods.map((e) => (e ? Period.toJSON(e) : undefined)); } else { @@ -360,14 +363,12 @@ export const MsgCreatePeriodicVestingAccount = { } return obj; }, - fromPartial, I>>( - object: I, - ): MsgCreatePeriodicVestingAccount { + fromPartial(object: Partial): MsgCreatePeriodicVestingAccount { const message = createBaseMsgCreatePeriodicVestingAccount(); message.fromAddress = object.fromAddress ?? ""; message.toAddress = object.toAddress ?? ""; if (object.startTime !== undefined && object.startTime !== null) { - message.startTime = Long.fromValue(object.startTime); + message.startTime = BigInt(object.startTime.toString()); } message.vestingPeriods = object.vestingPeriods?.map((e) => Period.fromPartial(e)) || []; return message; @@ -377,11 +378,14 @@ function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicV return {}; } export const MsgCreatePeriodicVestingAccountResponse = { - encode(_: MsgCreatePeriodicVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: MsgCreatePeriodicVestingAccountResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreatePeriodicVestingAccountResponse(); while (reader.pos < end) { @@ -402,9 +406,7 @@ export const MsgCreatePeriodicVestingAccountResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgCreatePeriodicVestingAccountResponse { + fromPartial(_: Partial): MsgCreatePeriodicVestingAccountResponse { const message = createBaseMsgCreatePeriodicVestingAccountResponse(); return message; }, @@ -446,20 +448,20 @@ export class MsgClientImpl implements Msg { CreateVestingAccount(request: MsgCreateVestingAccount): Promise { const data = MsgCreateVestingAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); - return promise.then((data) => MsgCreateVestingAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreateVestingAccountResponse.decode(new BinaryReader(data))); } CreatePermanentLockedAccount( request: MsgCreatePermanentLockedAccount, ): Promise { const data = MsgCreatePermanentLockedAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePermanentLockedAccount", data); - return promise.then((data) => MsgCreatePermanentLockedAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreatePermanentLockedAccountResponse.decode(new BinaryReader(data))); } CreatePeriodicVestingAccount( request: MsgCreatePeriodicVestingAccount, ): Promise { const data = MsgCreatePeriodicVestingAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePeriodicVestingAccount", data); - return promise.then((data) => MsgCreatePeriodicVestingAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreatePeriodicVestingAccountResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmos/vesting/v1beta1/vesting.ts b/src/cosmos/vesting/v1beta1/vesting.ts index 6a50133..7d094f7 100644 --- a/src/cosmos/vesting/v1beta1/vesting.ts +++ b/src/cosmos/vesting/v1beta1/vesting.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { BaseAccount } from "../../auth/v1beta1/auth"; import { Coin } from "../../base/v1beta1/coin"; -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "cosmos.vesting.v1beta1"; /** * BaseVestingAccount implements the VestingAccount interface. It contains all @@ -14,7 +14,7 @@ export interface BaseVestingAccount { delegatedFree: Coin[]; delegatedVesting: Coin[]; /** Vesting end time, as unix timestamp (in seconds). */ - endTime: Long; + endTime: bigint; } /** * ContinuousVestingAccount implements the VestingAccount interface. It @@ -23,7 +23,7 @@ export interface BaseVestingAccount { export interface ContinuousVestingAccount { baseVestingAccount: BaseVestingAccount; /** Vesting start time, as unix timestamp (in seconds). */ - startTime: Long; + startTime: bigint; } /** * DelayedVestingAccount implements the VestingAccount interface. It vests all @@ -36,7 +36,7 @@ export interface DelayedVestingAccount { /** Period defines a length of time and amount of coins that will vest. */ export interface Period { /** Period duration in seconds. */ - length: Long; + length: bigint; amount: Coin[]; } /** @@ -45,7 +45,7 @@ export interface Period { */ export interface PeriodicVestingAccount { baseVestingAccount: BaseVestingAccount; - startTime: Long; + startTime: bigint; vestingPeriods: Period[]; } /** @@ -64,11 +64,11 @@ function createBaseBaseVestingAccount(): BaseVestingAccount { originalVesting: [], delegatedFree: [], delegatedVesting: [], - endTime: Long.ZERO, + endTime: BigInt(0), }; } export const BaseVestingAccount = { - encode(message: BaseVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BaseVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } @@ -81,13 +81,13 @@ export const BaseVestingAccount = { for (const v of message.delegatedVesting) { Coin.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (!message.endTime.isZero()) { + if (message.endTime !== BigInt(0)) { writer.uint32(40).int64(message.endTime); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BaseVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BaseVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBaseVestingAccount(); while (reader.pos < end) { @@ -106,7 +106,7 @@ export const BaseVestingAccount = { message.delegatedVesting.push(Coin.decode(reader, reader.uint32())); break; case 5: - message.endTime = reader.int64() as Long; + message.endTime = reader.int64(); break; default: reader.skipType(tag & 7); @@ -124,7 +124,7 @@ export const BaseVestingAccount = { obj.delegatedFree = object.delegatedFree.map((e: any) => Coin.fromJSON(e)); if (Array.isArray(object?.delegatedVesting)) obj.delegatedVesting = object.delegatedVesting.map((e: any) => Coin.fromJSON(e)); - if (isSet(object.endTime)) obj.endTime = Long.fromValue(object.endTime); + if (isSet(object.endTime)) obj.endTime = BigInt(object.endTime.toString()); return obj; }, toJSON(message: BaseVestingAccount): unknown { @@ -146,10 +146,10 @@ export const BaseVestingAccount = { } else { obj.delegatedVesting = []; } - message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); + message.endTime !== undefined && (obj.endTime = (message.endTime || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): BaseVestingAccount { + fromPartial(object: Partial): BaseVestingAccount { const message = createBaseBaseVestingAccount(); if (object.baseAccount !== undefined && object.baseAccount !== null) { message.baseAccount = BaseAccount.fromPartial(object.baseAccount); @@ -158,7 +158,7 @@ export const BaseVestingAccount = { message.delegatedFree = object.delegatedFree?.map((e) => Coin.fromPartial(e)) || []; message.delegatedVesting = object.delegatedVesting?.map((e) => Coin.fromPartial(e)) || []; if (object.endTime !== undefined && object.endTime !== null) { - message.endTime = Long.fromValue(object.endTime); + message.endTime = BigInt(object.endTime.toString()); } return message; }, @@ -166,21 +166,21 @@ export const BaseVestingAccount = { function createBaseContinuousVestingAccount(): ContinuousVestingAccount { return { baseVestingAccount: BaseVestingAccount.fromPartial({}), - startTime: Long.ZERO, + startTime: BigInt(0), }; } export const ContinuousVestingAccount = { - encode(message: ContinuousVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ContinuousVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } - if (!message.startTime.isZero()) { + if (message.startTime !== BigInt(0)) { writer.uint32(16).int64(message.startTime); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContinuousVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContinuousVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContinuousVestingAccount(); while (reader.pos < end) { @@ -190,7 +190,7 @@ export const ContinuousVestingAccount = { message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; case 2: - message.startTime = reader.int64() as Long; + message.startTime = reader.int64(); break; default: reader.skipType(tag & 7); @@ -203,7 +203,7 @@ export const ContinuousVestingAccount = { const obj = createBaseContinuousVestingAccount(); if (isSet(object.baseVestingAccount)) obj.baseVestingAccount = BaseVestingAccount.fromJSON(object.baseVestingAccount); - if (isSet(object.startTime)) obj.startTime = Long.fromValue(object.startTime); + if (isSet(object.startTime)) obj.startTime = BigInt(object.startTime.toString()); return obj; }, toJSON(message: ContinuousVestingAccount): unknown { @@ -212,18 +212,16 @@ export const ContinuousVestingAccount = { (obj.baseVestingAccount = message.baseVestingAccount ? BaseVestingAccount.toJSON(message.baseVestingAccount) : undefined); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + message.startTime !== undefined && (obj.startTime = (message.startTime || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): ContinuousVestingAccount { + fromPartial(object: Partial): ContinuousVestingAccount { const message = createBaseContinuousVestingAccount(); if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); } if (object.startTime !== undefined && object.startTime !== null) { - message.startTime = Long.fromValue(object.startTime); + message.startTime = BigInt(object.startTime.toString()); } return message; }, @@ -234,14 +232,14 @@ function createBaseDelayedVestingAccount(): DelayedVestingAccount { }; } export const DelayedVestingAccount = { - encode(message: DelayedVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelayedVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelayedVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelayedVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelayedVestingAccount(); while (reader.pos < end) { @@ -271,7 +269,7 @@ export const DelayedVestingAccount = { : undefined); return obj; }, - fromPartial, I>>(object: I): DelayedVestingAccount { + fromPartial(object: Partial): DelayedVestingAccount { const message = createBaseDelayedVestingAccount(); if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); @@ -281,13 +279,13 @@ export const DelayedVestingAccount = { }; function createBasePeriod(): Period { return { - length: Long.ZERO, + length: BigInt(0), amount: [], }; } export const Period = { - encode(message: Period, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.length.isZero()) { + encode(message: Period, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.length !== BigInt(0)) { writer.uint32(8).int64(message.length); } for (const v of message.amount) { @@ -295,15 +293,15 @@ export const Period = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Period { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Period { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePeriod(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.length = reader.int64() as Long; + message.length = reader.int64(); break; case 2: message.amount.push(Coin.decode(reader, reader.uint32())); @@ -317,13 +315,13 @@ export const Period = { }, fromJSON(object: any): Period { const obj = createBasePeriod(); - if (isSet(object.length)) obj.length = Long.fromValue(object.length); + if (isSet(object.length)) obj.length = BigInt(object.length.toString()); if (Array.isArray(object?.amount)) obj.amount = object.amount.map((e: any) => Coin.fromJSON(e)); return obj; }, toJSON(message: Period): unknown { const obj: any = {}; - message.length !== undefined && (obj.length = (message.length || Long.ZERO).toString()); + message.length !== undefined && (obj.length = (message.length || BigInt(0)).toString()); if (message.amount) { obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); } else { @@ -331,10 +329,10 @@ export const Period = { } return obj; }, - fromPartial, I>>(object: I): Period { + fromPartial(object: Partial): Period { const message = createBasePeriod(); if (object.length !== undefined && object.length !== null) { - message.length = Long.fromValue(object.length); + message.length = BigInt(object.length.toString()); } message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -343,16 +341,16 @@ export const Period = { function createBasePeriodicVestingAccount(): PeriodicVestingAccount { return { baseVestingAccount: BaseVestingAccount.fromPartial({}), - startTime: Long.ZERO, + startTime: BigInt(0), vestingPeriods: [], }; } export const PeriodicVestingAccount = { - encode(message: PeriodicVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } - if (!message.startTime.isZero()) { + if (message.startTime !== BigInt(0)) { writer.uint32(16).int64(message.startTime); } for (const v of message.vestingPeriods) { @@ -360,8 +358,8 @@ export const PeriodicVestingAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PeriodicVestingAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePeriodicVestingAccount(); while (reader.pos < end) { @@ -371,7 +369,7 @@ export const PeriodicVestingAccount = { message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32()); break; case 2: - message.startTime = reader.int64() as Long; + message.startTime = reader.int64(); break; case 3: message.vestingPeriods.push(Period.decode(reader, reader.uint32())); @@ -387,7 +385,7 @@ export const PeriodicVestingAccount = { const obj = createBasePeriodicVestingAccount(); if (isSet(object.baseVestingAccount)) obj.baseVestingAccount = BaseVestingAccount.fromJSON(object.baseVestingAccount); - if (isSet(object.startTime)) obj.startTime = Long.fromValue(object.startTime); + if (isSet(object.startTime)) obj.startTime = BigInt(object.startTime.toString()); if (Array.isArray(object?.vestingPeriods)) obj.vestingPeriods = object.vestingPeriods.map((e: any) => Period.fromJSON(e)); return obj; @@ -398,7 +396,7 @@ export const PeriodicVestingAccount = { (obj.baseVestingAccount = message.baseVestingAccount ? BaseVestingAccount.toJSON(message.baseVestingAccount) : undefined); - message.startTime !== undefined && (obj.startTime = (message.startTime || Long.ZERO).toString()); + message.startTime !== undefined && (obj.startTime = (message.startTime || BigInt(0)).toString()); if (message.vestingPeriods) { obj.vestingPeriods = message.vestingPeriods.map((e) => (e ? Period.toJSON(e) : undefined)); } else { @@ -406,13 +404,13 @@ export const PeriodicVestingAccount = { } return obj; }, - fromPartial, I>>(object: I): PeriodicVestingAccount { + fromPartial(object: Partial): PeriodicVestingAccount { const message = createBasePeriodicVestingAccount(); if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); } if (object.startTime !== undefined && object.startTime !== null) { - message.startTime = Long.fromValue(object.startTime); + message.startTime = BigInt(object.startTime.toString()); } message.vestingPeriods = object.vestingPeriods?.map((e) => Period.fromPartial(e)) || []; return message; @@ -424,14 +422,14 @@ function createBasePermanentLockedAccount(): PermanentLockedAccount { }; } export const PermanentLockedAccount = { - encode(message: PermanentLockedAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseVestingAccount !== undefined) { BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PermanentLockedAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePermanentLockedAccount(); while (reader.pos < end) { @@ -461,7 +459,7 @@ export const PermanentLockedAccount = { : undefined); return obj; }, - fromPartial, I>>(object: I): PermanentLockedAccount { + fromPartial(object: Partial): PermanentLockedAccount { const message = createBasePermanentLockedAccount(); if (object.baseVestingAccount !== undefined && object.baseVestingAccount !== null) { message.baseVestingAccount = BaseVestingAccount.fromPartial(object.baseVestingAccount); diff --git a/src/cosmos_proto/cosmos.ts b/src/cosmos_proto/cosmos.ts index 066e8ec..3a5d541 100644 --- a/src/cosmos_proto/cosmos.ts +++ b/src/cosmos_proto/cosmos.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../helpers"; +import { BinaryReader, BinaryWriter } from "../binary"; +import { isSet } from "../helpers"; export const protobufPackage = "cosmos_proto"; export enum ScalarType { SCALAR_TYPE_UNSPECIFIED = 0, @@ -94,7 +94,7 @@ function createBaseInterfaceDescriptor(): InterfaceDescriptor { }; } export const InterfaceDescriptor = { - encode(message: InterfaceDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InterfaceDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -103,8 +103,8 @@ export const InterfaceDescriptor = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterfaceDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterfaceDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterfaceDescriptor(); while (reader.pos < end) { @@ -135,7 +135,7 @@ export const InterfaceDescriptor = { message.description !== undefined && (obj.description = message.description); return obj; }, - fromPartial, I>>(object: I): InterfaceDescriptor { + fromPartial(object: Partial): InterfaceDescriptor { const message = createBaseInterfaceDescriptor(); message.name = object.name ?? ""; message.description = object.description ?? ""; @@ -150,7 +150,7 @@ function createBaseScalarDescriptor(): ScalarDescriptor { }; } export const ScalarDescriptor = { - encode(message: ScalarDescriptor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ScalarDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -164,8 +164,8 @@ export const ScalarDescriptor = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ScalarDescriptor { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ScalarDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseScalarDescriptor(); while (reader.pos < end) { @@ -213,7 +213,7 @@ export const ScalarDescriptor = { } return obj; }, - fromPartial, I>>(object: I): ScalarDescriptor { + fromPartial(object: Partial): ScalarDescriptor { const message = createBaseScalarDescriptor(); message.name = object.name ?? ""; message.description = object.description ?? ""; diff --git a/src/cosmwasm/client.ts b/src/cosmwasm/client.ts new file mode 100644 index 0000000..610ba89 --- /dev/null +++ b/src/cosmwasm/client.ts @@ -0,0 +1,39 @@ +/* eslint-disable */ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmwasmWasmV1TxRegistry from "./wasm/v1/tx.registry"; +import * as cosmwasmWasmV1TxAmino from "./wasm/v1/tx.amino"; +export const cosmwasmAminoConverters = { + ...cosmwasmWasmV1TxAmino.AminoConverter, +}; +export const cosmwasmProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...cosmwasmWasmV1TxRegistry.registry, +]; +export const getSigningCosmwasmClientOptions = (): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...cosmwasmProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...cosmwasmAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningCosmwasmClient = async ({ + rpcEndpoint, + signer, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +}) => { + const { registry, aminoTypes } = getSigningCosmwasmClientOptions(); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes, + }); + return client; +}; diff --git a/src/cosmwasm/wasm/v1/authz.ts b/src/cosmwasm/wasm/v1/authz.ts index 890608b..0d14b28 100644 --- a/src/cosmwasm/wasm/v1/authz.ts +++ b/src/cosmwasm/wasm/v1/authz.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Long, DeepPartial, Exact, isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** * ContractExecutionAuthorization defines authorization for wasm execute. @@ -45,7 +45,7 @@ export interface ContractGrant { */ export interface MaxCallsLimit { /** Remaining number that is decremented on each execution */ - remaining: Long; + remaining: bigint; } /** * MaxFundsLimit defines the maximal amounts that can be sent to the contract. @@ -62,7 +62,7 @@ export interface MaxFundsLimit { */ export interface CombinedLimit { /** Remaining number that is decremented on each execution */ - callsRemaining: Long; + callsRemaining: bigint; /** Amounts is the maximal amount of tokens transferable to the contract. */ amounts: Coin[]; } @@ -96,14 +96,17 @@ function createBaseContractExecutionAuthorization(): ContractExecutionAuthorizat }; } export const ContractExecutionAuthorization = { - encode(message: ContractExecutionAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ContractExecutionAuthorization, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.grants) { ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContractExecutionAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContractExecutionAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContractExecutionAuthorization(); while (reader.pos < end) { @@ -133,9 +136,7 @@ export const ContractExecutionAuthorization = { } return obj; }, - fromPartial, I>>( - object: I, - ): ContractExecutionAuthorization { + fromPartial(object: Partial): ContractExecutionAuthorization { const message = createBaseContractExecutionAuthorization(); message.grants = object.grants?.map((e) => ContractGrant.fromPartial(e)) || []; return message; @@ -147,14 +148,17 @@ function createBaseContractMigrationAuthorization(): ContractMigrationAuthorizat }; } export const ContractMigrationAuthorization = { - encode(message: ContractMigrationAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: ContractMigrationAuthorization, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.grants) { ContractGrant.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContractMigrationAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContractMigrationAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContractMigrationAuthorization(); while (reader.pos < end) { @@ -184,9 +188,7 @@ export const ContractMigrationAuthorization = { } return obj; }, - fromPartial, I>>( - object: I, - ): ContractMigrationAuthorization { + fromPartial(object: Partial): ContractMigrationAuthorization { const message = createBaseContractMigrationAuthorization(); message.grants = object.grants?.map((e) => ContractGrant.fromPartial(e)) || []; return message; @@ -200,7 +202,7 @@ function createBaseContractGrant(): ContractGrant { }; } export const ContractGrant = { - encode(message: ContractGrant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ContractGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contract !== "") { writer.uint32(10).string(message.contract); } @@ -212,8 +214,8 @@ export const ContractGrant = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContractGrant { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContractGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContractGrant(); while (reader.pos < end) { @@ -249,7 +251,7 @@ export const ContractGrant = { message.filter !== undefined && (obj.filter = message.filter ? Any.toJSON(message.filter) : undefined); return obj; }, - fromPartial, I>>(object: I): ContractGrant { + fromPartial(object: Partial): ContractGrant { const message = createBaseContractGrant(); message.contract = object.contract ?? ""; if (object.limit !== undefined && object.limit !== null) { @@ -263,25 +265,25 @@ export const ContractGrant = { }; function createBaseMaxCallsLimit(): MaxCallsLimit { return { - remaining: Long.UZERO, + remaining: BigInt(0), }; } export const MaxCallsLimit = { - encode(message: MaxCallsLimit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.remaining.isZero()) { + encode(message: MaxCallsLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.remaining !== BigInt(0)) { writer.uint32(8).uint64(message.remaining); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MaxCallsLimit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MaxCallsLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMaxCallsLimit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.remaining = reader.uint64() as Long; + message.remaining = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -292,18 +294,18 @@ export const MaxCallsLimit = { }, fromJSON(object: any): MaxCallsLimit { const obj = createBaseMaxCallsLimit(); - if (isSet(object.remaining)) obj.remaining = Long.fromValue(object.remaining); + if (isSet(object.remaining)) obj.remaining = BigInt(object.remaining.toString()); return obj; }, toJSON(message: MaxCallsLimit): unknown { const obj: any = {}; - message.remaining !== undefined && (obj.remaining = (message.remaining || Long.UZERO).toString()); + message.remaining !== undefined && (obj.remaining = (message.remaining || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MaxCallsLimit { + fromPartial(object: Partial): MaxCallsLimit { const message = createBaseMaxCallsLimit(); if (object.remaining !== undefined && object.remaining !== null) { - message.remaining = Long.fromValue(object.remaining); + message.remaining = BigInt(object.remaining.toString()); } return message; }, @@ -314,14 +316,14 @@ function createBaseMaxFundsLimit(): MaxFundsLimit { }; } export const MaxFundsLimit = { - encode(message: MaxFundsLimit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MaxFundsLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.amounts) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MaxFundsLimit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MaxFundsLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMaxFundsLimit(); while (reader.pos < end) { @@ -351,7 +353,7 @@ export const MaxFundsLimit = { } return obj; }, - fromPartial, I>>(object: I): MaxFundsLimit { + fromPartial(object: Partial): MaxFundsLimit { const message = createBaseMaxFundsLimit(); message.amounts = object.amounts?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -359,13 +361,13 @@ export const MaxFundsLimit = { }; function createBaseCombinedLimit(): CombinedLimit { return { - callsRemaining: Long.UZERO, + callsRemaining: BigInt(0), amounts: [], }; } export const CombinedLimit = { - encode(message: CombinedLimit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.callsRemaining.isZero()) { + encode(message: CombinedLimit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.callsRemaining !== BigInt(0)) { writer.uint32(8).uint64(message.callsRemaining); } for (const v of message.amounts) { @@ -373,15 +375,15 @@ export const CombinedLimit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CombinedLimit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CombinedLimit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCombinedLimit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.callsRemaining = reader.uint64() as Long; + message.callsRemaining = reader.uint64(); break; case 2: message.amounts.push(Coin.decode(reader, reader.uint32())); @@ -395,14 +397,14 @@ export const CombinedLimit = { }, fromJSON(object: any): CombinedLimit { const obj = createBaseCombinedLimit(); - if (isSet(object.callsRemaining)) obj.callsRemaining = Long.fromValue(object.callsRemaining); + if (isSet(object.callsRemaining)) obj.callsRemaining = BigInt(object.callsRemaining.toString()); if (Array.isArray(object?.amounts)) obj.amounts = object.amounts.map((e: any) => Coin.fromJSON(e)); return obj; }, toJSON(message: CombinedLimit): unknown { const obj: any = {}; message.callsRemaining !== undefined && - (obj.callsRemaining = (message.callsRemaining || Long.UZERO).toString()); + (obj.callsRemaining = (message.callsRemaining || BigInt(0)).toString()); if (message.amounts) { obj.amounts = message.amounts.map((e) => (e ? Coin.toJSON(e) : undefined)); } else { @@ -410,10 +412,10 @@ export const CombinedLimit = { } return obj; }, - fromPartial, I>>(object: I): CombinedLimit { + fromPartial(object: Partial): CombinedLimit { const message = createBaseCombinedLimit(); if (object.callsRemaining !== undefined && object.callsRemaining !== null) { - message.callsRemaining = Long.fromValue(object.callsRemaining); + message.callsRemaining = BigInt(object.callsRemaining.toString()); } message.amounts = object.amounts?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -423,11 +425,11 @@ function createBaseAllowAllMessagesFilter(): AllowAllMessagesFilter { return {}; } export const AllowAllMessagesFilter = { - encode(_: AllowAllMessagesFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: AllowAllMessagesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowAllMessagesFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowAllMessagesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowAllMessagesFilter(); while (reader.pos < end) { @@ -448,7 +450,7 @@ export const AllowAllMessagesFilter = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): AllowAllMessagesFilter { + fromPartial(_: Partial): AllowAllMessagesFilter { const message = createBaseAllowAllMessagesFilter(); return message; }, @@ -459,14 +461,14 @@ function createBaseAcceptedMessageKeysFilter(): AcceptedMessageKeysFilter { }; } export const AcceptedMessageKeysFilter = { - encode(message: AcceptedMessageKeysFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AcceptedMessageKeysFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.keys) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AcceptedMessageKeysFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AcceptedMessageKeysFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAcceptedMessageKeysFilter(); while (reader.pos < end) { @@ -496,9 +498,7 @@ export const AcceptedMessageKeysFilter = { } return obj; }, - fromPartial, I>>( - object: I, - ): AcceptedMessageKeysFilter { + fromPartial(object: Partial): AcceptedMessageKeysFilter { const message = createBaseAcceptedMessageKeysFilter(); message.keys = object.keys?.map((e) => e) || []; return message; @@ -510,14 +510,14 @@ function createBaseAcceptedMessagesFilter(): AcceptedMessagesFilter { }; } export const AcceptedMessagesFilter = { - encode(message: AcceptedMessagesFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AcceptedMessagesFilter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AcceptedMessagesFilter { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AcceptedMessagesFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAcceptedMessagesFilter(); while (reader.pos < end) { @@ -547,7 +547,7 @@ export const AcceptedMessagesFilter = { } return obj; }, - fromPartial, I>>(object: I): AcceptedMessagesFilter { + fromPartial(object: Partial): AcceptedMessagesFilter { const message = createBaseAcceptedMessagesFilter(); message.messages = object.messages?.map((e) => e) || []; return message; diff --git a/src/cosmwasm/wasm/v1/genesis.ts b/src/cosmwasm/wasm/v1/genesis.ts index ec27724..1df9498 100644 --- a/src/cosmwasm/wasm/v1/genesis.ts +++ b/src/cosmwasm/wasm/v1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params, CodeInfo, ContractInfo, Model, ContractCodeHistoryEntry } from "./types"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** GenesisState - genesis state of x/wasm */ export interface GenesisState { @@ -12,7 +12,7 @@ export interface GenesisState { } /** Code struct encompasses CodeInfo and CodeBytes */ export interface Code { - codeId: Long; + codeId: bigint; codeInfo: CodeInfo; codeBytes: Uint8Array; /** Pinned to wasmvm cache */ @@ -28,7 +28,7 @@ export interface Contract { /** Sequence key and value of an id generation counter */ export interface Sequence { idKey: Uint8Array; - value: Long; + value: bigint; } function createBaseGenesisState(): GenesisState { return { @@ -39,7 +39,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -54,8 +54,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -110,7 +110,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -123,15 +123,15 @@ export const GenesisState = { }; function createBaseCode(): Code { return { - codeId: Long.UZERO, + codeId: BigInt(0), codeInfo: CodeInfo.fromPartial({}), codeBytes: new Uint8Array(), pinned: false, }; } export const Code = { - encode(message: Code, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: Code, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } if (message.codeInfo !== undefined) { @@ -145,15 +145,15 @@ export const Code = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Code { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Code { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCode(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 2: message.codeInfo = CodeInfo.decode(reader, reader.uint32()); @@ -173,7 +173,7 @@ export const Code = { }, fromJSON(object: any): Code { const obj = createBaseCode(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.codeInfo)) obj.codeInfo = CodeInfo.fromJSON(object.codeInfo); if (isSet(object.codeBytes)) obj.codeBytes = bytesFromBase64(object.codeBytes); if (isSet(object.pinned)) obj.pinned = Boolean(object.pinned); @@ -181,7 +181,7 @@ export const Code = { }, toJSON(message: Code): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.codeInfo !== undefined && (obj.codeInfo = message.codeInfo ? CodeInfo.toJSON(message.codeInfo) : undefined); message.codeBytes !== undefined && @@ -191,10 +191,10 @@ export const Code = { message.pinned !== undefined && (obj.pinned = message.pinned); return obj; }, - fromPartial, I>>(object: I): Code { + fromPartial(object: Partial): Code { const message = createBaseCode(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } if (object.codeInfo !== undefined && object.codeInfo !== null) { message.codeInfo = CodeInfo.fromPartial(object.codeInfo); @@ -213,7 +213,7 @@ function createBaseContract(): Contract { }; } export const Contract = { - encode(message: Contract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.contractAddress !== "") { writer.uint32(10).string(message.contractAddress); } @@ -228,8 +228,8 @@ export const Contract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Contract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContract(); while (reader.pos < end) { @@ -285,7 +285,7 @@ export const Contract = { } return obj; }, - fromPartial, I>>(object: I): Contract { + fromPartial(object: Partial): Contract { const message = createBaseContract(); message.contractAddress = object.contractAddress ?? ""; if (object.contractInfo !== undefined && object.contractInfo !== null) { @@ -300,21 +300,21 @@ export const Contract = { function createBaseSequence(): Sequence { return { idKey: new Uint8Array(), - value: Long.UZERO, + value: BigInt(0), }; } export const Sequence = { - encode(message: Sequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Sequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.idKey.length !== 0) { writer.uint32(10).bytes(message.idKey); } - if (!message.value.isZero()) { + if (message.value !== BigInt(0)) { writer.uint32(16).uint64(message.value); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Sequence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Sequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSequence(); while (reader.pos < end) { @@ -324,7 +324,7 @@ export const Sequence = { message.idKey = reader.bytes(); break; case 2: - message.value = reader.uint64() as Long; + message.value = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -336,21 +336,21 @@ export const Sequence = { fromJSON(object: any): Sequence { const obj = createBaseSequence(); if (isSet(object.idKey)) obj.idKey = bytesFromBase64(object.idKey); - if (isSet(object.value)) obj.value = Long.fromValue(object.value); + if (isSet(object.value)) obj.value = BigInt(object.value.toString()); return obj; }, toJSON(message: Sequence): unknown { const obj: any = {}; message.idKey !== undefined && (obj.idKey = base64FromBytes(message.idKey !== undefined ? message.idKey : new Uint8Array())); - message.value !== undefined && (obj.value = (message.value || Long.UZERO).toString()); + message.value !== undefined && (obj.value = (message.value || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Sequence { + fromPartial(object: Partial): Sequence { const message = createBaseSequence(); message.idKey = object.idKey ?? new Uint8Array(); if (object.value !== undefined && object.value !== null) { - message.value = Long.fromValue(object.value); + message.value = BigInt(object.value.toString()); } return message; }, diff --git a/src/cosmwasm/wasm/v1/ibc.ts b/src/cosmwasm/wasm/v1/ibc.ts index 9f9a48e..09f95c3 100644 --- a/src/cosmwasm/wasm/v1/ibc.ts +++ b/src/cosmwasm/wasm/v1/ibc.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** MsgIBCSend */ export interface MsgIBCSend { @@ -10,12 +10,12 @@ export interface MsgIBCSend { * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeoutHeight: Long; + timeoutHeight: bigint; /** * Timeout timestamp (in nanoseconds) relative to the current block timestamp. * The timeout is disabled when set to 0. */ - timeoutTimestamp: Long; + timeoutTimestamp: bigint; /** * Data is the payload to transfer. We must not make assumption what format or * content is in here. @@ -25,7 +25,7 @@ export interface MsgIBCSend { /** MsgIBCSendResponse */ export interface MsgIBCSendResponse { /** Sequence number of the IBC packet sent */ - sequence: Long; + sequence: bigint; } /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannel { @@ -34,20 +34,20 @@ export interface MsgIBCCloseChannel { function createBaseMsgIBCSend(): MsgIBCSend { return { channel: "", - timeoutHeight: Long.UZERO, - timeoutTimestamp: Long.UZERO, + timeoutHeight: BigInt(0), + timeoutTimestamp: BigInt(0), data: new Uint8Array(), }; } export const MsgIBCSend = { - encode(message: MsgIBCSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgIBCSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channel !== "") { writer.uint32(18).string(message.channel); } - if (!message.timeoutHeight.isZero()) { + if (message.timeoutHeight !== BigInt(0)) { writer.uint32(32).uint64(message.timeoutHeight); } - if (!message.timeoutTimestamp.isZero()) { + if (message.timeoutTimestamp !== BigInt(0)) { writer.uint32(40).uint64(message.timeoutTimestamp); } if (message.data.length !== 0) { @@ -55,8 +55,8 @@ export const MsgIBCSend = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSend { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgIBCSend(); while (reader.pos < end) { @@ -66,10 +66,10 @@ export const MsgIBCSend = { message.channel = reader.string(); break; case 4: - message.timeoutHeight = reader.uint64() as Long; + message.timeoutHeight = reader.uint64(); break; case 5: - message.timeoutTimestamp = reader.uint64() as Long; + message.timeoutTimestamp = reader.uint64(); break; case 6: message.data = reader.bytes(); @@ -84,8 +84,8 @@ export const MsgIBCSend = { fromJSON(object: any): MsgIBCSend { const obj = createBaseMsgIBCSend(); if (isSet(object.channel)) obj.channel = String(object.channel); - if (isSet(object.timeoutHeight)) obj.timeoutHeight = Long.fromValue(object.timeoutHeight); - if (isSet(object.timeoutTimestamp)) obj.timeoutTimestamp = Long.fromValue(object.timeoutTimestamp); + if (isSet(object.timeoutHeight)) obj.timeoutHeight = BigInt(object.timeoutHeight.toString()); + if (isSet(object.timeoutTimestamp)) obj.timeoutTimestamp = BigInt(object.timeoutTimestamp.toString()); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); return obj; }, @@ -93,21 +93,21 @@ export const MsgIBCSend = { const obj: any = {}; message.channel !== undefined && (obj.channel = message.channel); message.timeoutHeight !== undefined && - (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); + (obj.timeoutHeight = (message.timeoutHeight || BigInt(0)).toString()); message.timeoutTimestamp !== undefined && - (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MsgIBCSend { + fromPartial(object: Partial): MsgIBCSend { const message = createBaseMsgIBCSend(); message.channel = object.channel ?? ""; if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { - message.timeoutHeight = Long.fromValue(object.timeoutHeight); + message.timeoutHeight = BigInt(object.timeoutHeight.toString()); } if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { - message.timeoutTimestamp = Long.fromValue(object.timeoutTimestamp); + message.timeoutTimestamp = BigInt(object.timeoutTimestamp.toString()); } message.data = object.data ?? new Uint8Array(); return message; @@ -115,25 +115,25 @@ export const MsgIBCSend = { }; function createBaseMsgIBCSendResponse(): MsgIBCSendResponse { return { - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const MsgIBCSendResponse = { - encode(message: MsgIBCSendResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: MsgIBCSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSendResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgIBCSendResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -144,18 +144,18 @@ export const MsgIBCSendResponse = { }, fromJSON(object: any): MsgIBCSendResponse { const obj = createBaseMsgIBCSendResponse(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: MsgIBCSendResponse): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgIBCSendResponse { + fromPartial(object: Partial): MsgIBCSendResponse { const message = createBaseMsgIBCSendResponse(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -166,14 +166,14 @@ function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { }; } export const MsgIBCCloseChannel = { - encode(message: MsgIBCCloseChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgIBCCloseChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channel !== "") { writer.uint32(18).string(message.channel); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCCloseChannel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCCloseChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgIBCCloseChannel(); while (reader.pos < end) { @@ -199,7 +199,7 @@ export const MsgIBCCloseChannel = { message.channel !== undefined && (obj.channel = message.channel); return obj; }, - fromPartial, I>>(object: I): MsgIBCCloseChannel { + fromPartial(object: Partial): MsgIBCCloseChannel { const message = createBaseMsgIBCCloseChannel(); message.channel = object.channel ?? ""; return message; diff --git a/src/cosmwasm/wasm/v1/proposal.ts b/src/cosmwasm/wasm/v1/proposal.ts index 774dc71..84963ee 100644 --- a/src/cosmwasm/wasm/v1/proposal.ts +++ b/src/cosmwasm/wasm/v1/proposal.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { AccessConfig } from "./types"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for @@ -54,7 +54,7 @@ export interface InstantiateContractProposal { /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ - codeId: Long; + codeId: bigint; /** Label is optional metadata to be stored with a constract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ @@ -79,7 +79,7 @@ export interface InstantiateContract2Proposal { /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ - codeId: Long; + codeId: bigint; /** Label is optional metadata to be stored with a constract instance. */ label: string; /** Msg json encode message to be passed to the contract on instantiation */ @@ -109,7 +109,7 @@ export interface MigrateContractProposal { /** Contract is the address of the smart contract */ contract: string; /** CodeID references the new WASM code */ - codeId: Long; + codeId: bigint; /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } @@ -196,7 +196,7 @@ export interface PinCodesProposal { /** Description is a human readable text */ description: string; /** CodeIDs references the new WASM codes */ - codeIds: Long[]; + codeIds: bigint[]; } /** * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for @@ -211,7 +211,7 @@ export interface UnpinCodesProposal { /** Description is a human readable text */ description: string; /** CodeIDs references the WASM codes */ - codeIds: Long[]; + codeIds: bigint[]; } /** * AccessConfigUpdate contains the code id and the access config to be @@ -219,7 +219,7 @@ export interface UnpinCodesProposal { */ export interface AccessConfigUpdate { /** CodeID is the reference to the stored WASM code to be updated */ - codeId: Long; + codeId: bigint; /** InstantiatePermission to apply to the set of code ids */ instantiatePermission: AccessConfig; } @@ -296,7 +296,7 @@ function createBaseStoreCodeProposal(): StoreCodeProposal { }; } export const StoreCodeProposal = { - encode(message: StoreCodeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: StoreCodeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -326,8 +326,8 @@ export const StoreCodeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreCodeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreCodeProposal(); while (reader.pos < end) { @@ -401,7 +401,7 @@ export const StoreCodeProposal = { (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): StoreCodeProposal { + fromPartial(object: Partial): StoreCodeProposal { const message = createBaseStoreCodeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -423,14 +423,14 @@ function createBaseInstantiateContractProposal(): InstantiateContractProposal { description: "", runAs: "", admin: "", - codeId: Long.UZERO, + codeId: BigInt(0), label: "", msg: new Uint8Array(), funds: [], }; } export const InstantiateContractProposal = { - encode(message: InstantiateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -443,7 +443,7 @@ export const InstantiateContractProposal = { if (message.admin !== "") { writer.uint32(34).string(message.admin); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(40).uint64(message.codeId); } if (message.label !== "") { @@ -457,8 +457,8 @@ export const InstantiateContractProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InstantiateContractProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInstantiateContractProposal(); while (reader.pos < end) { @@ -477,7 +477,7 @@ export const InstantiateContractProposal = { message.admin = reader.string(); break; case 5: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 6: message.label = reader.string(); @@ -501,7 +501,7 @@ export const InstantiateContractProposal = { if (isSet(object.description)) obj.description = String(object.description); if (isSet(object.runAs)) obj.runAs = String(object.runAs); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.label)) obj.label = String(object.label); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); if (Array.isArray(object?.funds)) obj.funds = object.funds.map((e: any) => Coin.fromJSON(e)); @@ -513,7 +513,7 @@ export const InstantiateContractProposal = { message.description !== undefined && (obj.description = message.description); message.runAs !== undefined && (obj.runAs = message.runAs); message.admin !== undefined && (obj.admin = message.admin); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.label !== undefined && (obj.label = message.label); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); @@ -524,16 +524,14 @@ export const InstantiateContractProposal = { } return obj; }, - fromPartial, I>>( - object: I, - ): InstantiateContractProposal { + fromPartial(object: Partial): InstantiateContractProposal { const message = createBaseInstantiateContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.runAs = object.runAs ?? ""; message.admin = object.admin ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); @@ -547,7 +545,7 @@ function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal description: "", runAs: "", admin: "", - codeId: Long.UZERO, + codeId: BigInt(0), label: "", msg: new Uint8Array(), funds: [], @@ -556,7 +554,7 @@ function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal }; } export const InstantiateContract2Proposal = { - encode(message: InstantiateContract2Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InstantiateContract2Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -569,7 +567,7 @@ export const InstantiateContract2Proposal = { if (message.admin !== "") { writer.uint32(34).string(message.admin); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(40).uint64(message.codeId); } if (message.label !== "") { @@ -589,8 +587,8 @@ export const InstantiateContract2Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InstantiateContract2Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContract2Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInstantiateContract2Proposal(); while (reader.pos < end) { @@ -609,7 +607,7 @@ export const InstantiateContract2Proposal = { message.admin = reader.string(); break; case 5: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 6: message.label = reader.string(); @@ -639,7 +637,7 @@ export const InstantiateContract2Proposal = { if (isSet(object.description)) obj.description = String(object.description); if (isSet(object.runAs)) obj.runAs = String(object.runAs); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.label)) obj.label = String(object.label); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); if (Array.isArray(object?.funds)) obj.funds = object.funds.map((e: any) => Coin.fromJSON(e)); @@ -653,7 +651,7 @@ export const InstantiateContract2Proposal = { message.description !== undefined && (obj.description = message.description); message.runAs !== undefined && (obj.runAs = message.runAs); message.admin !== undefined && (obj.admin = message.admin); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.label !== undefined && (obj.label = message.label); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); @@ -667,16 +665,14 @@ export const InstantiateContract2Proposal = { message.fixMsg !== undefined && (obj.fixMsg = message.fixMsg); return obj; }, - fromPartial, I>>( - object: I, - ): InstantiateContract2Proposal { + fromPartial(object: Partial): InstantiateContract2Proposal { const message = createBaseInstantiateContract2Proposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.runAs = object.runAs ?? ""; message.admin = object.admin ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); @@ -691,12 +687,12 @@ function createBaseMigrateContractProposal(): MigrateContractProposal { title: "", description: "", contract: "", - codeId: Long.UZERO, + codeId: BigInt(0), msg: new Uint8Array(), }; } export const MigrateContractProposal = { - encode(message: MigrateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MigrateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -706,7 +702,7 @@ export const MigrateContractProposal = { if (message.contract !== "") { writer.uint32(34).string(message.contract); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(40).uint64(message.codeId); } if (message.msg.length !== 0) { @@ -714,8 +710,8 @@ export const MigrateContractProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MigrateContractProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MigrateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMigrateContractProposal(); while (reader.pos < end) { @@ -731,7 +727,7 @@ export const MigrateContractProposal = { message.contract = reader.string(); break; case 5: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 6: message.msg = reader.bytes(); @@ -748,7 +744,7 @@ export const MigrateContractProposal = { if (isSet(object.title)) obj.title = String(object.title); if (isSet(object.description)) obj.description = String(object.description); if (isSet(object.contract)) obj.contract = String(object.contract); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); return obj; }, @@ -757,18 +753,18 @@ export const MigrateContractProposal = { message.title !== undefined && (obj.title = message.title); message.description !== undefined && (obj.description = message.description); message.contract !== undefined && (obj.contract = message.contract); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MigrateContractProposal { + fromPartial(object: Partial): MigrateContractProposal { const message = createBaseMigrateContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; message.contract = object.contract ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.msg = object.msg ?? new Uint8Array(); return message; @@ -783,7 +779,7 @@ function createBaseSudoContractProposal(): SudoContractProposal { }; } export const SudoContractProposal = { - encode(message: SudoContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SudoContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -798,8 +794,8 @@ export const SudoContractProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SudoContractProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SudoContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSudoContractProposal(); while (reader.pos < end) { @@ -841,7 +837,7 @@ export const SudoContractProposal = { (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): SudoContractProposal { + fromPartial(object: Partial): SudoContractProposal { const message = createBaseSudoContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -861,7 +857,7 @@ function createBaseExecuteContractProposal(): ExecuteContractProposal { }; } export const ExecuteContractProposal = { - encode(message: ExecuteContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ExecuteContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -882,8 +878,8 @@ export const ExecuteContractProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExecuteContractProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExecuteContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExecuteContractProposal(); while (reader.pos < end) { @@ -939,7 +935,7 @@ export const ExecuteContractProposal = { } return obj; }, - fromPartial, I>>(object: I): ExecuteContractProposal { + fromPartial(object: Partial): ExecuteContractProposal { const message = createBaseExecuteContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -959,7 +955,7 @@ function createBaseUpdateAdminProposal(): UpdateAdminProposal { }; } export const UpdateAdminProposal = { - encode(message: UpdateAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UpdateAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -974,8 +970,8 @@ export const UpdateAdminProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateAdminProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UpdateAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUpdateAdminProposal(); while (reader.pos < end) { @@ -1016,7 +1012,7 @@ export const UpdateAdminProposal = { message.contract !== undefined && (obj.contract = message.contract); return obj; }, - fromPartial, I>>(object: I): UpdateAdminProposal { + fromPartial(object: Partial): UpdateAdminProposal { const message = createBaseUpdateAdminProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -1033,7 +1029,7 @@ function createBaseClearAdminProposal(): ClearAdminProposal { }; } export const ClearAdminProposal = { - encode(message: ClearAdminProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ClearAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1045,8 +1041,8 @@ export const ClearAdminProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClearAdminProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClearAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClearAdminProposal(); while (reader.pos < end) { @@ -1082,7 +1078,7 @@ export const ClearAdminProposal = { message.contract !== undefined && (obj.contract = message.contract); return obj; }, - fromPartial, I>>(object: I): ClearAdminProposal { + fromPartial(object: Partial): ClearAdminProposal { const message = createBaseClearAdminProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -1098,7 +1094,7 @@ function createBasePinCodesProposal(): PinCodesProposal { }; } export const PinCodesProposal = { - encode(message: PinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1112,8 +1108,8 @@ export const PinCodesProposal = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PinCodesProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePinCodesProposal(); while (reader.pos < end) { @@ -1129,10 +1125,10 @@ export const PinCodesProposal = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } } else { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } break; default: @@ -1146,7 +1142,7 @@ export const PinCodesProposal = { const obj = createBasePinCodesProposal(); if (isSet(object.title)) obj.title = String(object.title); if (isSet(object.description)) obj.description = String(object.description); - if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: PinCodesProposal): unknown { @@ -1154,17 +1150,17 @@ export const PinCodesProposal = { message.title !== undefined && (obj.title = message.title); message.description !== undefined && (obj.description = message.description); if (message.codeIds) { - obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + obj.codeIds = message.codeIds.map((e) => (e || BigInt(0)).toString()); } else { obj.codeIds = []; } return obj; }, - fromPartial, I>>(object: I): PinCodesProposal { + fromPartial(object: Partial): PinCodesProposal { const message = createBasePinCodesProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; - message.codeIds = object.codeIds?.map((e) => Long.fromValue(e)) || []; + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || []; return message; }, }; @@ -1176,7 +1172,7 @@ function createBaseUnpinCodesProposal(): UnpinCodesProposal { }; } export const UnpinCodesProposal = { - encode(message: UnpinCodesProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UnpinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1190,8 +1186,8 @@ export const UnpinCodesProposal = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UnpinCodesProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UnpinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnpinCodesProposal(); while (reader.pos < end) { @@ -1207,10 +1203,10 @@ export const UnpinCodesProposal = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } } else { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } break; default: @@ -1224,7 +1220,7 @@ export const UnpinCodesProposal = { const obj = createBaseUnpinCodesProposal(); if (isSet(object.title)) obj.title = String(object.title); if (isSet(object.description)) obj.description = String(object.description); - if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: UnpinCodesProposal): unknown { @@ -1232,29 +1228,29 @@ export const UnpinCodesProposal = { message.title !== undefined && (obj.title = message.title); message.description !== undefined && (obj.description = message.description); if (message.codeIds) { - obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + obj.codeIds = message.codeIds.map((e) => (e || BigInt(0)).toString()); } else { obj.codeIds = []; } return obj; }, - fromPartial, I>>(object: I): UnpinCodesProposal { + fromPartial(object: Partial): UnpinCodesProposal { const message = createBaseUnpinCodesProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; - message.codeIds = object.codeIds?.map((e) => Long.fromValue(e)) || []; + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || []; return message; }, }; function createBaseAccessConfigUpdate(): AccessConfigUpdate { return { - codeId: Long.UZERO, + codeId: BigInt(0), instantiatePermission: AccessConfig.fromPartial({}), }; } export const AccessConfigUpdate = { - encode(message: AccessConfigUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: AccessConfigUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } if (message.instantiatePermission !== undefined) { @@ -1262,15 +1258,15 @@ export const AccessConfigUpdate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfigUpdate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfigUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAccessConfigUpdate(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 2: message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); @@ -1284,24 +1280,24 @@ export const AccessConfigUpdate = { }, fromJSON(object: any): AccessConfigUpdate { const obj = createBaseAccessConfigUpdate(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.instantiatePermission)) obj.instantiatePermission = AccessConfig.fromJSON(object.instantiatePermission); return obj; }, toJSON(message: AccessConfigUpdate): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.instantiatePermission !== undefined && (obj.instantiatePermission = message.instantiatePermission ? AccessConfig.toJSON(message.instantiatePermission) : undefined); return obj; }, - fromPartial, I>>(object: I): AccessConfigUpdate { + fromPartial(object: Partial): AccessConfigUpdate { const message = createBaseAccessConfigUpdate(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } if (object.instantiatePermission !== undefined && object.instantiatePermission !== null) { message.instantiatePermission = AccessConfig.fromPartial(object.instantiatePermission); @@ -1317,7 +1313,10 @@ function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigPro }; } export const UpdateInstantiateConfigProposal = { - encode(message: UpdateInstantiateConfigProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: UpdateInstantiateConfigProposal, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1329,8 +1328,8 @@ export const UpdateInstantiateConfigProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInstantiateConfigProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UpdateInstantiateConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUpdateInstantiateConfigProposal(); while (reader.pos < end) { @@ -1373,9 +1372,7 @@ export const UpdateInstantiateConfigProposal = { } return obj; }, - fromPartial, I>>( - object: I, - ): UpdateInstantiateConfigProposal { + fromPartial(object: Partial): UpdateInstantiateConfigProposal { const message = createBaseUpdateInstantiateConfigProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -1402,7 +1399,10 @@ function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateCon }; } export const StoreAndInstantiateContractProposal = { - encode(message: StoreAndInstantiateContractProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: StoreAndInstantiateContractProposal, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -1444,8 +1444,8 @@ export const StoreAndInstantiateContractProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): StoreAndInstantiateContractProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): StoreAndInstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStoreAndInstantiateContractProposal(); while (reader.pos < end) { @@ -1544,9 +1544,7 @@ export const StoreAndInstantiateContractProposal = { (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): StoreAndInstantiateContractProposal { + fromPartial(object: Partial): StoreAndInstantiateContractProposal { const message = createBaseStoreAndInstantiateContractProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; diff --git a/src/cosmwasm/wasm/v1/query.ts b/src/cosmwasm/wasm/v1/query.ts index 11e1d0a..38f95bd 100644 --- a/src/cosmwasm/wasm/v1/query.ts +++ b/src/cosmwasm/wasm/v1/query.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; import { ContractInfo, ContractCodeHistoryEntry, Model, AccessConfig, Params } from "./types"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** * QueryContractInfoRequest is the request type for the Query/ContractInfo RPC @@ -49,7 +49,7 @@ export interface QueryContractsByCodeRequest { * grpc-gateway_out does not support Go style CodID * pagination defines an optional pagination for the request. */ - codeId: Long; + codeId: bigint; pagination: PageRequest; } /** @@ -119,11 +119,11 @@ export interface QuerySmartContractStateResponse { /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequest { /** grpc-gateway_out does not support Go style CodID */ - codeId: Long; + codeId: bigint; } /** CodeInfoResponse contains code meta data from CodeInfo */ export interface CodeInfoResponse { - codeId: Long; + codeId: bigint; creator: string; dataHash: Uint8Array; instantiatePermission: AccessConfig; @@ -157,7 +157,7 @@ export interface QueryPinnedCodesRequest { * Query/PinnedCodes RPC method */ export interface QueryPinnedCodesResponse { - codeIds: Long[]; + codeIds: bigint[]; /** pagination defines the pagination in the response. */ pagination: PageResponse; } @@ -194,14 +194,14 @@ function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { }; } export const QueryContractInfoRequest = { - encode(message: QueryContractInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryContractInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractInfoRequest(); while (reader.pos < end) { @@ -227,9 +227,7 @@ export const QueryContractInfoRequest = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractInfoRequest { + fromPartial(object: Partial): QueryContractInfoRequest { const message = createBaseQueryContractInfoRequest(); message.address = object.address ?? ""; return message; @@ -242,7 +240,7 @@ function createBaseQueryContractInfoResponse(): QueryContractInfoResponse { }; } export const QueryContractInfoResponse = { - encode(message: QueryContractInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryContractInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -251,8 +249,8 @@ export const QueryContractInfoResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractInfoResponse(); while (reader.pos < end) { @@ -284,9 +282,7 @@ export const QueryContractInfoResponse = { (obj.contractInfo = message.contractInfo ? ContractInfo.toJSON(message.contractInfo) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractInfoResponse { + fromPartial(object: Partial): QueryContractInfoResponse { const message = createBaseQueryContractInfoResponse(); message.address = object.address ?? ""; if (object.contractInfo !== undefined && object.contractInfo !== null) { @@ -302,7 +298,7 @@ function createBaseQueryContractHistoryRequest(): QueryContractHistoryRequest { }; } export const QueryContractHistoryRequest = { - encode(message: QueryContractHistoryRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryContractHistoryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -311,8 +307,8 @@ export const QueryContractHistoryRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractHistoryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractHistoryRequest(); while (reader.pos < end) { @@ -344,9 +340,7 @@ export const QueryContractHistoryRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractHistoryRequest { + fromPartial(object: Partial): QueryContractHistoryRequest { const message = createBaseQueryContractHistoryRequest(); message.address = object.address ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -362,7 +356,7 @@ function createBaseQueryContractHistoryResponse(): QueryContractHistoryResponse }; } export const QueryContractHistoryResponse = { - encode(message: QueryContractHistoryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryContractHistoryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.entries) { ContractCodeHistoryEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -371,8 +365,8 @@ export const QueryContractHistoryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractHistoryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractHistoryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractHistoryResponse(); while (reader.pos < end) { @@ -409,9 +403,7 @@ export const QueryContractHistoryResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractHistoryResponse { + fromPartial(object: Partial): QueryContractHistoryResponse { const message = createBaseQueryContractHistoryResponse(); message.entries = object.entries?.map((e) => ContractCodeHistoryEntry.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -422,13 +414,13 @@ export const QueryContractHistoryResponse = { }; function createBaseQueryContractsByCodeRequest(): QueryContractsByCodeRequest { return { - codeId: Long.UZERO, + codeId: BigInt(0), pagination: PageRequest.fromPartial({}), }; } export const QueryContractsByCodeRequest = { - encode(message: QueryContractsByCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: QueryContractsByCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } if (message.pagination !== undefined) { @@ -436,15 +428,15 @@ export const QueryContractsByCodeRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractsByCodeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); @@ -458,23 +450,21 @@ export const QueryContractsByCodeRequest = { }, fromJSON(object: any): QueryContractsByCodeRequest { const obj = createBaseQueryContractsByCodeRequest(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); return obj; }, toJSON(message: QueryContractsByCodeRequest): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractsByCodeRequest { + fromPartial(object: Partial): QueryContractsByCodeRequest { const message = createBaseQueryContractsByCodeRequest(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -489,7 +479,7 @@ function createBaseQueryContractsByCodeResponse(): QueryContractsByCodeResponse }; } export const QueryContractsByCodeResponse = { - encode(message: QueryContractsByCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryContractsByCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.contracts) { writer.uint32(10).string(v!); } @@ -498,8 +488,8 @@ export const QueryContractsByCodeResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCodeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractsByCodeResponse(); while (reader.pos < end) { @@ -535,9 +525,7 @@ export const QueryContractsByCodeResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractsByCodeResponse { + fromPartial(object: Partial): QueryContractsByCodeResponse { const message = createBaseQueryContractsByCodeResponse(); message.contracts = object.contracts?.map((e) => e) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -553,7 +541,7 @@ function createBaseQueryAllContractStateRequest(): QueryAllContractStateRequest }; } export const QueryAllContractStateRequest = { - encode(message: QueryAllContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -562,8 +550,8 @@ export const QueryAllContractStateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllContractStateRequest(); while (reader.pos < end) { @@ -595,9 +583,7 @@ export const QueryAllContractStateRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllContractStateRequest { + fromPartial(object: Partial): QueryAllContractStateRequest { const message = createBaseQueryAllContractStateRequest(); message.address = object.address ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -613,7 +599,7 @@ function createBaseQueryAllContractStateResponse(): QueryAllContractStateRespons }; } export const QueryAllContractStateResponse = { - encode(message: QueryAllContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.models) { Model.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -622,8 +608,8 @@ export const QueryAllContractStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllContractStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllContractStateResponse(); while (reader.pos < end) { @@ -659,9 +645,7 @@ export const QueryAllContractStateResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllContractStateResponse { + fromPartial(object: Partial): QueryAllContractStateResponse { const message = createBaseQueryAllContractStateResponse(); message.models = object.models?.map((e) => Model.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -677,7 +661,7 @@ function createBaseQueryRawContractStateRequest(): QueryRawContractStateRequest }; } export const QueryRawContractStateRequest = { - encode(message: QueryRawContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryRawContractStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -686,8 +670,8 @@ export const QueryRawContractStateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryRawContractStateRequest(); while (reader.pos < end) { @@ -721,9 +705,7 @@ export const QueryRawContractStateRequest = { )); return obj; }, - fromPartial, I>>( - object: I, - ): QueryRawContractStateRequest { + fromPartial(object: Partial): QueryRawContractStateRequest { const message = createBaseQueryRawContractStateRequest(); message.address = object.address ?? ""; message.queryData = object.queryData ?? new Uint8Array(); @@ -736,14 +718,14 @@ function createBaseQueryRawContractStateResponse(): QueryRawContractStateRespons }; } export const QueryRawContractStateResponse = { - encode(message: QueryRawContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryRawContractStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryRawContractStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryRawContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryRawContractStateResponse(); while (reader.pos < end) { @@ -770,9 +752,7 @@ export const QueryRawContractStateResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): QueryRawContractStateResponse { + fromPartial(object: Partial): QueryRawContractStateResponse { const message = createBaseQueryRawContractStateResponse(); message.data = object.data ?? new Uint8Array(); return message; @@ -785,7 +765,10 @@ function createBaseQuerySmartContractStateRequest(): QuerySmartContractStateRequ }; } export const QuerySmartContractStateRequest = { - encode(message: QuerySmartContractStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySmartContractStateRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -794,8 +777,8 @@ export const QuerySmartContractStateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySmartContractStateRequest(); while (reader.pos < end) { @@ -829,9 +812,7 @@ export const QuerySmartContractStateRequest = { )); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySmartContractStateRequest { + fromPartial(object: Partial): QuerySmartContractStateRequest { const message = createBaseQuerySmartContractStateRequest(); message.address = object.address ?? ""; message.queryData = object.queryData ?? new Uint8Array(); @@ -844,14 +825,17 @@ function createBaseQuerySmartContractStateResponse(): QuerySmartContractStateRes }; } export const QuerySmartContractStateResponse = { - encode(message: QuerySmartContractStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QuerySmartContractStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySmartContractStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QuerySmartContractStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQuerySmartContractStateResponse(); while (reader.pos < end) { @@ -878,9 +862,7 @@ export const QuerySmartContractStateResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): QuerySmartContractStateResponse { + fromPartial(object: Partial): QuerySmartContractStateResponse { const message = createBaseQuerySmartContractStateResponse(); message.data = object.data ?? new Uint8Array(); return message; @@ -888,25 +870,25 @@ export const QuerySmartContractStateResponse = { }; function createBaseQueryCodeRequest(): QueryCodeRequest { return { - codeId: Long.UZERO, + codeId: BigInt(0), }; } export const QueryCodeRequest = { - encode(message: QueryCodeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCodeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -917,33 +899,33 @@ export const QueryCodeRequest = { }, fromJSON(object: any): QueryCodeRequest { const obj = createBaseQueryCodeRequest(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); return obj; }, toJSON(message: QueryCodeRequest): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryCodeRequest { + fromPartial(object: Partial): QueryCodeRequest { const message = createBaseQueryCodeRequest(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } return message; }, }; function createBaseCodeInfoResponse(): CodeInfoResponse { return { - codeId: Long.UZERO, + codeId: BigInt(0), creator: "", dataHash: new Uint8Array(), instantiatePermission: AccessConfig.fromPartial({}), }; } export const CodeInfoResponse = { - encode(message: CodeInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: CodeInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } if (message.creator !== "") { @@ -957,15 +939,15 @@ export const CodeInfoResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCodeInfoResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 2: message.creator = reader.string(); @@ -985,7 +967,7 @@ export const CodeInfoResponse = { }, fromJSON(object: any): CodeInfoResponse { const obj = createBaseCodeInfoResponse(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.creator)) obj.creator = String(object.creator); if (isSet(object.dataHash)) obj.dataHash = bytesFromBase64(object.dataHash); if (isSet(object.instantiatePermission)) @@ -994,7 +976,7 @@ export const CodeInfoResponse = { }, toJSON(message: CodeInfoResponse): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.creator !== undefined && (obj.creator = message.creator); message.dataHash !== undefined && (obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array())); @@ -1004,10 +986,10 @@ export const CodeInfoResponse = { : undefined); return obj; }, - fromPartial, I>>(object: I): CodeInfoResponse { + fromPartial(object: Partial): CodeInfoResponse { const message = createBaseCodeInfoResponse(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.creator = object.creator ?? ""; message.dataHash = object.dataHash ?? new Uint8Array(); @@ -1024,7 +1006,7 @@ function createBaseQueryCodeResponse(): QueryCodeResponse { }; } export const QueryCodeResponse = { - encode(message: QueryCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeInfo !== undefined) { CodeInfoResponse.encode(message.codeInfo, writer.uint32(10).fork()).ldelim(); } @@ -1033,8 +1015,8 @@ export const QueryCodeResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCodeResponse(); while (reader.pos < end) { @@ -1067,7 +1049,7 @@ export const QueryCodeResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): QueryCodeResponse { + fromPartial(object: Partial): QueryCodeResponse { const message = createBaseQueryCodeResponse(); if (object.codeInfo !== undefined && object.codeInfo !== null) { message.codeInfo = CodeInfoResponse.fromPartial(object.codeInfo); @@ -1082,14 +1064,14 @@ function createBaseQueryCodesRequest(): QueryCodesRequest { }; } export const QueryCodesRequest = { - encode(message: QueryCodesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCodesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCodesRequest(); while (reader.pos < end) { @@ -1116,7 +1098,7 @@ export const QueryCodesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryCodesRequest { + fromPartial(object: Partial): QueryCodesRequest { const message = createBaseQueryCodesRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -1131,7 +1113,7 @@ function createBaseQueryCodesResponse(): QueryCodesResponse { }; } export const QueryCodesResponse = { - encode(message: QueryCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.codeInfos) { CodeInfoResponse.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1140,8 +1122,8 @@ export const QueryCodesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCodesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCodesResponse(); while (reader.pos < end) { @@ -1178,7 +1160,7 @@ export const QueryCodesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryCodesResponse { + fromPartial(object: Partial): QueryCodesResponse { const message = createBaseQueryCodesResponse(); message.codeInfos = object.codeInfos?.map((e) => CodeInfoResponse.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1193,14 +1175,14 @@ function createBaseQueryPinnedCodesRequest(): QueryPinnedCodesRequest { }; } export const QueryPinnedCodesRequest = { - encode(message: QueryPinnedCodesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPinnedCodesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPinnedCodesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPinnedCodesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPinnedCodesRequest(); while (reader.pos < end) { @@ -1227,7 +1209,7 @@ export const QueryPinnedCodesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryPinnedCodesRequest { + fromPartial(object: Partial): QueryPinnedCodesRequest { const message = createBaseQueryPinnedCodesRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -1242,7 +1224,7 @@ function createBaseQueryPinnedCodesResponse(): QueryPinnedCodesResponse { }; } export const QueryPinnedCodesResponse = { - encode(message: QueryPinnedCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPinnedCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.codeIds) { writer.uint64(v); @@ -1253,8 +1235,8 @@ export const QueryPinnedCodesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPinnedCodesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPinnedCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPinnedCodesResponse(); while (reader.pos < end) { @@ -1264,10 +1246,10 @@ export const QueryPinnedCodesResponse = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } } else { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } break; case 2: @@ -1282,14 +1264,14 @@ export const QueryPinnedCodesResponse = { }, fromJSON(object: any): QueryPinnedCodesResponse { const obj = createBaseQueryPinnedCodesResponse(); - if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => BigInt(e.toString())); if (isSet(object.pagination)) obj.pagination = PageResponse.fromJSON(object.pagination); return obj; }, toJSON(message: QueryPinnedCodesResponse): unknown { const obj: any = {}; if (message.codeIds) { - obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + obj.codeIds = message.codeIds.map((e) => (e || BigInt(0)).toString()); } else { obj.codeIds = []; } @@ -1297,11 +1279,9 @@ export const QueryPinnedCodesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPinnedCodesResponse { + fromPartial(object: Partial): QueryPinnedCodesResponse { const message = createBaseQueryPinnedCodesResponse(); - message.codeIds = object.codeIds?.map((e) => Long.fromValue(e)) || []; + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || []; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromPartial(object.pagination); } @@ -1312,11 +1292,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -1337,7 +1317,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -1348,14 +1328,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -1381,7 +1361,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -1396,7 +1376,10 @@ function createBaseQueryContractsByCreatorRequest(): QueryContractsByCreatorRequ }; } export const QueryContractsByCreatorRequest = { - encode(message: QueryContractsByCreatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryContractsByCreatorRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.creatorAddress !== "") { writer.uint32(10).string(message.creatorAddress); } @@ -1405,8 +1388,8 @@ export const QueryContractsByCreatorRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCreatorRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCreatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractsByCreatorRequest(); while (reader.pos < end) { @@ -1438,9 +1421,7 @@ export const QueryContractsByCreatorRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractsByCreatorRequest { + fromPartial(object: Partial): QueryContractsByCreatorRequest { const message = createBaseQueryContractsByCreatorRequest(); message.creatorAddress = object.creatorAddress ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -1456,7 +1437,10 @@ function createBaseQueryContractsByCreatorResponse(): QueryContractsByCreatorRes }; } export const QueryContractsByCreatorResponse = { - encode(message: QueryContractsByCreatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryContractsByCreatorResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.contractAddresses) { writer.uint32(10).string(v!); } @@ -1465,8 +1449,8 @@ export const QueryContractsByCreatorResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryContractsByCreatorResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryContractsByCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryContractsByCreatorResponse(); while (reader.pos < end) { @@ -1503,9 +1487,7 @@ export const QueryContractsByCreatorResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryContractsByCreatorResponse { + fromPartial(object: Partial): QueryContractsByCreatorResponse { const message = createBaseQueryContractsByCreatorResponse(); message.contractAddresses = object.contractAddresses?.map((e) => e) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1558,37 +1540,37 @@ export class QueryClientImpl implements Query { ContractInfo(request: QueryContractInfoRequest): Promise { const data = QueryContractInfoRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractInfo", data); - return promise.then((data) => QueryContractInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryContractInfoResponse.decode(new BinaryReader(data))); } ContractHistory(request: QueryContractHistoryRequest): Promise { const data = QueryContractHistoryRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractHistory", data); - return promise.then((data) => QueryContractHistoryResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryContractHistoryResponse.decode(new BinaryReader(data))); } ContractsByCode(request: QueryContractsByCodeRequest): Promise { const data = QueryContractsByCodeRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCode", data); - return promise.then((data) => QueryContractsByCodeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryContractsByCodeResponse.decode(new BinaryReader(data))); } AllContractState(request: QueryAllContractStateRequest): Promise { const data = QueryAllContractStateRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "AllContractState", data); - return promise.then((data) => QueryAllContractStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllContractStateResponse.decode(new BinaryReader(data))); } RawContractState(request: QueryRawContractStateRequest): Promise { const data = QueryRawContractStateRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "RawContractState", data); - return promise.then((data) => QueryRawContractStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryRawContractStateResponse.decode(new BinaryReader(data))); } SmartContractState(request: QuerySmartContractStateRequest): Promise { const data = QuerySmartContractStateRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "SmartContractState", data); - return promise.then((data) => QuerySmartContractStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QuerySmartContractStateResponse.decode(new BinaryReader(data))); } Code(request: QueryCodeRequest): Promise { const data = QueryCodeRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Code", data); - return promise.then((data) => QueryCodeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCodeResponse.decode(new BinaryReader(data))); } Codes( request: QueryCodesRequest = { @@ -1597,7 +1579,7 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryCodesRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Codes", data); - return promise.then((data) => QueryCodesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCodesResponse.decode(new BinaryReader(data))); } PinnedCodes( request: QueryPinnedCodesRequest = { @@ -1606,16 +1588,16 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryPinnedCodesRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "PinnedCodes", data); - return promise.then((data) => QueryPinnedCodesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPinnedCodesResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } ContractsByCreator(request: QueryContractsByCreatorRequest): Promise { const data = QueryContractsByCreatorRequest.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCreator", data); - return promise.then((data) => QueryContractsByCreatorResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryContractsByCreatorResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmwasm/wasm/v1/tx.amino.ts b/src/cosmwasm/wasm/v1/tx.amino.ts new file mode 100644 index 0000000..a0d627b --- /dev/null +++ b/src/cosmwasm/wasm/v1/tx.amino.ts @@ -0,0 +1,568 @@ +/* eslint-disable */ +import { accessTypeFromJSON } from "./types"; +import { AminoMsg } from "@cosmjs/amino"; +import { toBase64, fromBase64, fromUtf8, toUtf8 } from "@cosmjs/encoding"; +import { + MsgStoreCode, + MsgInstantiateContract, + MsgInstantiateContract2, + MsgExecuteContract, + MsgMigrateContract, + MsgUpdateAdmin, + MsgClearAdmin, + MsgUpdateInstantiateConfig, + MsgUpdateParams, + MsgSudoContract, + MsgPinCodes, + MsgUnpinCodes, + MsgStoreAndInstantiateContract, +} from "./tx"; +export interface MsgStoreCodeAminoType extends AminoMsg { + type: "wasm/MsgStoreCode"; + value: { + sender: string; + wasm_byte_code: string; + instantiate_permission: { + permission: number; + address: string; + addresses: string[]; + }; + }; +} +export interface MsgInstantiateContractAminoType extends AminoMsg { + type: "wasm/MsgInstantiateContract"; + value: { + sender: string; + admin: string; + code_id: string; + label: string; + msg: Uint8Array; + funds: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgInstantiateContract2AminoType extends AminoMsg { + type: "wasm/MsgInstantiateContract2"; + value: { + sender: string; + admin: string; + code_id: string; + label: string; + msg: Uint8Array; + funds: { + denom: string; + amount: string; + }[]; + salt: Uint8Array; + fix_msg: boolean; + }; +} +export interface MsgExecuteContractAminoType extends AminoMsg { + type: "wasm/MsgExecuteContract"; + value: { + sender: string; + contract: string; + msg: Uint8Array; + funds: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgMigrateContractAminoType extends AminoMsg { + type: "wasm/MsgMigrateContract"; + value: { + sender: string; + contract: string; + code_id: string; + msg: Uint8Array; + }; +} +export interface MsgUpdateAdminAminoType extends AminoMsg { + type: "wasm/MsgUpdateAdmin"; + value: { + sender: string; + new_admin: string; + contract: string; + }; +} +export interface MsgClearAdminAminoType extends AminoMsg { + type: "wasm/MsgClearAdmin"; + value: { + sender: string; + contract: string; + }; +} +export interface MsgUpdateInstantiateConfigAminoType extends AminoMsg { + type: "wasm/MsgUpdateInstantiateConfig"; + value: { + sender: string; + code_id: string; + new_instantiate_permission: { + permission: number; + address: string; + addresses: string[]; + }; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "wasm/MsgUpdateParams"; + value: { + authority: string; + params: { + code_upload_access: { + permission: number; + address: string; + addresses: string[]; + }; + instantiate_default_permission: number; + }; + }; +} +export interface MsgSudoContractAminoType extends AminoMsg { + type: "wasm/MsgSudoContract"; + value: { + authority: string; + contract: string; + msg: Uint8Array; + }; +} +export interface MsgPinCodesAminoType extends AminoMsg { + type: "wasm/MsgPinCodes"; + value: { + authority: string; + code_ids: string[]; + }; +} +export interface MsgUnpinCodesAminoType extends AminoMsg { + type: "wasm/MsgUnpinCodes"; + value: { + authority: string; + code_ids: string[]; + }; +} +export interface MsgStoreAndInstantiateContractAminoType extends AminoMsg { + type: "wasm/MsgStoreAndInstantiateContract"; + value: { + authority: string; + wasm_byte_code: string; + instantiate_permission: { + permission: number; + address: string; + addresses: string[]; + }; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: { + denom: string; + amount: string; + }[]; + source: string; + builder: string; + code_hash: Uint8Array; + }; +} +export const AminoConverter = { + "/cosmwasm.wasm.v1.MsgStoreCode": { + aminoType: "wasm/MsgStoreCode", + toAmino: ({ + sender, + wasmByteCode, + instantiatePermission, + }: MsgStoreCode): MsgStoreCodeAminoType["value"] => { + return { + sender, + wasm_byte_code: toBase64(wasmByteCode), + instantiate_permission: { + permission: instantiatePermission.permission, + address: instantiatePermission.address, + addresses: instantiatePermission.addresses, + }, + }; + }, + fromAmino: ({ + sender, + wasm_byte_code, + instantiate_permission, + }: MsgStoreCodeAminoType["value"]): MsgStoreCode => { + return { + sender, + wasmByteCode: fromBase64(wasm_byte_code), + instantiatePermission: { + permission: accessTypeFromJSON(instantiate_permission.permission), + address: instantiate_permission.address, + addresses: instantiate_permission.addresses, + }, + }; + }, + }, + "/cosmwasm.wasm.v1.MsgInstantiateContract": { + aminoType: "wasm/MsgInstantiateContract", + toAmino: ({ + sender, + admin, + codeId, + label, + msg, + funds, + }: MsgInstantiateContract): MsgInstantiateContractAminoType["value"] => { + return { + sender, + admin, + code_id: codeId.toString(), + label, + msg: JSON.parse(fromUtf8(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ + sender, + admin, + code_id, + label, + msg, + funds, + }: MsgInstantiateContractAminoType["value"]): MsgInstantiateContract => { + return { + sender, + admin, + codeId: BigInt(code_id), + label, + msg: toUtf8(JSON.stringify(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/cosmwasm.wasm.v1.MsgInstantiateContract2": { + aminoType: "wasm/MsgInstantiateContract2", + toAmino: ({ + sender, + admin, + codeId, + label, + msg, + funds, + salt, + fixMsg, + }: MsgInstantiateContract2): MsgInstantiateContract2AminoType["value"] => { + return { + sender, + admin, + code_id: codeId.toString(), + label, + msg: JSON.parse(fromUtf8(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + salt, + fix_msg: fixMsg, + }; + }, + fromAmino: ({ + sender, + admin, + code_id, + label, + msg, + funds, + salt, + fix_msg, + }: MsgInstantiateContract2AminoType["value"]): MsgInstantiateContract2 => { + return { + sender, + admin, + codeId: BigInt(code_id), + label, + msg: toUtf8(JSON.stringify(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + salt, + fixMsg: fix_msg, + }; + }, + }, + "/cosmwasm.wasm.v1.MsgExecuteContract": { + aminoType: "wasm/MsgExecuteContract", + toAmino: ({ sender, contract, msg, funds }: MsgExecuteContract): MsgExecuteContractAminoType["value"] => { + return { + sender, + contract, + msg: JSON.parse(fromUtf8(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ + sender, + contract, + msg, + funds, + }: MsgExecuteContractAminoType["value"]): MsgExecuteContract => { + return { + sender, + contract, + msg: toUtf8(JSON.stringify(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/cosmwasm.wasm.v1.MsgMigrateContract": { + aminoType: "wasm/MsgMigrateContract", + toAmino: ({ + sender, + contract, + codeId, + msg, + }: MsgMigrateContract): MsgMigrateContractAminoType["value"] => { + return { + sender, + contract, + code_id: codeId.toString(), + msg: JSON.parse(fromUtf8(msg)), + }; + }, + fromAmino: ({ + sender, + contract, + code_id, + msg, + }: MsgMigrateContractAminoType["value"]): MsgMigrateContract => { + return { + sender, + contract, + codeId: BigInt(code_id), + msg: toUtf8(JSON.stringify(msg)), + }; + }, + }, + "/cosmwasm.wasm.v1.MsgUpdateAdmin": { + aminoType: "wasm/MsgUpdateAdmin", + toAmino: ({ sender, newAdmin, contract }: MsgUpdateAdmin): MsgUpdateAdminAminoType["value"] => { + return { + sender, + new_admin: newAdmin, + contract, + }; + }, + fromAmino: ({ sender, new_admin, contract }: MsgUpdateAdminAminoType["value"]): MsgUpdateAdmin => { + return { + sender, + newAdmin: new_admin, + contract, + }; + }, + }, + "/cosmwasm.wasm.v1.MsgClearAdmin": { + aminoType: "wasm/MsgClearAdmin", + toAmino: ({ sender, contract }: MsgClearAdmin): MsgClearAdminAminoType["value"] => { + return { + sender, + contract, + }; + }, + fromAmino: ({ sender, contract }: MsgClearAdminAminoType["value"]): MsgClearAdmin => { + return { + sender, + contract, + }; + }, + }, + "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig": { + aminoType: "wasm/MsgUpdateInstantiateConfig", + toAmino: ({ + sender, + codeId, + newInstantiatePermission, + }: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoType["value"] => { + return { + sender, + code_id: codeId.toString(), + new_instantiate_permission: { + permission: newInstantiatePermission.permission, + address: newInstantiatePermission.address, + addresses: newInstantiatePermission.addresses, + }, + }; + }, + fromAmino: ({ + sender, + code_id, + new_instantiate_permission, + }: MsgUpdateInstantiateConfigAminoType["value"]): MsgUpdateInstantiateConfig => { + return { + sender, + codeId: BigInt(code_id), + newInstantiatePermission: { + permission: accessTypeFromJSON(new_instantiate_permission.permission), + address: new_instantiate_permission.address, + addresses: new_instantiate_permission.addresses, + }, + }; + }, + }, + "/cosmwasm.wasm.v1.MsgUpdateParams": { + aminoType: "wasm/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + code_upload_access: { + permission: params.codeUploadAccess.permission, + address: params.codeUploadAccess.address, + addresses: params.codeUploadAccess.addresses, + }, + instantiate_default_permission: params.instantiateDefaultPermission, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + codeUploadAccess: { + permission: accessTypeFromJSON(params.code_upload_access.permission), + address: params.code_upload_access.address, + addresses: params.code_upload_access.addresses, + }, + instantiateDefaultPermission: accessTypeFromJSON(params.instantiate_default_permission), + }, + }; + }, + }, + "/cosmwasm.wasm.v1.MsgSudoContract": { + aminoType: "wasm/MsgSudoContract", + toAmino: ({ authority, contract, msg }: MsgSudoContract): MsgSudoContractAminoType["value"] => { + return { + authority, + contract, + msg: JSON.parse(fromUtf8(msg)), + }; + }, + fromAmino: ({ authority, contract, msg }: MsgSudoContractAminoType["value"]): MsgSudoContract => { + return { + authority, + contract, + msg: toUtf8(JSON.stringify(msg)), + }; + }, + }, + "/cosmwasm.wasm.v1.MsgPinCodes": { + aminoType: "wasm/MsgPinCodes", + toAmino: ({ authority, codeIds }: MsgPinCodes): MsgPinCodesAminoType["value"] => { + return { + authority, + code_ids: codeIds.map((el0) => el0.toString()), + }; + }, + fromAmino: ({ authority, code_ids }: MsgPinCodesAminoType["value"]): MsgPinCodes => { + return { + authority, + codeIds: code_ids.map((el0) => BigInt(el0)), + }; + }, + }, + "/cosmwasm.wasm.v1.MsgUnpinCodes": { + aminoType: "wasm/MsgUnpinCodes", + toAmino: ({ authority, codeIds }: MsgUnpinCodes): MsgUnpinCodesAminoType["value"] => { + return { + authority, + code_ids: codeIds.map((el0) => el0.toString()), + }; + }, + fromAmino: ({ authority, code_ids }: MsgUnpinCodesAminoType["value"]): MsgUnpinCodes => { + return { + authority, + codeIds: code_ids.map((el0) => BigInt(el0)), + }; + }, + }, + "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { + aminoType: "wasm/MsgStoreAndInstantiateContract", + toAmino: ({ + authority, + wasmByteCode, + instantiatePermission, + unpinCode, + admin, + label, + msg, + funds, + source, + builder, + codeHash, + }: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAminoType["value"] => { + return { + authority, + wasm_byte_code: toBase64(wasmByteCode), + instantiate_permission: { + permission: instantiatePermission.permission, + address: instantiatePermission.address, + addresses: instantiatePermission.addresses, + }, + unpin_code: unpinCode, + admin, + label, + msg: JSON.parse(fromUtf8(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + source, + builder, + code_hash: codeHash, + }; + }, + fromAmino: ({ + authority, + wasm_byte_code, + instantiate_permission, + unpin_code, + admin, + label, + msg, + funds, + source, + builder, + code_hash, + }: MsgStoreAndInstantiateContractAminoType["value"]): MsgStoreAndInstantiateContract => { + return { + authority, + wasmByteCode: fromBase64(wasm_byte_code), + instantiatePermission: { + permission: accessTypeFromJSON(instantiate_permission.permission), + address: instantiate_permission.address, + addresses: instantiate_permission.addresses, + }, + unpinCode: unpin_code, + admin, + label, + msg: toUtf8(JSON.stringify(msg)), + funds: funds.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + source, + builder, + codeHash: code_hash, + }; + }, + }, +}; diff --git a/src/cosmwasm/wasm/v1/tx.registry.ts b/src/cosmwasm/wasm/v1/tx.registry.ts new file mode 100644 index 0000000..a84c7a0 --- /dev/null +++ b/src/cosmwasm/wasm/v1/tx.registry.ts @@ -0,0 +1,440 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgStoreCode, + MsgInstantiateContract, + MsgInstantiateContract2, + MsgExecuteContract, + MsgMigrateContract, + MsgUpdateAdmin, + MsgClearAdmin, + MsgUpdateInstantiateConfig, + MsgUpdateParams, + MsgSudoContract, + MsgPinCodes, + MsgUnpinCodes, + MsgStoreAndInstantiateContract, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], + ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], + ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], + ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], + ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], + ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], + ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], + ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig], + ["/cosmwasm.wasm.v1.MsgUpdateParams", MsgUpdateParams], + ["/cosmwasm.wasm.v1.MsgSudoContract", MsgSudoContract], + ["/cosmwasm.wasm.v1.MsgPinCodes", MsgPinCodes], + ["/cosmwasm.wasm.v1.MsgUnpinCodes", MsgUnpinCodes], + ["/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", MsgStoreAndInstantiateContract], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(value).finish(), + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(value).finish(), + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.encode(value).finish(), + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.encode(value).finish(), + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(value).finish(), + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(value).finish(), + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.encode(value).finish(), + }; + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(value).finish(), + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(value).finish(), + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(value).finish(), + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value, + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value, + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value, + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value, + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value, + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value, + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value, + }; + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value, + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value, + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value, + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value, + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value, + }; + }, + }, + toJSON: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.toJSON(value), + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.toJSON(value), + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.toJSON(value), + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.toJSON(value), + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.toJSON(value), + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.toJSON(value), + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.toJSON(value), + }; + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.toJSON(value), + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.toJSON(value), + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.toJSON(value), + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toJSON(value), + }; + }, + }, + fromJSON: { + storeCode(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromJSON(value), + }; + }, + instantiateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.fromJSON(value), + }; + }, + instantiateContract2(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.fromJSON(value), + }; + }, + executeContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromJSON(value), + }; + }, + migrateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromJSON(value), + }; + }, + updateAdmin(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.fromJSON(value), + }; + }, + clearAdmin(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.fromJSON(value), + }; + }, + updateInstantiateConfig(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + sudoContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromJSON(value), + }; + }, + pinCodes(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromJSON(value), + }; + }, + unpinCodes(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromJSON(value), + }; + }, + storeAndInstantiateContract(value: any) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromJSON(value), + }; + }, + }, + fromPartial: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromPartial(value), + }; + }, + instantiateContract(value: MsgInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.fromPartial(value), + }; + }, + instantiateContract2(value: MsgInstantiateContract2) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.fromPartial(value), + }; + }, + executeContract(value: MsgExecuteContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.fromPartial(value), + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromPartial(value), + }; + }, + updateAdmin(value: MsgUpdateAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.fromPartial(value), + }; + }, + clearAdmin(value: MsgClearAdmin) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.fromPartial(value), + }; + }, + updateInstantiateConfig(value: MsgUpdateInstantiateConfig) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromPartial(value), + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromPartial(value), + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromPartial(value), + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromPartial(value), + }; + }, + }, +}; diff --git a/src/cosmwasm/wasm/v1/tx.ts b/src/cosmwasm/wasm/v1/tx.ts index c4caeaf..c3074f5 100644 --- a/src/cosmwasm/wasm/v1/tx.ts +++ b/src/cosmwasm/wasm/v1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { AccessConfig, Params } from "./types"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCode { @@ -19,7 +19,7 @@ export interface MsgStoreCode { /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponse { /** CodeID is the reference to the stored WASM code */ - codeId: Long; + codeId: bigint; /** Checksum is the sha256 hash of the stored code */ checksum: Uint8Array; } @@ -33,7 +33,7 @@ export interface MsgInstantiateContract { /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ - codeId: Long; + codeId: bigint; /** Label is optional metadata to be stored with a contract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ @@ -58,7 +58,7 @@ export interface MsgInstantiateContract2 { /** Admin is an optional address that can execute migrations */ admin: string; /** CodeID is the reference to the stored WASM code */ - codeId: Long; + codeId: bigint; /** Label is optional metadata to be stored with a contract instance. */ label: string; /** Msg json encoded message to be passed to the contract on instantiation */ @@ -103,7 +103,7 @@ export interface MsgMigrateContract { /** Contract is the address of the smart contract */ contract: string; /** CodeID references the new WASM code */ - codeId: Long; + codeId: bigint; /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } @@ -140,7 +140,7 @@ export interface MsgUpdateInstantiateConfig { /** Sender is the that actor that signed the messages */ sender: string; /** CodeID references the stored WASM code */ - codeId: Long; + codeId: bigint; /** NewInstantiatePermission is the new access control */ newInstantiatePermission: AccessConfig; } @@ -200,7 +200,7 @@ export interface MsgPinCodes { /** Authority is the address of the governance account. */ authority: string; /** CodeIDs references the new WASM codes */ - codeIds: Long[]; + codeIds: bigint[]; } /** * MsgPinCodesResponse defines the response structure for executing a @@ -218,7 +218,7 @@ export interface MsgUnpinCodes { /** Authority is the address of the governance account. */ authority: string; /** CodeIDs references the WASM codes */ - codeIds: Long[]; + codeIds: bigint[]; } /** * MsgUnpinCodesResponse defines the response structure for executing a @@ -289,7 +289,7 @@ function createBaseMsgStoreCode(): MsgStoreCode { }; } export const MsgStoreCode = { - encode(message: MsgStoreCode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -301,8 +301,8 @@ export const MsgStoreCode = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgStoreCode(); while (reader.pos < end) { @@ -345,7 +345,7 @@ export const MsgStoreCode = { : undefined); return obj; }, - fromPartial, I>>(object: I): MsgStoreCode { + fromPartial(object: Partial): MsgStoreCode { const message = createBaseMsgStoreCode(); message.sender = object.sender ?? ""; message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); @@ -357,13 +357,13 @@ export const MsgStoreCode = { }; function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { return { - codeId: Long.UZERO, + codeId: BigInt(0), checksum: new Uint8Array(), }; } export const MsgStoreCodeResponse = { - encode(message: MsgStoreCodeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } if (message.checksum.length !== 0) { @@ -371,15 +371,15 @@ export const MsgStoreCodeResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgStoreCodeResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 2: message.checksum = reader.bytes(); @@ -393,21 +393,21 @@ export const MsgStoreCodeResponse = { }, fromJSON(object: any): MsgStoreCodeResponse { const obj = createBaseMsgStoreCodeResponse(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.checksum)) obj.checksum = bytesFromBase64(object.checksum); return obj; }, toJSON(message: MsgStoreCodeResponse): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.checksum !== undefined && (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MsgStoreCodeResponse { + fromPartial(object: Partial): MsgStoreCodeResponse { const message = createBaseMsgStoreCodeResponse(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.checksum = object.checksum ?? new Uint8Array(); return message; @@ -417,21 +417,21 @@ function createBaseMsgInstantiateContract(): MsgInstantiateContract { return { sender: "", admin: "", - codeId: Long.UZERO, + codeId: BigInt(0), label: "", msg: new Uint8Array(), funds: [], }; } export const MsgInstantiateContract = { - encode(message: MsgInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.admin !== "") { writer.uint32(18).string(message.admin); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(24).uint64(message.codeId); } if (message.label !== "") { @@ -445,8 +445,8 @@ export const MsgInstantiateContract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgInstantiateContract(); while (reader.pos < end) { @@ -459,7 +459,7 @@ export const MsgInstantiateContract = { message.admin = reader.string(); break; case 3: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 4: message.label = reader.string(); @@ -481,7 +481,7 @@ export const MsgInstantiateContract = { const obj = createBaseMsgInstantiateContract(); if (isSet(object.sender)) obj.sender = String(object.sender); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.label)) obj.label = String(object.label); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); if (Array.isArray(object?.funds)) obj.funds = object.funds.map((e: any) => Coin.fromJSON(e)); @@ -491,7 +491,7 @@ export const MsgInstantiateContract = { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); message.admin !== undefined && (obj.admin = message.admin); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.label !== undefined && (obj.label = message.label); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); @@ -502,12 +502,12 @@ export const MsgInstantiateContract = { } return obj; }, - fromPartial, I>>(object: I): MsgInstantiateContract { + fromPartial(object: Partial): MsgInstantiateContract { const message = createBaseMsgInstantiateContract(); message.sender = object.sender ?? ""; message.admin = object.admin ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); @@ -522,7 +522,10 @@ function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractRespo }; } export const MsgInstantiateContractResponse = { - encode(message: MsgInstantiateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgInstantiateContractResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -531,8 +534,8 @@ export const MsgInstantiateContractResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContractResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgInstantiateContractResponse(); while (reader.pos < end) { @@ -564,9 +567,7 @@ export const MsgInstantiateContractResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): MsgInstantiateContractResponse { + fromPartial(object: Partial): MsgInstantiateContractResponse { const message = createBaseMsgInstantiateContractResponse(); message.address = object.address ?? ""; message.data = object.data ?? new Uint8Array(); @@ -577,7 +578,7 @@ function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { return { sender: "", admin: "", - codeId: Long.UZERO, + codeId: BigInt(0), label: "", msg: new Uint8Array(), funds: [], @@ -586,14 +587,14 @@ function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { }; } export const MsgInstantiateContract2 = { - encode(message: MsgInstantiateContract2, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.admin !== "") { writer.uint32(18).string(message.admin); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(24).uint64(message.codeId); } if (message.label !== "") { @@ -613,8 +614,8 @@ export const MsgInstantiateContract2 = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract2 { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgInstantiateContract2(); while (reader.pos < end) { @@ -627,7 +628,7 @@ export const MsgInstantiateContract2 = { message.admin = reader.string(); break; case 3: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 4: message.label = reader.string(); @@ -655,7 +656,7 @@ export const MsgInstantiateContract2 = { const obj = createBaseMsgInstantiateContract2(); if (isSet(object.sender)) obj.sender = String(object.sender); if (isSet(object.admin)) obj.admin = String(object.admin); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.label)) obj.label = String(object.label); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); if (Array.isArray(object?.funds)) obj.funds = object.funds.map((e: any) => Coin.fromJSON(e)); @@ -667,7 +668,7 @@ export const MsgInstantiateContract2 = { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); message.admin !== undefined && (obj.admin = message.admin); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.label !== undefined && (obj.label = message.label); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); @@ -681,12 +682,12 @@ export const MsgInstantiateContract2 = { message.fixMsg !== undefined && (obj.fixMsg = message.fixMsg); return obj; }, - fromPartial, I>>(object: I): MsgInstantiateContract2 { + fromPartial(object: Partial): MsgInstantiateContract2 { const message = createBaseMsgInstantiateContract2(); message.sender = object.sender ?? ""; message.admin = object.admin ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); @@ -703,7 +704,10 @@ function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Res }; } export const MsgInstantiateContract2Response = { - encode(message: MsgInstantiateContract2Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgInstantiateContract2Response, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -712,8 +716,8 @@ export const MsgInstantiateContract2Response = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgInstantiateContract2Response { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgInstantiateContract2Response(); while (reader.pos < end) { @@ -745,9 +749,7 @@ export const MsgInstantiateContract2Response = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): MsgInstantiateContract2Response { + fromPartial(object: Partial): MsgInstantiateContract2Response { const message = createBaseMsgInstantiateContract2Response(); message.address = object.address ?? ""; message.data = object.data ?? new Uint8Array(); @@ -763,7 +765,7 @@ function createBaseMsgExecuteContract(): MsgExecuteContract { }; } export const MsgExecuteContract = { - encode(message: MsgExecuteContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -778,8 +780,8 @@ export const MsgExecuteContract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecuteContract(); while (reader.pos < end) { @@ -825,7 +827,7 @@ export const MsgExecuteContract = { } return obj; }, - fromPartial, I>>(object: I): MsgExecuteContract { + fromPartial(object: Partial): MsgExecuteContract { const message = createBaseMsgExecuteContract(); message.sender = object.sender ?? ""; message.contract = object.contract ?? ""; @@ -840,14 +842,14 @@ function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { }; } export const MsgExecuteContractResponse = { - encode(message: MsgExecuteContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExecuteContractResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgExecuteContractResponse(); while (reader.pos < end) { @@ -874,9 +876,7 @@ export const MsgExecuteContractResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): MsgExecuteContractResponse { + fromPartial(object: Partial): MsgExecuteContractResponse { const message = createBaseMsgExecuteContractResponse(); message.data = object.data ?? new Uint8Array(); return message; @@ -886,19 +886,19 @@ function createBaseMsgMigrateContract(): MsgMigrateContract { return { sender: "", contract: "", - codeId: Long.UZERO, + codeId: BigInt(0), msg: new Uint8Array(), }; } export const MsgMigrateContract = { - encode(message: MsgMigrateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } if (message.contract !== "") { writer.uint32(18).string(message.contract); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(24).uint64(message.codeId); } if (message.msg.length !== 0) { @@ -906,8 +906,8 @@ export const MsgMigrateContract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMigrateContract(); while (reader.pos < end) { @@ -920,7 +920,7 @@ export const MsgMigrateContract = { message.contract = reader.string(); break; case 3: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 4: message.msg = reader.bytes(); @@ -936,7 +936,7 @@ export const MsgMigrateContract = { const obj = createBaseMsgMigrateContract(); if (isSet(object.sender)) obj.sender = String(object.sender); if (isSet(object.contract)) obj.contract = String(object.contract); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); return obj; }, @@ -944,17 +944,17 @@ export const MsgMigrateContract = { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); message.contract !== undefined && (obj.contract = message.contract); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MsgMigrateContract { + fromPartial(object: Partial): MsgMigrateContract { const message = createBaseMsgMigrateContract(); message.sender = object.sender ?? ""; message.contract = object.contract ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.msg = object.msg ?? new Uint8Array(); return message; @@ -966,14 +966,14 @@ function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { }; } export const MsgMigrateContractResponse = { - encode(message: MsgMigrateContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgMigrateContractResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgMigrateContractResponse(); while (reader.pos < end) { @@ -1000,9 +1000,7 @@ export const MsgMigrateContractResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): MsgMigrateContractResponse { + fromPartial(object: Partial): MsgMigrateContractResponse { const message = createBaseMsgMigrateContractResponse(); message.data = object.data ?? new Uint8Array(); return message; @@ -1016,7 +1014,7 @@ function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { }; } export const MsgUpdateAdmin = { - encode(message: MsgUpdateAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -1028,8 +1026,8 @@ export const MsgUpdateAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateAdmin(); while (reader.pos < end) { @@ -1065,7 +1063,7 @@ export const MsgUpdateAdmin = { message.contract !== undefined && (obj.contract = message.contract); return obj; }, - fromPartial, I>>(object: I): MsgUpdateAdmin { + fromPartial(object: Partial): MsgUpdateAdmin { const message = createBaseMsgUpdateAdmin(); message.sender = object.sender ?? ""; message.newAdmin = object.newAdmin ?? ""; @@ -1077,11 +1075,11 @@ function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { return {}; } export const MsgUpdateAdminResponse = { - encode(_: MsgUpdateAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateAdminResponse(); while (reader.pos < end) { @@ -1102,7 +1100,7 @@ export const MsgUpdateAdminResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateAdminResponse { + fromPartial(_: Partial): MsgUpdateAdminResponse { const message = createBaseMsgUpdateAdminResponse(); return message; }, @@ -1114,7 +1112,7 @@ function createBaseMsgClearAdmin(): MsgClearAdmin { }; } export const MsgClearAdmin = { - encode(message: MsgClearAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } @@ -1123,8 +1121,8 @@ export const MsgClearAdmin = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdmin { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgClearAdmin(); while (reader.pos < end) { @@ -1155,7 +1153,7 @@ export const MsgClearAdmin = { message.contract !== undefined && (obj.contract = message.contract); return obj; }, - fromPartial, I>>(object: I): MsgClearAdmin { + fromPartial(object: Partial): MsgClearAdmin { const message = createBaseMsgClearAdmin(); message.sender = object.sender ?? ""; message.contract = object.contract ?? ""; @@ -1166,11 +1164,11 @@ function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { return {}; } export const MsgClearAdminResponse = { - encode(_: MsgClearAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgClearAdminResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgClearAdminResponse(); while (reader.pos < end) { @@ -1191,7 +1189,7 @@ export const MsgClearAdminResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgClearAdminResponse { + fromPartial(_: Partial): MsgClearAdminResponse { const message = createBaseMsgClearAdminResponse(); return message; }, @@ -1199,16 +1197,16 @@ export const MsgClearAdminResponse = { function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { return { sender: "", - codeId: Long.UZERO, + codeId: BigInt(0), newInstantiatePermission: AccessConfig.fromPartial({}), }; } export const MsgUpdateInstantiateConfig = { - encode(message: MsgUpdateInstantiateConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(16).uint64(message.codeId); } if (message.newInstantiatePermission !== undefined) { @@ -1216,8 +1214,8 @@ export const MsgUpdateInstantiateConfig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateInstantiateConfig(); while (reader.pos < end) { @@ -1227,7 +1225,7 @@ export const MsgUpdateInstantiateConfig = { message.sender = reader.string(); break; case 2: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 3: message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); @@ -1242,7 +1240,7 @@ export const MsgUpdateInstantiateConfig = { fromJSON(object: any): MsgUpdateInstantiateConfig { const obj = createBaseMsgUpdateInstantiateConfig(); if (isSet(object.sender)) obj.sender = String(object.sender); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.newInstantiatePermission)) obj.newInstantiatePermission = AccessConfig.fromJSON(object.newInstantiatePermission); return obj; @@ -1250,20 +1248,18 @@ export const MsgUpdateInstantiateConfig = { toJSON(message: MsgUpdateInstantiateConfig): unknown { const obj: any = {}; message.sender !== undefined && (obj.sender = message.sender); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.newInstantiatePermission !== undefined && (obj.newInstantiatePermission = message.newInstantiatePermission ? AccessConfig.toJSON(message.newInstantiatePermission) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): MsgUpdateInstantiateConfig { + fromPartial(object: Partial): MsgUpdateInstantiateConfig { const message = createBaseMsgUpdateInstantiateConfig(); message.sender = object.sender ?? ""; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } if (object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null) { message.newInstantiatePermission = AccessConfig.fromPartial(object.newInstantiatePermission); @@ -1275,11 +1271,11 @@ function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateCon return {}; } export const MsgUpdateInstantiateConfigResponse = { - encode(_: MsgUpdateInstantiateConfigResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateInstantiateConfigResponse(); while (reader.pos < end) { @@ -1300,9 +1296,7 @@ export const MsgUpdateInstantiateConfigResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgUpdateInstantiateConfigResponse { + fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { const message = createBaseMsgUpdateInstantiateConfigResponse(); return message; }, @@ -1314,7 +1308,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1323,8 +1317,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -1355,7 +1349,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -1368,11 +1362,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -1393,7 +1387,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -1406,7 +1400,7 @@ function createBaseMsgSudoContract(): MsgSudoContract { }; } export const MsgSudoContract = { - encode(message: MsgSudoContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSudoContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1418,8 +1412,8 @@ export const MsgSudoContract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSudoContract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSudoContract(); while (reader.pos < end) { @@ -1456,7 +1450,7 @@ export const MsgSudoContract = { (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MsgSudoContract { + fromPartial(object: Partial): MsgSudoContract { const message = createBaseMsgSudoContract(); message.authority = object.authority ?? ""; message.contract = object.contract ?? ""; @@ -1470,14 +1464,14 @@ function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { }; } export const MsgSudoContractResponse = { - encode(message: MsgSudoContractResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSudoContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSudoContractResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSudoContractResponse(); while (reader.pos < end) { @@ -1504,7 +1498,7 @@ export const MsgSudoContractResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MsgSudoContractResponse { + fromPartial(object: Partial): MsgSudoContractResponse { const message = createBaseMsgSudoContractResponse(); message.data = object.data ?? new Uint8Array(); return message; @@ -1517,7 +1511,7 @@ function createBaseMsgPinCodes(): MsgPinCodes { }; } export const MsgPinCodes = { - encode(message: MsgPinCodes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgPinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1528,8 +1522,8 @@ export const MsgPinCodes = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPinCodes { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPinCodes(); while (reader.pos < end) { @@ -1542,10 +1536,10 @@ export const MsgPinCodes = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } } else { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } break; default: @@ -1558,23 +1552,23 @@ export const MsgPinCodes = { fromJSON(object: any): MsgPinCodes { const obj = createBaseMsgPinCodes(); if (isSet(object.authority)) obj.authority = String(object.authority); - if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: MsgPinCodes): unknown { const obj: any = {}; message.authority !== undefined && (obj.authority = message.authority); if (message.codeIds) { - obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + obj.codeIds = message.codeIds.map((e) => (e || BigInt(0)).toString()); } else { obj.codeIds = []; } return obj; }, - fromPartial, I>>(object: I): MsgPinCodes { + fromPartial(object: Partial): MsgPinCodes { const message = createBaseMsgPinCodes(); message.authority = object.authority ?? ""; - message.codeIds = object.codeIds?.map((e) => Long.fromValue(e)) || []; + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || []; return message; }, }; @@ -1582,11 +1576,11 @@ function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { return {}; } export const MsgPinCodesResponse = { - encode(_: MsgPinCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgPinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPinCodesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPinCodesResponse(); while (reader.pos < end) { @@ -1607,7 +1601,7 @@ export const MsgPinCodesResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgPinCodesResponse { + fromPartial(_: Partial): MsgPinCodesResponse { const message = createBaseMsgPinCodesResponse(); return message; }, @@ -1619,7 +1613,7 @@ function createBaseMsgUnpinCodes(): MsgUnpinCodes { }; } export const MsgUnpinCodes = { - encode(message: MsgUnpinCodes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUnpinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1630,8 +1624,8 @@ export const MsgUnpinCodes = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpinCodes { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnpinCodes(); while (reader.pos < end) { @@ -1644,10 +1638,10 @@ export const MsgUnpinCodes = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } } else { - message.codeIds.push(reader.uint64() as Long); + message.codeIds.push(reader.uint64()); } break; default: @@ -1660,23 +1654,23 @@ export const MsgUnpinCodes = { fromJSON(object: any): MsgUnpinCodes { const obj = createBaseMsgUnpinCodes(); if (isSet(object.authority)) obj.authority = String(object.authority); - if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.codeIds)) obj.codeIds = object.codeIds.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: MsgUnpinCodes): unknown { const obj: any = {}; message.authority !== undefined && (obj.authority = message.authority); if (message.codeIds) { - obj.codeIds = message.codeIds.map((e) => (e || Long.UZERO).toString()); + obj.codeIds = message.codeIds.map((e) => (e || BigInt(0)).toString()); } else { obj.codeIds = []; } return obj; }, - fromPartial, I>>(object: I): MsgUnpinCodes { + fromPartial(object: Partial): MsgUnpinCodes { const message = createBaseMsgUnpinCodes(); message.authority = object.authority ?? ""; - message.codeIds = object.codeIds?.map((e) => Long.fromValue(e)) || []; + message.codeIds = object.codeIds?.map((e) => BigInt(e.toString())) || []; return message; }, }; @@ -1684,11 +1678,11 @@ function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { return {}; } export const MsgUnpinCodesResponse = { - encode(_: MsgUnpinCodesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUnpinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnpinCodesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUnpinCodesResponse(); while (reader.pos < end) { @@ -1709,7 +1703,7 @@ export const MsgUnpinCodesResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUnpinCodesResponse { + fromPartial(_: Partial): MsgUnpinCodesResponse { const message = createBaseMsgUnpinCodesResponse(); return message; }, @@ -1730,7 +1724,10 @@ function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContr }; } export const MsgStoreAndInstantiateContract = { - encode(message: MsgStoreAndInstantiateContract, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MsgStoreAndInstantiateContract, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -1766,8 +1763,8 @@ export const MsgStoreAndInstantiateContract = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreAndInstantiateContract { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgStoreAndInstantiateContract(); while (reader.pos < end) { @@ -1856,9 +1853,7 @@ export const MsgStoreAndInstantiateContract = { (obj.codeHash = base64FromBytes(message.codeHash !== undefined ? message.codeHash : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): MsgStoreAndInstantiateContract { + fromPartial(object: Partial): MsgStoreAndInstantiateContract { const message = createBaseMsgStoreAndInstantiateContract(); message.authority = object.authority ?? ""; message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); @@ -1885,8 +1880,8 @@ function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstanti export const MsgStoreAndInstantiateContractResponse = { encode( message: MsgStoreAndInstantiateContractResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -1895,8 +1890,8 @@ export const MsgStoreAndInstantiateContractResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgStoreAndInstantiateContractResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgStoreAndInstantiateContractResponse(); while (reader.pos < end) { @@ -1928,8 +1923,8 @@ export const MsgStoreAndInstantiateContractResponse = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): MsgStoreAndInstantiateContractResponse { const message = createBaseMsgStoreAndInstantiateContractResponse(); message.address = object.address ?? ""; @@ -2020,68 +2015,68 @@ export class MsgClientImpl implements Msg { StoreCode(request: MsgStoreCode): Promise { const data = MsgStoreCode.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreCode", data); - return promise.then((data) => MsgStoreCodeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgStoreCodeResponse.decode(new BinaryReader(data))); } InstantiateContract(request: MsgInstantiateContract): Promise { const data = MsgInstantiateContract.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "InstantiateContract", data); - return promise.then((data) => MsgInstantiateContractResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgInstantiateContractResponse.decode(new BinaryReader(data))); } InstantiateContract2(request: MsgInstantiateContract2): Promise { const data = MsgInstantiateContract2.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "InstantiateContract2", data); - return promise.then((data) => MsgInstantiateContract2Response.decode(new _m0.Reader(data))); + return promise.then((data) => MsgInstantiateContract2Response.decode(new BinaryReader(data))); } ExecuteContract(request: MsgExecuteContract): Promise { const data = MsgExecuteContract.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "ExecuteContract", data); - return promise.then((data) => MsgExecuteContractResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgExecuteContractResponse.decode(new BinaryReader(data))); } MigrateContract(request: MsgMigrateContract): Promise { const data = MsgMigrateContract.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "MigrateContract", data); - return promise.then((data) => MsgMigrateContractResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgMigrateContractResponse.decode(new BinaryReader(data))); } UpdateAdmin(request: MsgUpdateAdmin): Promise { const data = MsgUpdateAdmin.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateAdmin", data); - return promise.then((data) => MsgUpdateAdminResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateAdminResponse.decode(new BinaryReader(data))); } ClearAdmin(request: MsgClearAdmin): Promise { const data = MsgClearAdmin.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "ClearAdmin", data); - return promise.then((data) => MsgClearAdminResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgClearAdminResponse.decode(new BinaryReader(data))); } UpdateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise { const data = MsgUpdateInstantiateConfig.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateInstantiateConfig", data); - return promise.then((data) => MsgUpdateInstantiateConfigResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateInstantiateConfigResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } SudoContract(request: MsgSudoContract): Promise { const data = MsgSudoContract.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SudoContract", data); - return promise.then((data) => MsgSudoContractResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSudoContractResponse.decode(new BinaryReader(data))); } PinCodes(request: MsgPinCodes): Promise { const data = MsgPinCodes.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "PinCodes", data); - return promise.then((data) => MsgPinCodesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgPinCodesResponse.decode(new BinaryReader(data))); } UnpinCodes(request: MsgUnpinCodes): Promise { const data = MsgUnpinCodes.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UnpinCodes", data); - return promise.then((data) => MsgUnpinCodesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUnpinCodesResponse.decode(new BinaryReader(data))); } StoreAndInstantiateContract( request: MsgStoreAndInstantiateContract, ): Promise { const data = MsgStoreAndInstantiateContract.encode(request).finish(); const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndInstantiateContract", data); - return promise.then((data) => MsgStoreAndInstantiateContractResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgStoreAndInstantiateContractResponse.decode(new BinaryReader(data))); } } diff --git a/src/cosmwasm/wasm/v1/types.ts b/src/cosmwasm/wasm/v1/types.ts index bef242a..3dddb1c 100644 --- a/src/cosmwasm/wasm/v1/types.ts +++ b/src/cosmwasm/wasm/v1/types.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../google/protobuf/any"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; export const protobufPackage = "cosmwasm.wasm.v1"; /** AccessType permission types */ export enum AccessType { @@ -138,7 +138,7 @@ export interface CodeInfo { /** ContractInfo stores a WASM contract instance */ export interface ContractInfo { /** CodeID is the reference to the stored Wasm code */ - codeId: Long; + codeId: bigint; /** Creator address who initially instantiated the contract */ creator: string; /** Admin is an optional address that can execute migrations */ @@ -158,7 +158,7 @@ export interface ContractInfo { export interface ContractCodeHistoryEntry { operation: ContractCodeHistoryOperationType; /** CodeID is the reference to the stored WASM code */ - codeId: Long; + codeId: bigint; /** Updated Tx position when the operation was executed. */ updated: AbsoluteTxPosition; msg: Uint8Array; @@ -169,12 +169,12 @@ export interface ContractCodeHistoryEntry { */ export interface AbsoluteTxPosition { /** BlockHeight is the block the contract was created at */ - blockHeight: Long; + blockHeight: bigint; /** * TxIndex is a monotonic counter within the block (actual transaction index, * or gas consumed) */ - txIndex: Long; + txIndex: bigint; } /** Model is a struct that holds a KV pair */ export interface Model { @@ -189,14 +189,14 @@ function createBaseAccessTypeParam(): AccessTypeParam { }; } export const AccessTypeParam = { - encode(message: AccessTypeParam, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AccessTypeParam, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.value !== 0) { writer.uint32(8).int32(message.value); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AccessTypeParam { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AccessTypeParam { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAccessTypeParam(); while (reader.pos < end) { @@ -222,7 +222,7 @@ export const AccessTypeParam = { message.value !== undefined && (obj.value = accessTypeToJSON(message.value)); return obj; }, - fromPartial, I>>(object: I): AccessTypeParam { + fromPartial(object: Partial): AccessTypeParam { const message = createBaseAccessTypeParam(); message.value = object.value ?? 0; return message; @@ -236,7 +236,7 @@ function createBaseAccessConfig(): AccessConfig { }; } export const AccessConfig = { - encode(message: AccessConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AccessConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.permission !== 0) { writer.uint32(8).int32(message.permission); } @@ -248,8 +248,8 @@ export const AccessConfig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AccessConfig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAccessConfig(); while (reader.pos < end) { @@ -289,7 +289,7 @@ export const AccessConfig = { } return obj; }, - fromPartial, I>>(object: I): AccessConfig { + fromPartial(object: Partial): AccessConfig { const message = createBaseAccessConfig(); message.permission = object.permission ?? 0; message.address = object.address ?? ""; @@ -304,7 +304,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeUploadAccess !== undefined) { AccessConfig.encode(message.codeUploadAccess, writer.uint32(10).fork()).ldelim(); } @@ -313,8 +313,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -350,7 +350,7 @@ export const Params = { (obj.instantiateDefaultPermission = accessTypeToJSON(message.instantiateDefaultPermission)); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); if (object.codeUploadAccess !== undefined && object.codeUploadAccess !== null) { message.codeUploadAccess = AccessConfig.fromPartial(object.codeUploadAccess); @@ -367,7 +367,7 @@ function createBaseCodeInfo(): CodeInfo { }; } export const CodeInfo = { - encode(message: CodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.codeHash.length !== 0) { writer.uint32(10).bytes(message.codeHash); } @@ -379,8 +379,8 @@ export const CodeInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCodeInfo(); while (reader.pos < end) { @@ -421,7 +421,7 @@ export const CodeInfo = { : undefined); return obj; }, - fromPartial, I>>(object: I): CodeInfo { + fromPartial(object: Partial): CodeInfo { const message = createBaseCodeInfo(); message.codeHash = object.codeHash ?? new Uint8Array(); message.creator = object.creator ?? ""; @@ -433,7 +433,7 @@ export const CodeInfo = { }; function createBaseContractInfo(): ContractInfo { return { - codeId: Long.UZERO, + codeId: BigInt(0), creator: "", admin: "", label: "", @@ -443,8 +443,8 @@ function createBaseContractInfo(): ContractInfo { }; } export const ContractInfo = { - encode(message: ContractInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.codeId.isZero()) { + encode(message: ContractInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { writer.uint32(8).uint64(message.codeId); } if (message.creator !== "") { @@ -467,15 +467,15 @@ export const ContractInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContractInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContractInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContractInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 2: message.creator = reader.string(); @@ -504,7 +504,7 @@ export const ContractInfo = { }, fromJSON(object: any): ContractInfo { const obj = createBaseContractInfo(); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.creator)) obj.creator = String(object.creator); if (isSet(object.admin)) obj.admin = String(object.admin); if (isSet(object.label)) obj.label = String(object.label); @@ -515,7 +515,7 @@ export const ContractInfo = { }, toJSON(message: ContractInfo): unknown { const obj: any = {}; - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.creator !== undefined && (obj.creator = message.creator); message.admin !== undefined && (obj.admin = message.admin); message.label !== undefined && (obj.label = message.label); @@ -526,10 +526,10 @@ export const ContractInfo = { (obj.extension = message.extension ? Any.toJSON(message.extension) : undefined); return obj; }, - fromPartial, I>>(object: I): ContractInfo { + fromPartial(object: Partial): ContractInfo { const message = createBaseContractInfo(); if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } message.creator = object.creator ?? ""; message.admin = object.admin ?? ""; @@ -547,17 +547,17 @@ export const ContractInfo = { function createBaseContractCodeHistoryEntry(): ContractCodeHistoryEntry { return { operation: 0, - codeId: Long.UZERO, + codeId: BigInt(0), updated: AbsoluteTxPosition.fromPartial({}), msg: new Uint8Array(), }; } export const ContractCodeHistoryEntry = { - encode(message: ContractCodeHistoryEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ContractCodeHistoryEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.operation !== 0) { writer.uint32(8).int32(message.operation); } - if (!message.codeId.isZero()) { + if (message.codeId !== BigInt(0)) { writer.uint32(16).uint64(message.codeId); } if (message.updated !== undefined) { @@ -568,8 +568,8 @@ export const ContractCodeHistoryEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ContractCodeHistoryEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ContractCodeHistoryEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseContractCodeHistoryEntry(); while (reader.pos < end) { @@ -579,7 +579,7 @@ export const ContractCodeHistoryEntry = { message.operation = reader.int32() as any; break; case 2: - message.codeId = reader.uint64() as Long; + message.codeId = reader.uint64(); break; case 3: message.updated = AbsoluteTxPosition.decode(reader, reader.uint32()); @@ -597,7 +597,7 @@ export const ContractCodeHistoryEntry = { fromJSON(object: any): ContractCodeHistoryEntry { const obj = createBaseContractCodeHistoryEntry(); if (isSet(object.operation)) obj.operation = contractCodeHistoryOperationTypeFromJSON(object.operation); - if (isSet(object.codeId)) obj.codeId = Long.fromValue(object.codeId); + if (isSet(object.codeId)) obj.codeId = BigInt(object.codeId.toString()); if (isSet(object.updated)) obj.updated = AbsoluteTxPosition.fromJSON(object.updated); if (isSet(object.msg)) obj.msg = bytesFromBase64(object.msg); return obj; @@ -606,20 +606,18 @@ export const ContractCodeHistoryEntry = { const obj: any = {}; message.operation !== undefined && (obj.operation = contractCodeHistoryOperationTypeToJSON(message.operation)); - message.codeId !== undefined && (obj.codeId = (message.codeId || Long.UZERO).toString()); + message.codeId !== undefined && (obj.codeId = (message.codeId || BigInt(0)).toString()); message.updated !== undefined && (obj.updated = message.updated ? AbsoluteTxPosition.toJSON(message.updated) : undefined); message.msg !== undefined && (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): ContractCodeHistoryEntry { + fromPartial(object: Partial): ContractCodeHistoryEntry { const message = createBaseContractCodeHistoryEntry(); message.operation = object.operation ?? 0; if (object.codeId !== undefined && object.codeId !== null) { - message.codeId = Long.fromValue(object.codeId); + message.codeId = BigInt(object.codeId.toString()); } if (object.updated !== undefined && object.updated !== null) { message.updated = AbsoluteTxPosition.fromPartial(object.updated); @@ -630,32 +628,32 @@ export const ContractCodeHistoryEntry = { }; function createBaseAbsoluteTxPosition(): AbsoluteTxPosition { return { - blockHeight: Long.UZERO, - txIndex: Long.UZERO, + blockHeight: BigInt(0), + txIndex: BigInt(0), }; } export const AbsoluteTxPosition = { - encode(message: AbsoluteTxPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockHeight.isZero()) { + encode(message: AbsoluteTxPosition, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { writer.uint32(8).uint64(message.blockHeight); } - if (!message.txIndex.isZero()) { + if (message.txIndex !== BigInt(0)) { writer.uint32(16).uint64(message.txIndex); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AbsoluteTxPosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AbsoluteTxPosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAbsoluteTxPosition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockHeight = reader.uint64() as Long; + message.blockHeight = reader.uint64(); break; case 2: - message.txIndex = reader.uint64() as Long; + message.txIndex = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -666,23 +664,23 @@ export const AbsoluteTxPosition = { }, fromJSON(object: any): AbsoluteTxPosition { const obj = createBaseAbsoluteTxPosition(); - if (isSet(object.blockHeight)) obj.blockHeight = Long.fromValue(object.blockHeight); - if (isSet(object.txIndex)) obj.txIndex = Long.fromValue(object.txIndex); + if (isSet(object.blockHeight)) obj.blockHeight = BigInt(object.blockHeight.toString()); + if (isSet(object.txIndex)) obj.txIndex = BigInt(object.txIndex.toString()); return obj; }, toJSON(message: AbsoluteTxPosition): unknown { const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString()); - message.txIndex !== undefined && (obj.txIndex = (message.txIndex || Long.UZERO).toString()); + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); + message.txIndex !== undefined && (obj.txIndex = (message.txIndex || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): AbsoluteTxPosition { + fromPartial(object: Partial): AbsoluteTxPosition { const message = createBaseAbsoluteTxPosition(); if (object.blockHeight !== undefined && object.blockHeight !== null) { - message.blockHeight = Long.fromValue(object.blockHeight); + message.blockHeight = BigInt(object.blockHeight.toString()); } if (object.txIndex !== undefined && object.txIndex !== null) { - message.txIndex = Long.fromValue(object.txIndex); + message.txIndex = BigInt(object.txIndex.toString()); } return message; }, @@ -694,7 +692,7 @@ function createBaseModel(): Model { }; } export const Model = { - encode(message: Model, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Model, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -703,8 +701,8 @@ export const Model = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Model { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Model { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseModel(); while (reader.pos < end) { @@ -737,7 +735,7 @@ export const Model = { (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): Model { + fromPartial(object: Partial): Model { const message = createBaseModel(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); diff --git a/src/google/api/http.ts b/src/google/api/http.ts index 737c1d0..189cef5 100644 --- a/src/google/api/http.ts +++ b/src/google/api/http.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../helpers"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; export const protobufPackage = "google.api"; /** * Defines the HTTP configuration for an API service. It contains a list of @@ -301,7 +301,7 @@ function createBaseHttp(): Http { }; } export const Http = { - encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Http, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.rules) { HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -310,8 +310,8 @@ export const Http = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Http { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHttp(); while (reader.pos < end) { @@ -348,7 +348,7 @@ export const Http = { (obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion); return obj; }, - fromPartial, I>>(object: I): Http { + fromPartial(object: Partial): Http { const message = createBaseHttp(); message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; @@ -370,7 +370,7 @@ function createBaseHttpRule(): HttpRule { }; } export const HttpRule = { - encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HttpRule, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.selector !== "") { writer.uint32(10).string(message.selector); } @@ -403,8 +403,8 @@ export const HttpRule = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHttpRule(); while (reader.pos < end) { @@ -481,7 +481,7 @@ export const HttpRule = { } return obj; }, - fromPartial, I>>(object: I): HttpRule { + fromPartial(object: Partial): HttpRule { const message = createBaseHttpRule(); message.selector = object.selector ?? ""; message.get = object.get ?? undefined; @@ -505,7 +505,7 @@ function createBaseCustomHttpPattern(): CustomHttpPattern { }; } export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CustomHttpPattern, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.kind !== "") { writer.uint32(10).string(message.kind); } @@ -514,8 +514,8 @@ export const CustomHttpPattern = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCustomHttpPattern(); while (reader.pos < end) { @@ -546,7 +546,7 @@ export const CustomHttpPattern = { message.path !== undefined && (obj.path = message.path); return obj; }, - fromPartial, I>>(object: I): CustomHttpPattern { + fromPartial(object: Partial): CustomHttpPattern { const message = createBaseCustomHttpPattern(); message.kind = object.kind ?? ""; message.path = object.path ?? ""; diff --git a/src/google/protobuf/any.ts b/src/google/protobuf/any.ts index 67682c4..d06eb77 100644 --- a/src/google/protobuf/any.ts +++ b/src/google/protobuf/any.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../helpers"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export const protobufPackage = "google.protobuf"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a @@ -124,7 +124,7 @@ function createBaseAny(): Any { }; } export const Any = { - encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Any, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.typeUrl !== "") { writer.uint32(10).string(message.typeUrl); } @@ -133,8 +133,8 @@ export const Any = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Any { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAny(); while (reader.pos < end) { @@ -166,7 +166,7 @@ export const Any = { (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): Any { + fromPartial(object: Partial): Any { const message = createBaseAny(); message.typeUrl = object.typeUrl ?? ""; message.value = object.value ?? new Uint8Array(); diff --git a/src/google/protobuf/descriptor.ts b/src/google/protobuf/descriptor.ts index 0c13b52..b9d64af 100644 --- a/src/google/protobuf/descriptor.ts +++ b/src/google/protobuf/descriptor.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, DeepPartial, Exact, isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export const protobufPackage = "google.protobuf"; export enum FieldDescriptorProto_Type { /** @@ -856,8 +856,8 @@ export interface UninterpretedOption { * identified it as during parsing. Exactly one of these should be set. */ identifierValue: string; - positiveIntValue: Long; - negativeIntValue: Long; + positiveIntValue: bigint; + negativeIntValue: bigint; doubleValue: number; stringValue: Uint8Array; aggregateValue: string; @@ -1051,14 +1051,14 @@ function createBaseFileDescriptorSet(): FileDescriptorSet { }; } export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FileDescriptorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.file) { FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileDescriptorSet(); while (reader.pos < end) { @@ -1088,7 +1088,7 @@ export const FileDescriptorSet = { } return obj; }, - fromPartial, I>>(object: I): FileDescriptorSet { + fromPartial(object: Partial): FileDescriptorSet { const message = createBaseFileDescriptorSet(); message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; return message; @@ -1111,7 +1111,7 @@ function createBaseFileDescriptorProto(): FileDescriptorProto { }; } export const FileDescriptorProto = { - encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FileDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1154,8 +1154,8 @@ export const FileDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileDescriptorProto(); while (reader.pos < end) { @@ -1288,7 +1288,7 @@ export const FileDescriptorProto = { message.syntax !== undefined && (obj.syntax = message.syntax); return obj; }, - fromPartial, I>>(object: I): FileDescriptorProto { + fromPartial(object: Partial): FileDescriptorProto { const message = createBaseFileDescriptorProto(); message.name = object.name ?? ""; message.package = object.package ?? ""; @@ -1324,7 +1324,7 @@ function createBaseDescriptorProto(): DescriptorProto { }; } export const DescriptorProto = { - encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1357,8 +1357,8 @@ export const DescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescriptorProto(); while (reader.pos < end) { @@ -1474,7 +1474,7 @@ export const DescriptorProto = { } return obj; }, - fromPartial, I>>(object: I): DescriptorProto { + fromPartial(object: Partial): DescriptorProto { const message = createBaseDescriptorProto(); message.name = object.name ?? ""; message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; @@ -1501,7 +1501,10 @@ function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRa }; } export const DescriptorProto_ExtensionRange = { - encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: DescriptorProto_ExtensionRange, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1513,8 +1516,8 @@ export const DescriptorProto_ExtensionRange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescriptorProto_ExtensionRange(); while (reader.pos < end) { @@ -1551,9 +1554,7 @@ export const DescriptorProto_ExtensionRange = { (obj.options = message.options ? ExtensionRangeOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): DescriptorProto_ExtensionRange { + fromPartial(object: Partial): DescriptorProto_ExtensionRange { const message = createBaseDescriptorProto_ExtensionRange(); message.start = object.start ?? 0; message.end = object.end ?? 0; @@ -1570,7 +1571,7 @@ function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRang }; } export const DescriptorProto_ReservedRange = { - encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1579,8 +1580,8 @@ export const DescriptorProto_ReservedRange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDescriptorProto_ReservedRange(); while (reader.pos < end) { @@ -1611,9 +1612,7 @@ export const DescriptorProto_ReservedRange = { message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial, I>>( - object: I, - ): DescriptorProto_ReservedRange { + fromPartial(object: Partial): DescriptorProto_ReservedRange { const message = createBaseDescriptorProto_ReservedRange(); message.start = object.start ?? 0; message.end = object.end ?? 0; @@ -1626,14 +1625,14 @@ function createBaseExtensionRangeOptions(): ExtensionRangeOptions { }; } export const ExtensionRangeOptions = { - encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ExtensionRangeOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtensionRangeOptions(); while (reader.pos < end) { @@ -1666,7 +1665,7 @@ export const ExtensionRangeOptions = { } return obj; }, - fromPartial, I>>(object: I): ExtensionRangeOptions { + fromPartial(object: Partial): ExtensionRangeOptions { const message = createBaseExtensionRangeOptions(); message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; @@ -1688,7 +1687,7 @@ function createBaseFieldDescriptorProto(): FieldDescriptorProto { }; } export const FieldDescriptorProto = { - encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FieldDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1721,8 +1720,8 @@ export const FieldDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFieldDescriptorProto(); while (reader.pos < end) { @@ -1794,7 +1793,7 @@ export const FieldDescriptorProto = { (obj.options = message.options ? FieldOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>(object: I): FieldDescriptorProto { + fromPartial(object: Partial): FieldDescriptorProto { const message = createBaseFieldDescriptorProto(); message.name = object.name ?? ""; message.number = object.number ?? 0; @@ -1818,7 +1817,7 @@ function createBaseOneofDescriptorProto(): OneofDescriptorProto { }; } export const OneofDescriptorProto = { - encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: OneofDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1827,8 +1826,8 @@ export const OneofDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOneofDescriptorProto(); while (reader.pos < end) { @@ -1860,7 +1859,7 @@ export const OneofDescriptorProto = { (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>(object: I): OneofDescriptorProto { + fromPartial(object: Partial): OneofDescriptorProto { const message = createBaseOneofDescriptorProto(); message.name = object.name ?? ""; if (object.options !== undefined && object.options !== null) { @@ -1879,7 +1878,7 @@ function createBaseEnumDescriptorProto(): EnumDescriptorProto { }; } export const EnumDescriptorProto = { - encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EnumDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -1897,8 +1896,8 @@ export const EnumDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumDescriptorProto(); while (reader.pos < end) { @@ -1964,7 +1963,7 @@ export const EnumDescriptorProto = { } return obj; }, - fromPartial, I>>(object: I): EnumDescriptorProto { + fromPartial(object: Partial): EnumDescriptorProto { const message = createBaseEnumDescriptorProto(); message.name = object.name ?? ""; message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; @@ -1986,8 +1985,8 @@ function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_ export const EnumDescriptorProto_EnumReservedRange = { encode( message: EnumDescriptorProto_EnumReservedRange, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.start !== 0) { writer.uint32(8).int32(message.start); } @@ -1996,8 +1995,8 @@ export const EnumDescriptorProto_EnumReservedRange = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumDescriptorProto_EnumReservedRange(); while (reader.pos < end) { @@ -2028,9 +2027,7 @@ export const EnumDescriptorProto_EnumReservedRange = { message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial, I>>( - object: I, - ): EnumDescriptorProto_EnumReservedRange { + fromPartial(object: Partial): EnumDescriptorProto_EnumReservedRange { const message = createBaseEnumDescriptorProto_EnumReservedRange(); message.start = object.start ?? 0; message.end = object.end ?? 0; @@ -2045,7 +2042,7 @@ function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { }; } export const EnumValueDescriptorProto = { - encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2057,8 +2054,8 @@ export const EnumValueDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumValueDescriptorProto(); while (reader.pos < end) { @@ -2095,9 +2092,7 @@ export const EnumValueDescriptorProto = { (obj.options = message.options ? EnumValueOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): EnumValueDescriptorProto { + fromPartial(object: Partial): EnumValueDescriptorProto { const message = createBaseEnumValueDescriptorProto(); message.name = object.name ?? ""; message.number = object.number ?? 0; @@ -2115,7 +2110,7 @@ function createBaseServiceDescriptorProto(): ServiceDescriptorProto { }; } export const ServiceDescriptorProto = { - encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ServiceDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2127,8 +2122,8 @@ export const ServiceDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseServiceDescriptorProto(); while (reader.pos < end) { @@ -2170,7 +2165,7 @@ export const ServiceDescriptorProto = { (obj.options = message.options ? ServiceOptions.toJSON(message.options) : undefined); return obj; }, - fromPartial, I>>(object: I): ServiceDescriptorProto { + fromPartial(object: Partial): ServiceDescriptorProto { const message = createBaseServiceDescriptorProto(); message.name = object.name ?? ""; message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; @@ -2191,7 +2186,7 @@ function createBaseMethodDescriptorProto(): MethodDescriptorProto { }; } export const MethodDescriptorProto = { - encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MethodDescriptorProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.name !== "") { writer.uint32(10).string(message.name); } @@ -2212,8 +2207,8 @@ export const MethodDescriptorProto = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMethodDescriptorProto(); while (reader.pos < end) { @@ -2265,7 +2260,7 @@ export const MethodDescriptorProto = { message.serverStreaming !== undefined && (obj.serverStreaming = message.serverStreaming); return obj; }, - fromPartial, I>>(object: I): MethodDescriptorProto { + fromPartial(object: Partial): MethodDescriptorProto { const message = createBaseMethodDescriptorProto(); message.name = object.name ?? ""; message.inputType = object.inputType ?? ""; @@ -2304,7 +2299,7 @@ function createBaseFileOptions(): FileOptions { }; } export const FileOptions = { - encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FileOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.javaPackage !== "") { writer.uint32(10).string(message.javaPackage); } @@ -2370,8 +2365,8 @@ export const FileOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFileOptions(); while (reader.pos < end) { @@ -2507,7 +2502,7 @@ export const FileOptions = { } return obj; }, - fromPartial, I>>(object: I): FileOptions { + fromPartial(object: Partial): FileOptions { const message = createBaseFileOptions(); message.javaPackage = object.javaPackage ?? ""; message.javaOuterClassname = object.javaOuterClassname ?? ""; @@ -2544,7 +2539,7 @@ function createBaseMessageOptions(): MessageOptions { }; } export const MessageOptions = { - encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MessageOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.messageSetWireFormat === true) { writer.uint32(8).bool(message.messageSetWireFormat); } @@ -2562,8 +2557,8 @@ export const MessageOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMessageOptions(); while (reader.pos < end) { @@ -2618,7 +2613,7 @@ export const MessageOptions = { } return obj; }, - fromPartial, I>>(object: I): MessageOptions { + fromPartial(object: Partial): MessageOptions { const message = createBaseMessageOptions(); message.messageSetWireFormat = object.messageSetWireFormat ?? false; message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; @@ -2641,7 +2636,7 @@ function createBaseFieldOptions(): FieldOptions { }; } export const FieldOptions = { - encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FieldOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ctype !== 1) { writer.uint32(8).int32(message.ctype); } @@ -2665,8 +2660,8 @@ export const FieldOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFieldOptions(); while (reader.pos < end) { @@ -2729,7 +2724,7 @@ export const FieldOptions = { } return obj; }, - fromPartial, I>>(object: I): FieldOptions { + fromPartial(object: Partial): FieldOptions { const message = createBaseFieldOptions(); message.ctype = object.ctype ?? 1; message.packed = object.packed ?? false; @@ -2748,14 +2743,14 @@ function createBaseOneofOptions(): OneofOptions { }; } export const OneofOptions = { - encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: OneofOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.uninterpretedOption) { UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseOneofOptions(); while (reader.pos < end) { @@ -2788,7 +2783,7 @@ export const OneofOptions = { } return obj; }, - fromPartial, I>>(object: I): OneofOptions { + fromPartial(object: Partial): OneofOptions { const message = createBaseOneofOptions(); message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; @@ -2803,7 +2798,7 @@ function createBaseEnumOptions(): EnumOptions { }; } export const EnumOptions = { - encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EnumOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.allowAlias === true) { writer.uint32(16).bool(message.allowAlias); } @@ -2815,8 +2810,8 @@ export const EnumOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumOptions(); while (reader.pos < end) { @@ -2859,7 +2854,7 @@ export const EnumOptions = { } return obj; }, - fromPartial, I>>(object: I): EnumOptions { + fromPartial(object: Partial): EnumOptions { const message = createBaseEnumOptions(); message.allowAlias = object.allowAlias ?? false; message.deprecated = object.deprecated ?? false; @@ -2875,7 +2870,7 @@ function createBaseEnumValueOptions(): EnumValueOptions { }; } export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EnumValueOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(8).bool(message.deprecated); } @@ -2884,8 +2879,8 @@ export const EnumValueOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEnumValueOptions(); while (reader.pos < end) { @@ -2923,7 +2918,7 @@ export const EnumValueOptions = { } return obj; }, - fromPartial, I>>(object: I): EnumValueOptions { + fromPartial(object: Partial): EnumValueOptions { const message = createBaseEnumValueOptions(); message.deprecated = object.deprecated ?? false; message.uninterpretedOption = @@ -2938,7 +2933,7 @@ function createBaseServiceOptions(): ServiceOptions { }; } export const ServiceOptions = { - encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ServiceOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } @@ -2947,8 +2942,8 @@ export const ServiceOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseServiceOptions(); while (reader.pos < end) { @@ -2986,7 +2981,7 @@ export const ServiceOptions = { } return obj; }, - fromPartial, I>>(object: I): ServiceOptions { + fromPartial(object: Partial): ServiceOptions { const message = createBaseServiceOptions(); message.deprecated = object.deprecated ?? false; message.uninterpretedOption = @@ -3002,7 +2997,7 @@ function createBaseMethodOptions(): MethodOptions { }; } export const MethodOptions = { - encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MethodOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.deprecated === true) { writer.uint32(264).bool(message.deprecated); } @@ -3014,8 +3009,8 @@ export const MethodOptions = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMethodOptions(); while (reader.pos < end) { @@ -3060,7 +3055,7 @@ export const MethodOptions = { } return obj; }, - fromPartial, I>>(object: I): MethodOptions { + fromPartial(object: Partial): MethodOptions { const message = createBaseMethodOptions(); message.deprecated = object.deprecated ?? false; message.idempotencyLevel = object.idempotencyLevel ?? 1; @@ -3073,25 +3068,25 @@ function createBaseUninterpretedOption(): UninterpretedOption { return { name: [], identifierValue: "", - positiveIntValue: Long.UZERO, - negativeIntValue: Long.ZERO, + positiveIntValue: BigInt(0), + negativeIntValue: BigInt(0), doubleValue: 0, stringValue: new Uint8Array(), aggregateValue: "", }; } export const UninterpretedOption = { - encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UninterpretedOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.name) { UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); } if (message.identifierValue !== "") { writer.uint32(26).string(message.identifierValue); } - if (!message.positiveIntValue.isZero()) { + if (message.positiveIntValue !== BigInt(0)) { writer.uint32(32).uint64(message.positiveIntValue); } - if (!message.negativeIntValue.isZero()) { + if (message.negativeIntValue !== BigInt(0)) { writer.uint32(40).int64(message.negativeIntValue); } if (message.doubleValue !== 0) { @@ -3105,8 +3100,8 @@ export const UninterpretedOption = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUninterpretedOption(); while (reader.pos < end) { @@ -3119,10 +3114,10 @@ export const UninterpretedOption = { message.identifierValue = reader.string(); break; case 4: - message.positiveIntValue = reader.uint64() as Long; + message.positiveIntValue = reader.uint64(); break; case 5: - message.negativeIntValue = reader.int64() as Long; + message.negativeIntValue = reader.int64(); break; case 6: message.doubleValue = reader.double(); @@ -3145,8 +3140,8 @@ export const UninterpretedOption = { if (Array.isArray(object?.name)) obj.name = object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)); if (isSet(object.identifierValue)) obj.identifierValue = String(object.identifierValue); - if (isSet(object.positiveIntValue)) obj.positiveIntValue = Long.fromValue(object.positiveIntValue); - if (isSet(object.negativeIntValue)) obj.negativeIntValue = Long.fromValue(object.negativeIntValue); + if (isSet(object.positiveIntValue)) obj.positiveIntValue = BigInt(object.positiveIntValue.toString()); + if (isSet(object.negativeIntValue)) obj.negativeIntValue = BigInt(object.negativeIntValue.toString()); if (isSet(object.doubleValue)) obj.doubleValue = Number(object.doubleValue); if (isSet(object.stringValue)) obj.stringValue = bytesFromBase64(object.stringValue); if (isSet(object.aggregateValue)) obj.aggregateValue = String(object.aggregateValue); @@ -3161,9 +3156,9 @@ export const UninterpretedOption = { } message.identifierValue !== undefined && (obj.identifierValue = message.identifierValue); message.positiveIntValue !== undefined && - (obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString()); + (obj.positiveIntValue = (message.positiveIntValue || BigInt(0)).toString()); message.negativeIntValue !== undefined && - (obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString()); + (obj.negativeIntValue = (message.negativeIntValue || BigInt(0)).toString()); message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue); message.stringValue !== undefined && (obj.stringValue = base64FromBytes( @@ -3172,15 +3167,15 @@ export const UninterpretedOption = { message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue); return obj; }, - fromPartial, I>>(object: I): UninterpretedOption { + fromPartial(object: Partial): UninterpretedOption { const message = createBaseUninterpretedOption(); message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; message.identifierValue = object.identifierValue ?? ""; if (object.positiveIntValue !== undefined && object.positiveIntValue !== null) { - message.positiveIntValue = Long.fromValue(object.positiveIntValue); + message.positiveIntValue = BigInt(object.positiveIntValue.toString()); } if (object.negativeIntValue !== undefined && object.negativeIntValue !== null) { - message.negativeIntValue = Long.fromValue(object.negativeIntValue); + message.negativeIntValue = BigInt(object.negativeIntValue.toString()); } message.doubleValue = object.doubleValue ?? 0; message.stringValue = object.stringValue ?? new Uint8Array(); @@ -3195,7 +3190,7 @@ function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart }; } export const UninterpretedOption_NamePart = { - encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.namePart !== "") { writer.uint32(10).string(message.namePart); } @@ -3204,8 +3199,8 @@ export const UninterpretedOption_NamePart = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUninterpretedOption_NamePart(); while (reader.pos < end) { @@ -3236,9 +3231,7 @@ export const UninterpretedOption_NamePart = { message.isExtension !== undefined && (obj.isExtension = message.isExtension); return obj; }, - fromPartial, I>>( - object: I, - ): UninterpretedOption_NamePart { + fromPartial(object: Partial): UninterpretedOption_NamePart { const message = createBaseUninterpretedOption_NamePart(); message.namePart = object.namePart ?? ""; message.isExtension = object.isExtension ?? false; @@ -3251,14 +3244,14 @@ function createBaseSourceCodeInfo(): SourceCodeInfo { }; } export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SourceCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.location) { SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSourceCodeInfo(); while (reader.pos < end) { @@ -3289,7 +3282,7 @@ export const SourceCodeInfo = { } return obj; }, - fromPartial, I>>(object: I): SourceCodeInfo { + fromPartial(object: Partial): SourceCodeInfo { const message = createBaseSourceCodeInfo(); message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; return message; @@ -3305,7 +3298,7 @@ function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { }; } export const SourceCodeInfo_Location = { - encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.path) { writer.int32(v); @@ -3327,8 +3320,8 @@ export const SourceCodeInfo_Location = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSourceCodeInfo_Location(); while (reader.pos < end) { @@ -3401,7 +3394,7 @@ export const SourceCodeInfo_Location = { } return obj; }, - fromPartial, I>>(object: I): SourceCodeInfo_Location { + fromPartial(object: Partial): SourceCodeInfo_Location { const message = createBaseSourceCodeInfo_Location(); message.path = object.path?.map((e) => e) || []; message.span = object.span?.map((e) => e) || []; @@ -3417,14 +3410,14 @@ function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { }; } export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GeneratedCodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.annotation) { GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGeneratedCodeInfo(); while (reader.pos < end) { @@ -3457,7 +3450,7 @@ export const GeneratedCodeInfo = { } return obj; }, - fromPartial, I>>(object: I): GeneratedCodeInfo { + fromPartial(object: Partial): GeneratedCodeInfo { const message = createBaseGeneratedCodeInfo(); message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; return message; @@ -3472,7 +3465,7 @@ function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation }; } export const GeneratedCodeInfo_Annotation = { - encode(message: GeneratedCodeInfo_Annotation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.path) { writer.int32(v); @@ -3489,8 +3482,8 @@ export const GeneratedCodeInfo_Annotation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGeneratedCodeInfo_Annotation(); while (reader.pos < end) { @@ -3542,9 +3535,7 @@ export const GeneratedCodeInfo_Annotation = { message.end !== undefined && (obj.end = Math.round(message.end)); return obj; }, - fromPartial, I>>( - object: I, - ): GeneratedCodeInfo_Annotation { + fromPartial(object: Partial): GeneratedCodeInfo_Annotation { const message = createBaseGeneratedCodeInfo_Annotation(); message.path = object.path?.map((e) => e) || []; message.sourceFile = object.sourceFile ?? ""; diff --git a/src/google/protobuf/duration.ts b/src/google/protobuf/duration.ts index 88ddb26..c8e7315 100644 --- a/src/google/protobuf/duration.ts +++ b/src/google/protobuf/duration.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; export const protobufPackage = "google.protobuf"; /** * A Duration represents a signed, fixed-length span of time represented @@ -68,7 +68,7 @@ export interface Duration { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds: Long; + seconds: bigint; /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 @@ -81,13 +81,13 @@ export interface Duration { } function createBaseDuration(): Duration { return { - seconds: Long.ZERO, + seconds: BigInt(0), nanos: 0, }; } export const Duration = { - encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.seconds.isZero()) { + encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { writer.uint32(8).int64(message.seconds); } if (message.nanos !== 0) { @@ -95,15 +95,15 @@ export const Duration = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.seconds = reader.int64() as Long; + message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); @@ -117,20 +117,20 @@ export const Duration = { }, fromJSON(object: any): Duration { const obj = createBaseDuration(); - if (isSet(object.seconds)) obj.seconds = Long.fromValue(object.seconds); + if (isSet(object.seconds)) obj.seconds = BigInt(object.seconds.toString()); if (isSet(object.nanos)) obj.nanos = Number(object.nanos); return obj; }, toJSON(message: Duration): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial, I>>(object: I): Duration { + fromPartial(object: Partial): Duration { const message = createBaseDuration(); if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Long.fromValue(object.seconds); + message.seconds = BigInt(object.seconds.toString()); } message.nanos = object.nanos ?? 0; return message; diff --git a/src/google/protobuf/timestamp.ts b/src/google/protobuf/timestamp.ts index 51e34ec..e312874 100644 --- a/src/google/protobuf/timestamp.ts +++ b/src/google/protobuf/timestamp.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; export const protobufPackage = "google.protobuf"; /** * A Timestamp represents a point in time independent of any time zone or local @@ -92,7 +92,7 @@ export interface Timestamp { * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to * 9999-12-31T23:59:59Z inclusive. */ - seconds: Long; + seconds: bigint; /** * Non-negative fractions of a second at nanosecond resolution. Negative * second values with fractions must still have non-negative nanos values @@ -103,13 +103,13 @@ export interface Timestamp { } function createBaseTimestamp(): Timestamp { return { - seconds: Long.ZERO, + seconds: BigInt(0), nanos: 0, }; } export const Timestamp = { - encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.seconds.isZero()) { + encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.seconds !== BigInt(0)) { writer.uint32(8).int64(message.seconds); } if (message.nanos !== 0) { @@ -117,15 +117,15 @@ export const Timestamp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.seconds = reader.int64() as Long; + message.seconds = reader.int64(); break; case 2: message.nanos = reader.int32(); @@ -139,20 +139,20 @@ export const Timestamp = { }, fromJSON(object: any): Timestamp { const obj = createBaseTimestamp(); - if (isSet(object.seconds)) obj.seconds = Long.fromValue(object.seconds); + if (isSet(object.seconds)) obj.seconds = BigInt(object.seconds.toString()); if (isSet(object.nanos)) obj.nanos = Number(object.nanos); return obj; }, toJSON(message: Timestamp): unknown { const obj: any = {}; - message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); + message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); return obj; }, - fromPartial, I>>(object: I): Timestamp { + fromPartial(object: Partial): Timestamp { const message = createBaseTimestamp(); if (object.seconds !== undefined && object.seconds !== null) { - message.seconds = Long.fromValue(object.seconds); + message.seconds = BigInt(object.seconds.toString()); } message.nanos = object.nanos ?? 0; return message; diff --git a/src/helpers.ts b/src/helpers.ts index ab5027f..0c9eb16 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -5,18 +5,6 @@ * and run the transpile command or yarn proto command to regenerate this bundle. */ -import * as _m0 from "protobufjs/minimal"; -import Long from "long"; - -// @ts-ignore -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - - _m0.configure(); -} - -export { Long }; - declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; @@ -56,7 +44,7 @@ export interface AminoHeight { readonly revision_height?: string; } -export function omitDefault(input: T): T | undefined { +export function omitDefault(input: T): T | undefined { if (typeof input === "string") { return input === "" ? undefined : input; } @@ -65,8 +53,8 @@ export function omitDefault(input: T): T | und return input === 0 ? undefined : input; } - if (Long.isLong(input)) { - return input.isZero() ? undefined : input; + if (typeof input === "bigint") { + return input === BigInt(0) ? undefined : input; } throw new Error(`Got unsupported type ${typeof input}`); @@ -78,7 +66,7 @@ interface Duration { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds: Long; + seconds: bigint; /** * Signed fractions of a second at nanosecond resolution of the span * of time. Durations less than one second are represented with a 0 @@ -93,7 +81,7 @@ interface Duration { export function toDuration(duration: string): Duration { return { - seconds: Long.fromNumber(Math.floor(parseInt(duration) / 1000000000)), + seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)), nanos: parseInt(duration) % 1000000000, }; } @@ -112,8 +100,8 @@ export function isObject(value: any): boolean { export interface PageRequest { key: Uint8Array; - offset: Long; - limit: Long; + offset: bigint; + limit: bigint; countTotal: boolean; reverse: boolean; } @@ -158,12 +146,10 @@ export const setPaginationParams = (options: Params, pagination?: PageRequest) = return options; }; -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type Builtin = Date | Function | Uint8Array | string | number | bigint | boolean | undefined; export type DeepPartial = T extends Builtin ? T - : T extends Long - ? string | number | Long : T extends Array ? Array> : T extends ReadonlyArray @@ -187,7 +173,7 @@ interface Timestamp { * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to * 9999-12-31T23:59:59Z inclusive. */ - seconds: Long; + seconds: bigint; /** * Non-negative fractions of a second at nanosecond resolution. Negative * second values with fractions must still have non-negative nanos values @@ -208,21 +194,21 @@ export function toTimestamp(date: Date): Timestamp { } export function fromTimestamp(t: Timestamp): Date { - let millis = t.seconds.toNumber() * 1000; + let millis = Number(t.seconds) * 1000; millis += t.nanos / 1000000; return new Date(millis); } const fromJSON = (object: any): Timestamp => { return { - seconds: isSet(object.seconds) ? Long.fromString(object.seconds) : Long.ZERO, + seconds: isSet(object.seconds) ? BigInt(object.seconds) : BigInt(0), nanos: isSet(object.nanos) ? Number(object.nanos) : 0, }; }; const timestampFromJSON = (object: any): Timestamp => { return { - seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0), nanos: isSet(object.nanos) ? Number(object.nanos) : 0, }; }; @@ -238,5 +224,5 @@ export function fromJsonTimestamp(o: any): Timestamp { } function numberToLong(number: number) { - return Long.fromNumber(number); + return BigInt(number); } diff --git a/src/ibc/applications/fee/v1/ack.ts b/src/ibc/applications/fee/v1/ack.ts index 75d8ae2..61bbff8 100644 --- a/src/ibc/applications/fee/v1/ack.ts +++ b/src/ibc/applications/fee/v1/ack.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "ibc.applications.fee.v1"; /** IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware */ export interface IncentivizedAcknowledgement { @@ -19,7 +19,7 @@ function createBaseIncentivizedAcknowledgement(): IncentivizedAcknowledgement { }; } export const IncentivizedAcknowledgement = { - encode(message: IncentivizedAcknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IncentivizedAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.appAcknowledgement.length !== 0) { writer.uint32(10).bytes(message.appAcknowledgement); } @@ -31,8 +31,8 @@ export const IncentivizedAcknowledgement = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IncentivizedAcknowledgement { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IncentivizedAcknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIncentivizedAcknowledgement(); while (reader.pos < end) { @@ -72,9 +72,7 @@ export const IncentivizedAcknowledgement = { message.underlyingAppSuccess !== undefined && (obj.underlyingAppSuccess = message.underlyingAppSuccess); return obj; }, - fromPartial, I>>( - object: I, - ): IncentivizedAcknowledgement { + fromPartial(object: Partial): IncentivizedAcknowledgement { const message = createBaseIncentivizedAcknowledgement(); message.appAcknowledgement = object.appAcknowledgement ?? new Uint8Array(); message.forwardRelayerAddress = object.forwardRelayerAddress ?? ""; diff --git a/src/ibc/applications/fee/v1/fee.ts b/src/ibc/applications/fee/v1/fee.ts index bf98d3b..4255177 100644 --- a/src/ibc/applications/fee/v1/fee.ts +++ b/src/ibc/applications/fee/v1/fee.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../../../cosmos/base/v1beta1/coin"; import { PacketId } from "../../../core/channel/v1/channel"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.fee.v1"; /** Fee defines the ICS29 receive, acknowledgement and timeout fees */ export interface Fee { @@ -42,7 +42,7 @@ function createBaseFee(): Fee { }; } export const Fee = { - encode(message: Fee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Fee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.recvFee) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -54,8 +54,8 @@ export const Fee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Fee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Fee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFee(); while (reader.pos < end) { @@ -104,7 +104,7 @@ export const Fee = { } return obj; }, - fromPartial, I>>(object: I): Fee { + fromPartial(object: Partial): Fee { const message = createBaseFee(); message.recvFee = object.recvFee?.map((e) => Coin.fromPartial(e)) || []; message.ackFee = object.ackFee?.map((e) => Coin.fromPartial(e)) || []; @@ -120,7 +120,7 @@ function createBasePacketFee(): PacketFee { }; } export const PacketFee = { - encode(message: PacketFee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PacketFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(10).fork()).ldelim(); } @@ -132,8 +132,8 @@ export const PacketFee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PacketFee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PacketFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePacketFee(); while (reader.pos < end) { @@ -173,7 +173,7 @@ export const PacketFee = { } return obj; }, - fromPartial, I>>(object: I): PacketFee { + fromPartial(object: Partial): PacketFee { const message = createBasePacketFee(); if (object.fee !== undefined && object.fee !== null) { message.fee = Fee.fromPartial(object.fee); @@ -189,14 +189,14 @@ function createBasePacketFees(): PacketFees { }; } export const PacketFees = { - encode(message: PacketFees, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PacketFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.packetFees) { PacketFee.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PacketFees { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PacketFees { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePacketFees(); while (reader.pos < end) { @@ -227,7 +227,7 @@ export const PacketFees = { } return obj; }, - fromPartial, I>>(object: I): PacketFees { + fromPartial(object: Partial): PacketFees { const message = createBasePacketFees(); message.packetFees = object.packetFees?.map((e) => PacketFee.fromPartial(e)) || []; return message; @@ -240,7 +240,7 @@ function createBaseIdentifiedPacketFees(): IdentifiedPacketFees { }; } export const IdentifiedPacketFees = { - encode(message: IdentifiedPacketFees, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IdentifiedPacketFees, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); } @@ -249,8 +249,8 @@ export const IdentifiedPacketFees = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedPacketFees { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedPacketFees { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedPacketFees(); while (reader.pos < end) { @@ -287,7 +287,7 @@ export const IdentifiedPacketFees = { } return obj; }, - fromPartial, I>>(object: I): IdentifiedPacketFees { + fromPartial(object: Partial): IdentifiedPacketFees { const message = createBaseIdentifiedPacketFees(); if (object.packetId !== undefined && object.packetId !== null) { message.packetId = PacketId.fromPartial(object.packetId); diff --git a/src/ibc/applications/fee/v1/genesis.ts b/src/ibc/applications/fee/v1/genesis.ts index 89edf6f..215cf86 100644 --- a/src/ibc/applications/fee/v1/genesis.ts +++ b/src/ibc/applications/fee/v1/genesis.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { IdentifiedPacketFees } from "./fee"; import { PacketId } from "../../../core/channel/v1/channel"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.fee.v1"; /** GenesisState defines the ICS29 fee middleware genesis state */ export interface GenesisState { @@ -62,7 +62,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.identifiedFees) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -80,8 +80,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -164,7 +164,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.identifiedFees = object.identifiedFees?.map((e) => IdentifiedPacketFees.fromPartial(e)) || []; message.feeEnabledChannels = @@ -183,7 +183,7 @@ function createBaseFeeEnabledChannel(): FeeEnabledChannel { }; } export const FeeEnabledChannel = { - encode(message: FeeEnabledChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FeeEnabledChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -192,8 +192,8 @@ export const FeeEnabledChannel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FeeEnabledChannel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FeeEnabledChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFeeEnabledChannel(); while (reader.pos < end) { @@ -224,7 +224,7 @@ export const FeeEnabledChannel = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>(object: I): FeeEnabledChannel { + fromPartial(object: Partial): FeeEnabledChannel { const message = createBaseFeeEnabledChannel(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -239,7 +239,7 @@ function createBaseRegisteredPayee(): RegisteredPayee { }; } export const RegisteredPayee = { - encode(message: RegisteredPayee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RegisteredPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } @@ -251,8 +251,8 @@ export const RegisteredPayee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RegisteredPayee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredPayee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRegisteredPayee(); while (reader.pos < end) { @@ -288,7 +288,7 @@ export const RegisteredPayee = { message.payee !== undefined && (obj.payee = message.payee); return obj; }, - fromPartial, I>>(object: I): RegisteredPayee { + fromPartial(object: Partial): RegisteredPayee { const message = createBaseRegisteredPayee(); message.channelId = object.channelId ?? ""; message.relayer = object.relayer ?? ""; @@ -304,7 +304,7 @@ function createBaseRegisteredCounterpartyPayee(): RegisteredCounterpartyPayee { }; } export const RegisteredCounterpartyPayee = { - encode(message: RegisteredCounterpartyPayee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RegisteredCounterpartyPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } @@ -316,8 +316,8 @@ export const RegisteredCounterpartyPayee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RegisteredCounterpartyPayee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredCounterpartyPayee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRegisteredCounterpartyPayee(); while (reader.pos < end) { @@ -353,9 +353,7 @@ export const RegisteredCounterpartyPayee = { message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee); return obj; }, - fromPartial, I>>( - object: I, - ): RegisteredCounterpartyPayee { + fromPartial(object: Partial): RegisteredCounterpartyPayee { const message = createBaseRegisteredCounterpartyPayee(); message.channelId = object.channelId ?? ""; message.relayer = object.relayer ?? ""; @@ -370,7 +368,7 @@ function createBaseForwardRelayerAddress(): ForwardRelayerAddress { }; } export const ForwardRelayerAddress = { - encode(message: ForwardRelayerAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ForwardRelayerAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -379,8 +377,8 @@ export const ForwardRelayerAddress = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ForwardRelayerAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ForwardRelayerAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseForwardRelayerAddress(); while (reader.pos < end) { @@ -412,7 +410,7 @@ export const ForwardRelayerAddress = { (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); return obj; }, - fromPartial, I>>(object: I): ForwardRelayerAddress { + fromPartial(object: Partial): ForwardRelayerAddress { const message = createBaseForwardRelayerAddress(); message.address = object.address ?? ""; if (object.packetId !== undefined && object.packetId !== null) { diff --git a/src/ibc/applications/fee/v1/metadata.ts b/src/ibc/applications/fee/v1/metadata.ts index 0f3d145..ee38326 100644 --- a/src/ibc/applications/fee/v1/metadata.ts +++ b/src/ibc/applications/fee/v1/metadata.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.fee.v1"; /** * Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring @@ -19,7 +19,7 @@ function createBaseMetadata(): Metadata { }; } export const Metadata = { - encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.feeVersion !== "") { writer.uint32(10).string(message.feeVersion); } @@ -28,8 +28,8 @@ export const Metadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMetadata(); while (reader.pos < end) { @@ -60,7 +60,7 @@ export const Metadata = { message.appVersion !== undefined && (obj.appVersion = message.appVersion); return obj; }, - fromPartial, I>>(object: I): Metadata { + fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.feeVersion = object.feeVersion ?? ""; message.appVersion = object.appVersion ?? ""; diff --git a/src/ibc/applications/fee/v1/query.ts b/src/ibc/applications/fee/v1/query.ts index d90bd71..0830be5 100644 --- a/src/ibc/applications/fee/v1/query.ts +++ b/src/ibc/applications/fee/v1/query.ts @@ -4,15 +4,15 @@ import { PacketId } from "../../../core/channel/v1/channel"; import { IdentifiedPacketFees } from "./fee"; import { Coin } from "../../../../cosmos/base/v1beta1/coin"; import { FeeEnabledChannel } from "./genesis"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.applications.fee.v1"; /** QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsRequest { /** pagination defines an optional pagination for the request. */ pagination: PageRequest; /** block height at which to query */ - queryHeight: Long; + queryHeight: bigint; } /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsResponse { @@ -24,7 +24,7 @@ export interface QueryIncentivizedPacketRequest { /** unique packet identifier comprised of channel ID, port ID and sequence */ packetId: PacketId; /** block height at which to query */ - queryHeight: Long; + queryHeight: bigint; } /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc */ export interface QueryIncentivizedPacketResponse { @@ -41,7 +41,7 @@ export interface QueryIncentivizedPacketsForChannelRequest { portId: string; channelId: string; /** Height to query at */ - queryHeight: Long; + queryHeight: bigint; } /** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */ export interface QueryIncentivizedPacketsForChannelResponse { @@ -107,7 +107,7 @@ export interface QueryFeeEnabledChannelsRequest { /** pagination defines an optional pagination for the request. */ pagination: PageRequest; /** block height at which to query */ - queryHeight: Long; + queryHeight: bigint; } /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsResponse { @@ -129,21 +129,24 @@ export interface QueryFeeEnabledChannelResponse { function createBaseQueryIncentivizedPacketsRequest(): QueryIncentivizedPacketsRequest { return { pagination: PageRequest.fromPartial({}), - queryHeight: Long.UZERO, + queryHeight: BigInt(0), }; } export const QueryIncentivizedPacketsRequest = { - encode(message: QueryIncentivizedPacketsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryIncentivizedPacketsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } - if (!message.queryHeight.isZero()) { + if (message.queryHeight !== BigInt(0)) { writer.uint32(16).uint64(message.queryHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIncentivizedPacketsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIncentivizedPacketsRequest(); while (reader.pos < end) { @@ -153,7 +156,7 @@ export const QueryIncentivizedPacketsRequest = { message.pagination = PageRequest.decode(reader, reader.uint32()); break; case 2: - message.queryHeight = reader.uint64() as Long; + message.queryHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -165,25 +168,23 @@ export const QueryIncentivizedPacketsRequest = { fromJSON(object: any): QueryIncentivizedPacketsRequest { const obj = createBaseQueryIncentivizedPacketsRequest(); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); - if (isSet(object.queryHeight)) obj.queryHeight = Long.fromValue(object.queryHeight); + if (isSet(object.queryHeight)) obj.queryHeight = BigInt(object.queryHeight.toString()); return obj; }, toJSON(message: QueryIncentivizedPacketsRequest): unknown { const obj: any = {}; message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || Long.UZERO).toString()); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryIncentivizedPacketsRequest { + fromPartial(object: Partial): QueryIncentivizedPacketsRequest { const message = createBaseQueryIncentivizedPacketsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); } if (object.queryHeight !== undefined && object.queryHeight !== null) { - message.queryHeight = Long.fromValue(object.queryHeight); + message.queryHeight = BigInt(object.queryHeight.toString()); } return message; }, @@ -194,14 +195,17 @@ function createBaseQueryIncentivizedPacketsResponse(): QueryIncentivizedPacketsR }; } export const QueryIncentivizedPacketsResponse = { - encode(message: QueryIncentivizedPacketsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryIncentivizedPacketsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.incentivizedPackets) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIncentivizedPacketsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIncentivizedPacketsResponse(); while (reader.pos < end) { @@ -234,9 +238,7 @@ export const QueryIncentivizedPacketsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryIncentivizedPacketsResponse { + fromPartial(object: Partial): QueryIncentivizedPacketsResponse { const message = createBaseQueryIncentivizedPacketsResponse(); message.incentivizedPackets = object.incentivizedPackets?.map((e) => IdentifiedPacketFees.fromPartial(e)) || []; @@ -246,21 +248,24 @@ export const QueryIncentivizedPacketsResponse = { function createBaseQueryIncentivizedPacketRequest(): QueryIncentivizedPacketRequest { return { packetId: PacketId.fromPartial({}), - queryHeight: Long.UZERO, + queryHeight: BigInt(0), }; } export const QueryIncentivizedPacketRequest = { - encode(message: QueryIncentivizedPacketRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryIncentivizedPacketRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); } - if (!message.queryHeight.isZero()) { + if (message.queryHeight !== BigInt(0)) { writer.uint32(16).uint64(message.queryHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIncentivizedPacketRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIncentivizedPacketRequest(); while (reader.pos < end) { @@ -270,7 +275,7 @@ export const QueryIncentivizedPacketRequest = { message.packetId = PacketId.decode(reader, reader.uint32()); break; case 2: - message.queryHeight = reader.uint64() as Long; + message.queryHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -282,25 +287,23 @@ export const QueryIncentivizedPacketRequest = { fromJSON(object: any): QueryIncentivizedPacketRequest { const obj = createBaseQueryIncentivizedPacketRequest(); if (isSet(object.packetId)) obj.packetId = PacketId.fromJSON(object.packetId); - if (isSet(object.queryHeight)) obj.queryHeight = Long.fromValue(object.queryHeight); + if (isSet(object.queryHeight)) obj.queryHeight = BigInt(object.queryHeight.toString()); return obj; }, toJSON(message: QueryIncentivizedPacketRequest): unknown { const obj: any = {}; message.packetId !== undefined && (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); - message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || Long.UZERO).toString()); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryIncentivizedPacketRequest { + fromPartial(object: Partial): QueryIncentivizedPacketRequest { const message = createBaseQueryIncentivizedPacketRequest(); if (object.packetId !== undefined && object.packetId !== null) { message.packetId = PacketId.fromPartial(object.packetId); } if (object.queryHeight !== undefined && object.queryHeight !== null) { - message.queryHeight = Long.fromValue(object.queryHeight); + message.queryHeight = BigInt(object.queryHeight.toString()); } return message; }, @@ -311,14 +314,17 @@ function createBaseQueryIncentivizedPacketResponse(): QueryIncentivizedPacketRes }; } export const QueryIncentivizedPacketResponse = { - encode(message: QueryIncentivizedPacketResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryIncentivizedPacketResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.incentivizedPacket !== undefined) { IdentifiedPacketFees.encode(message.incentivizedPacket, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIncentivizedPacketResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIncentivizedPacketResponse(); while (reader.pos < end) { @@ -348,9 +354,7 @@ export const QueryIncentivizedPacketResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryIncentivizedPacketResponse { + fromPartial(object: Partial): QueryIncentivizedPacketResponse { const message = createBaseQueryIncentivizedPacketResponse(); if (object.incentivizedPacket !== undefined && object.incentivizedPacket !== null) { message.incentivizedPacket = IdentifiedPacketFees.fromPartial(object.incentivizedPacket); @@ -363,14 +367,14 @@ function createBaseQueryIncentivizedPacketsForChannelRequest(): QueryIncentivize pagination: PageRequest.fromPartial({}), portId: "", channelId: "", - queryHeight: Long.UZERO, + queryHeight: BigInt(0), }; } export const QueryIncentivizedPacketsForChannelRequest = { encode( message: QueryIncentivizedPacketsForChannelRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } @@ -380,13 +384,13 @@ export const QueryIncentivizedPacketsForChannelRequest = { if (message.channelId !== "") { writer.uint32(26).string(message.channelId); } - if (!message.queryHeight.isZero()) { + if (message.queryHeight !== BigInt(0)) { writer.uint32(32).uint64(message.queryHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIncentivizedPacketsForChannelRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketsForChannelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIncentivizedPacketsForChannelRequest(); while (reader.pos < end) { @@ -402,7 +406,7 @@ export const QueryIncentivizedPacketsForChannelRequest = { message.channelId = reader.string(); break; case 4: - message.queryHeight = reader.uint64() as Long; + message.queryHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -416,7 +420,7 @@ export const QueryIncentivizedPacketsForChannelRequest = { if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.queryHeight)) obj.queryHeight = Long.fromValue(object.queryHeight); + if (isSet(object.queryHeight)) obj.queryHeight = BigInt(object.queryHeight.toString()); return obj; }, toJSON(message: QueryIncentivizedPacketsForChannelRequest): unknown { @@ -425,11 +429,11 @@ export const QueryIncentivizedPacketsForChannelRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || Long.UZERO).toString()); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryIncentivizedPacketsForChannelRequest { const message = createBaseQueryIncentivizedPacketsForChannelRequest(); if (object.pagination !== undefined && object.pagination !== null) { @@ -438,7 +442,7 @@ export const QueryIncentivizedPacketsForChannelRequest = { message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.queryHeight !== undefined && object.queryHeight !== null) { - message.queryHeight = Long.fromValue(object.queryHeight); + message.queryHeight = BigInt(object.queryHeight.toString()); } return message; }, @@ -451,15 +455,15 @@ function createBaseQueryIncentivizedPacketsForChannelResponse(): QueryIncentiviz export const QueryIncentivizedPacketsForChannelResponse = { encode( message: QueryIncentivizedPacketsForChannelResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.incentivizedPackets) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIncentivizedPacketsForChannelResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketsForChannelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIncentivizedPacketsForChannelResponse(); while (reader.pos < end) { @@ -492,8 +496,8 @@ export const QueryIncentivizedPacketsForChannelResponse = { } return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryIncentivizedPacketsForChannelResponse { const message = createBaseQueryIncentivizedPacketsForChannelResponse(); message.incentivizedPackets = @@ -507,14 +511,14 @@ function createBaseQueryTotalRecvFeesRequest(): QueryTotalRecvFeesRequest { }; } export const QueryTotalRecvFeesRequest = { - encode(message: QueryTotalRecvFeesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalRecvFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalRecvFeesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalRecvFeesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalRecvFeesRequest(); while (reader.pos < end) { @@ -541,9 +545,7 @@ export const QueryTotalRecvFeesRequest = { (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalRecvFeesRequest { + fromPartial(object: Partial): QueryTotalRecvFeesRequest { const message = createBaseQueryTotalRecvFeesRequest(); if (object.packetId !== undefined && object.packetId !== null) { message.packetId = PacketId.fromPartial(object.packetId); @@ -557,14 +559,14 @@ function createBaseQueryTotalRecvFeesResponse(): QueryTotalRecvFeesResponse { }; } export const QueryTotalRecvFeesResponse = { - encode(message: QueryTotalRecvFeesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalRecvFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.recvFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalRecvFeesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalRecvFeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalRecvFeesResponse(); while (reader.pos < end) { @@ -594,9 +596,7 @@ export const QueryTotalRecvFeesResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalRecvFeesResponse { + fromPartial(object: Partial): QueryTotalRecvFeesResponse { const message = createBaseQueryTotalRecvFeesResponse(); message.recvFees = object.recvFees?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -608,14 +608,14 @@ function createBaseQueryTotalAckFeesRequest(): QueryTotalAckFeesRequest { }; } export const QueryTotalAckFeesRequest = { - encode(message: QueryTotalAckFeesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalAckFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalAckFeesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalAckFeesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalAckFeesRequest(); while (reader.pos < end) { @@ -642,9 +642,7 @@ export const QueryTotalAckFeesRequest = { (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalAckFeesRequest { + fromPartial(object: Partial): QueryTotalAckFeesRequest { const message = createBaseQueryTotalAckFeesRequest(); if (object.packetId !== undefined && object.packetId !== null) { message.packetId = PacketId.fromPartial(object.packetId); @@ -658,14 +656,14 @@ function createBaseQueryTotalAckFeesResponse(): QueryTotalAckFeesResponse { }; } export const QueryTotalAckFeesResponse = { - encode(message: QueryTotalAckFeesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalAckFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ackFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalAckFeesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalAckFeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalAckFeesResponse(); while (reader.pos < end) { @@ -695,9 +693,7 @@ export const QueryTotalAckFeesResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalAckFeesResponse { + fromPartial(object: Partial): QueryTotalAckFeesResponse { const message = createBaseQueryTotalAckFeesResponse(); message.ackFees = object.ackFees?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -709,14 +705,14 @@ function createBaseQueryTotalTimeoutFeesRequest(): QueryTotalTimeoutFeesRequest }; } export const QueryTotalTimeoutFeesRequest = { - encode(message: QueryTotalTimeoutFeesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalTimeoutFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalTimeoutFeesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalTimeoutFeesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalTimeoutFeesRequest(); while (reader.pos < end) { @@ -743,9 +739,7 @@ export const QueryTotalTimeoutFeesRequest = { (obj.packetId = message.packetId ? PacketId.toJSON(message.packetId) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalTimeoutFeesRequest { + fromPartial(object: Partial): QueryTotalTimeoutFeesRequest { const message = createBaseQueryTotalTimeoutFeesRequest(); if (object.packetId !== undefined && object.packetId !== null) { message.packetId = PacketId.fromPartial(object.packetId); @@ -759,14 +753,14 @@ function createBaseQueryTotalTimeoutFeesResponse(): QueryTotalTimeoutFeesRespons }; } export const QueryTotalTimeoutFeesResponse = { - encode(message: QueryTotalTimeoutFeesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryTotalTimeoutFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.timeoutFees) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalTimeoutFeesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalTimeoutFeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalTimeoutFeesResponse(); while (reader.pos < end) { @@ -797,9 +791,7 @@ export const QueryTotalTimeoutFeesResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalTimeoutFeesResponse { + fromPartial(object: Partial): QueryTotalTimeoutFeesResponse { const message = createBaseQueryTotalTimeoutFeesResponse(); message.timeoutFees = object.timeoutFees?.map((e) => Coin.fromPartial(e)) || []; return message; @@ -812,7 +804,7 @@ function createBaseQueryPayeeRequest(): QueryPayeeRequest { }; } export const QueryPayeeRequest = { - encode(message: QueryPayeeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPayeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } @@ -821,8 +813,8 @@ export const QueryPayeeRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPayeeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPayeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPayeeRequest(); while (reader.pos < end) { @@ -853,7 +845,7 @@ export const QueryPayeeRequest = { message.relayer !== undefined && (obj.relayer = message.relayer); return obj; }, - fromPartial, I>>(object: I): QueryPayeeRequest { + fromPartial(object: Partial): QueryPayeeRequest { const message = createBaseQueryPayeeRequest(); message.channelId = object.channelId ?? ""; message.relayer = object.relayer ?? ""; @@ -866,14 +858,14 @@ function createBaseQueryPayeeResponse(): QueryPayeeResponse { }; } export const QueryPayeeResponse = { - encode(message: QueryPayeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPayeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.payeeAddress !== "") { writer.uint32(10).string(message.payeeAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPayeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPayeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPayeeResponse(); while (reader.pos < end) { @@ -899,7 +891,7 @@ export const QueryPayeeResponse = { message.payeeAddress !== undefined && (obj.payeeAddress = message.payeeAddress); return obj; }, - fromPartial, I>>(object: I): QueryPayeeResponse { + fromPartial(object: Partial): QueryPayeeResponse { const message = createBaseQueryPayeeResponse(); message.payeeAddress = object.payeeAddress ?? ""; return message; @@ -912,7 +904,7 @@ function createBaseQueryCounterpartyPayeeRequest(): QueryCounterpartyPayeeReques }; } export const QueryCounterpartyPayeeRequest = { - encode(message: QueryCounterpartyPayeeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCounterpartyPayeeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } @@ -921,8 +913,8 @@ export const QueryCounterpartyPayeeRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCounterpartyPayeeRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCounterpartyPayeeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCounterpartyPayeeRequest(); while (reader.pos < end) { @@ -953,9 +945,7 @@ export const QueryCounterpartyPayeeRequest = { message.relayer !== undefined && (obj.relayer = message.relayer); return obj; }, - fromPartial, I>>( - object: I, - ): QueryCounterpartyPayeeRequest { + fromPartial(object: Partial): QueryCounterpartyPayeeRequest { const message = createBaseQueryCounterpartyPayeeRequest(); message.channelId = object.channelId ?? ""; message.relayer = object.relayer ?? ""; @@ -968,14 +958,17 @@ function createBaseQueryCounterpartyPayeeResponse(): QueryCounterpartyPayeeRespo }; } export const QueryCounterpartyPayeeResponse = { - encode(message: QueryCounterpartyPayeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryCounterpartyPayeeResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.counterpartyPayee !== "") { writer.uint32(10).string(message.counterpartyPayee); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCounterpartyPayeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCounterpartyPayeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCounterpartyPayeeResponse(); while (reader.pos < end) { @@ -1001,9 +994,7 @@ export const QueryCounterpartyPayeeResponse = { message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee); return obj; }, - fromPartial, I>>( - object: I, - ): QueryCounterpartyPayeeResponse { + fromPartial(object: Partial): QueryCounterpartyPayeeResponse { const message = createBaseQueryCounterpartyPayeeResponse(); message.counterpartyPayee = object.counterpartyPayee ?? ""; return message; @@ -1012,21 +1003,24 @@ export const QueryCounterpartyPayeeResponse = { function createBaseQueryFeeEnabledChannelsRequest(): QueryFeeEnabledChannelsRequest { return { pagination: PageRequest.fromPartial({}), - queryHeight: Long.UZERO, + queryHeight: BigInt(0), }; } export const QueryFeeEnabledChannelsRequest = { - encode(message: QueryFeeEnabledChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryFeeEnabledChannelsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } - if (!message.queryHeight.isZero()) { + if (message.queryHeight !== BigInt(0)) { writer.uint32(16).uint64(message.queryHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFeeEnabledChannelsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeEnabledChannelsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryFeeEnabledChannelsRequest(); while (reader.pos < end) { @@ -1036,7 +1030,7 @@ export const QueryFeeEnabledChannelsRequest = { message.pagination = PageRequest.decode(reader, reader.uint32()); break; case 2: - message.queryHeight = reader.uint64() as Long; + message.queryHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1048,25 +1042,23 @@ export const QueryFeeEnabledChannelsRequest = { fromJSON(object: any): QueryFeeEnabledChannelsRequest { const obj = createBaseQueryFeeEnabledChannelsRequest(); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); - if (isSet(object.queryHeight)) obj.queryHeight = Long.fromValue(object.queryHeight); + if (isSet(object.queryHeight)) obj.queryHeight = BigInt(object.queryHeight.toString()); return obj; }, toJSON(message: QueryFeeEnabledChannelsRequest): unknown { const obj: any = {}; message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || Long.UZERO).toString()); + message.queryHeight !== undefined && (obj.queryHeight = (message.queryHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryFeeEnabledChannelsRequest { + fromPartial(object: Partial): QueryFeeEnabledChannelsRequest { const message = createBaseQueryFeeEnabledChannelsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); } if (object.queryHeight !== undefined && object.queryHeight !== null) { - message.queryHeight = Long.fromValue(object.queryHeight); + message.queryHeight = BigInt(object.queryHeight.toString()); } return message; }, @@ -1077,14 +1069,17 @@ function createBaseQueryFeeEnabledChannelsResponse(): QueryFeeEnabledChannelsRes }; } export const QueryFeeEnabledChannelsResponse = { - encode(message: QueryFeeEnabledChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryFeeEnabledChannelsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.feeEnabledChannels) { FeeEnabledChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFeeEnabledChannelsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeEnabledChannelsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryFeeEnabledChannelsResponse(); while (reader.pos < end) { @@ -1117,9 +1112,7 @@ export const QueryFeeEnabledChannelsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryFeeEnabledChannelsResponse { + fromPartial(object: Partial): QueryFeeEnabledChannelsResponse { const message = createBaseQueryFeeEnabledChannelsResponse(); message.feeEnabledChannels = object.feeEnabledChannels?.map((e) => FeeEnabledChannel.fromPartial(e)) || []; @@ -1133,7 +1126,7 @@ function createBaseQueryFeeEnabledChannelRequest(): QueryFeeEnabledChannelReques }; } export const QueryFeeEnabledChannelRequest = { - encode(message: QueryFeeEnabledChannelRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryFeeEnabledChannelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -1142,8 +1135,8 @@ export const QueryFeeEnabledChannelRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFeeEnabledChannelRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeEnabledChannelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryFeeEnabledChannelRequest(); while (reader.pos < end) { @@ -1174,9 +1167,7 @@ export const QueryFeeEnabledChannelRequest = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryFeeEnabledChannelRequest { + fromPartial(object: Partial): QueryFeeEnabledChannelRequest { const message = createBaseQueryFeeEnabledChannelRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -1189,14 +1180,17 @@ function createBaseQueryFeeEnabledChannelResponse(): QueryFeeEnabledChannelRespo }; } export const QueryFeeEnabledChannelResponse = { - encode(message: QueryFeeEnabledChannelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryFeeEnabledChannelResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.feeEnabled === true) { writer.uint32(8).bool(message.feeEnabled); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFeeEnabledChannelResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeEnabledChannelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryFeeEnabledChannelResponse(); while (reader.pos < end) { @@ -1222,9 +1216,7 @@ export const QueryFeeEnabledChannelResponse = { message.feeEnabled !== undefined && (obj.feeEnabled = message.feeEnabled); return obj; }, - fromPartial, I>>( - object: I, - ): QueryFeeEnabledChannelResponse { + fromPartial(object: Partial): QueryFeeEnabledChannelResponse { const message = createBaseQueryFeeEnabledChannelResponse(); message.feeEnabled = object.feeEnabled ?? false; return message; @@ -1273,53 +1265,53 @@ export class QueryClientImpl implements Query { IncentivizedPackets(request: QueryIncentivizedPacketsRequest): Promise { const data = QueryIncentivizedPacketsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "IncentivizedPackets", data); - return promise.then((data) => QueryIncentivizedPacketsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryIncentivizedPacketsResponse.decode(new BinaryReader(data))); } IncentivizedPacket(request: QueryIncentivizedPacketRequest): Promise { const data = QueryIncentivizedPacketRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "IncentivizedPacket", data); - return promise.then((data) => QueryIncentivizedPacketResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryIncentivizedPacketResponse.decode(new BinaryReader(data))); } IncentivizedPacketsForChannel( request: QueryIncentivizedPacketsForChannelRequest, ): Promise { const data = QueryIncentivizedPacketsForChannelRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "IncentivizedPacketsForChannel", data); - return promise.then((data) => QueryIncentivizedPacketsForChannelResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryIncentivizedPacketsForChannelResponse.decode(new BinaryReader(data))); } TotalRecvFees(request: QueryTotalRecvFeesRequest): Promise { const data = QueryTotalRecvFeesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "TotalRecvFees", data); - return promise.then((data) => QueryTotalRecvFeesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalRecvFeesResponse.decode(new BinaryReader(data))); } TotalAckFees(request: QueryTotalAckFeesRequest): Promise { const data = QueryTotalAckFeesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "TotalAckFees", data); - return promise.then((data) => QueryTotalAckFeesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalAckFeesResponse.decode(new BinaryReader(data))); } TotalTimeoutFees(request: QueryTotalTimeoutFeesRequest): Promise { const data = QueryTotalTimeoutFeesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "TotalTimeoutFees", data); - return promise.then((data) => QueryTotalTimeoutFeesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalTimeoutFeesResponse.decode(new BinaryReader(data))); } Payee(request: QueryPayeeRequest): Promise { const data = QueryPayeeRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "Payee", data); - return promise.then((data) => QueryPayeeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPayeeResponse.decode(new BinaryReader(data))); } CounterpartyPayee(request: QueryCounterpartyPayeeRequest): Promise { const data = QueryCounterpartyPayeeRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "CounterpartyPayee", data); - return promise.then((data) => QueryCounterpartyPayeeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCounterpartyPayeeResponse.decode(new BinaryReader(data))); } FeeEnabledChannels(request: QueryFeeEnabledChannelsRequest): Promise { const data = QueryFeeEnabledChannelsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "FeeEnabledChannels", data); - return promise.then((data) => QueryFeeEnabledChannelsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryFeeEnabledChannelsResponse.decode(new BinaryReader(data))); } FeeEnabledChannel(request: QueryFeeEnabledChannelRequest): Promise { const data = QueryFeeEnabledChannelRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Query", "FeeEnabledChannel", data); - return promise.then((data) => QueryFeeEnabledChannelResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryFeeEnabledChannelResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/fee/v1/tx.amino.ts b/src/ibc/applications/fee/v1/tx.amino.ts new file mode 100644 index 0000000..743df63 --- /dev/null +++ b/src/ibc/applications/fee/v1/tx.amino.ts @@ -0,0 +1,248 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgRegisterPayee, MsgRegisterCounterpartyPayee, MsgPayPacketFee, MsgPayPacketFeeAsync } from "./tx"; +export interface MsgRegisterPayeeAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRegisterPayee"; + value: { + port_id: string; + channel_id: string; + relayer: string; + payee: string; + }; +} +export interface MsgRegisterCounterpartyPayeeAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRegisterCounterpartyPayee"; + value: { + port_id: string; + channel_id: string; + relayer: string; + counterparty_payee: string; + }; +} +export interface MsgPayPacketFeeAminoType extends AminoMsg { + type: "cosmos-sdk/MsgPayPacketFee"; + value: { + fee: { + recv_fee: { + denom: string; + amount: string; + }[]; + ack_fee: { + denom: string; + amount: string; + }[]; + timeout_fee: { + denom: string; + amount: string; + }[]; + }; + source_port_id: string; + source_channel_id: string; + signer: string; + relayers: string[]; + }; +} +export interface MsgPayPacketFeeAsyncAminoType extends AminoMsg { + type: "cosmos-sdk/MsgPayPacketFeeAsync"; + value: { + packet_id: { + port_id: string; + channel_id: string; + sequence: string; + }; + packet_fee: { + fee: { + recv_fee: { + denom: string; + amount: string; + }[]; + ack_fee: { + denom: string; + amount: string; + }[]; + timeout_fee: { + denom: string; + amount: string; + }[]; + }; + refund_address: string; + relayers: string[]; + }; + }; +} +export const AminoConverter = { + "/ibc.applications.fee.v1.MsgRegisterPayee": { + aminoType: "cosmos-sdk/MsgRegisterPayee", + toAmino: ({ + portId, + channelId, + relayer, + payee, + }: MsgRegisterPayee): MsgRegisterPayeeAminoType["value"] => { + return { + port_id: portId, + channel_id: channelId, + relayer, + payee, + }; + }, + fromAmino: ({ + port_id, + channel_id, + relayer, + payee, + }: MsgRegisterPayeeAminoType["value"]): MsgRegisterPayee => { + return { + portId: port_id, + channelId: channel_id, + relayer, + payee, + }; + }, + }, + "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee": { + aminoType: "cosmos-sdk/MsgRegisterCounterpartyPayee", + toAmino: ({ + portId, + channelId, + relayer, + counterpartyPayee, + }: MsgRegisterCounterpartyPayee): MsgRegisterCounterpartyPayeeAminoType["value"] => { + return { + port_id: portId, + channel_id: channelId, + relayer, + counterparty_payee: counterpartyPayee, + }; + }, + fromAmino: ({ + port_id, + channel_id, + relayer, + counterparty_payee, + }: MsgRegisterCounterpartyPayeeAminoType["value"]): MsgRegisterCounterpartyPayee => { + return { + portId: port_id, + channelId: channel_id, + relayer, + counterpartyPayee: counterparty_payee, + }; + }, + }, + "/ibc.applications.fee.v1.MsgPayPacketFee": { + aminoType: "cosmos-sdk/MsgPayPacketFee", + toAmino: ({ + fee, + sourcePortId, + sourceChannelId, + signer, + relayers, + }: MsgPayPacketFee): MsgPayPacketFeeAminoType["value"] => { + return { + fee: { + recv_fee: fee.recvFee.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + ack_fee: fee.ackFee.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + timeout_fee: fee.timeoutFee.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }, + source_port_id: sourcePortId, + source_channel_id: sourceChannelId, + signer, + relayers, + }; + }, + fromAmino: ({ + fee, + source_port_id, + source_channel_id, + signer, + relayers, + }: MsgPayPacketFeeAminoType["value"]): MsgPayPacketFee => { + return { + fee: { + recvFee: fee.recv_fee.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + ackFee: fee.ack_fee.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + timeoutFee: fee.timeout_fee.map((el1) => ({ + denom: el1.denom, + amount: el1.amount, + })), + }, + sourcePortId: source_port_id, + sourceChannelId: source_channel_id, + signer, + relayers, + }; + }, + }, + "/ibc.applications.fee.v1.MsgPayPacketFeeAsync": { + aminoType: "cosmos-sdk/MsgPayPacketFeeAsync", + toAmino: ({ packetId, packetFee }: MsgPayPacketFeeAsync): MsgPayPacketFeeAsyncAminoType["value"] => { + return { + packet_id: { + port_id: packetId.portId, + channel_id: packetId.channelId, + sequence: packetId.sequence.toString(), + }, + packet_fee: { + fee: { + recv_fee: packetFee.fee.recvFee.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + ack_fee: packetFee.fee.ackFee.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + timeout_fee: packetFee.fee.timeoutFee.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }, + refund_address: packetFee.refundAddress, + relayers: packetFee.relayers, + }, + }; + }, + fromAmino: ({ packet_id, packet_fee }: MsgPayPacketFeeAsyncAminoType["value"]): MsgPayPacketFeeAsync => { + return { + packetId: { + portId: packet_id.port_id, + channelId: packet_id.channel_id, + sequence: BigInt(packet_id.sequence), + }, + packetFee: { + fee: { + recvFee: packet_fee.fee.recv_fee.map((el2) => ({ + denom: el2.denom, + amount: el2.amount, + })), + ackFee: packet_fee.fee.ack_fee.map((el2) => ({ + denom: el2.denom, + amount: el2.amount, + })), + timeoutFee: packet_fee.fee.timeout_fee.map((el2) => ({ + denom: el2.denom, + amount: el2.amount, + })), + }, + refundAddress: packet_fee.refund_address, + relayers: packet_fee.relayers, + }, + }; + }, + }, +}; diff --git a/src/ibc/applications/fee/v1/tx.registry.ts b/src/ibc/applications/fee/v1/tx.registry.ts new file mode 100644 index 0000000..421704f --- /dev/null +++ b/src/ibc/applications/fee/v1/tx.registry.ts @@ -0,0 +1,147 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterPayee, MsgRegisterCounterpartyPayee, MsgPayPacketFee, MsgPayPacketFeeAsync } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/ibc.applications.fee.v1.MsgRegisterPayee", MsgRegisterPayee], + ["/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", MsgRegisterCounterpartyPayee], + ["/ibc.applications.fee.v1.MsgPayPacketFee", MsgPayPacketFee], + ["/ibc.applications.fee.v1.MsgPayPacketFeeAsync", MsgPayPacketFeeAsync], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value: MsgRegisterPayee.encode(value).finish(), + }; + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value: MsgRegisterCounterpartyPayee.encode(value).finish(), + }; + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value: MsgPayPacketFee.encode(value).finish(), + }; + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value: MsgPayPacketFeeAsync.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value, + }; + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value, + }; + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value, + }; + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value, + }; + }, + }, + toJSON: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value: MsgRegisterPayee.toJSON(value), + }; + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value: MsgRegisterCounterpartyPayee.toJSON(value), + }; + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value: MsgPayPacketFee.toJSON(value), + }; + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value: MsgPayPacketFeeAsync.toJSON(value), + }; + }, + }, + fromJSON: { + registerPayee(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value: MsgRegisterPayee.fromJSON(value), + }; + }, + registerCounterpartyPayee(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value: MsgRegisterCounterpartyPayee.fromJSON(value), + }; + }, + payPacketFee(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value: MsgPayPacketFee.fromJSON(value), + }; + }, + payPacketFeeAsync(value: any) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value: MsgPayPacketFeeAsync.fromJSON(value), + }; + }, + }, + fromPartial: { + registerPayee(value: MsgRegisterPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterPayee", + value: MsgRegisterPayee.fromPartial(value), + }; + }, + registerCounterpartyPayee(value: MsgRegisterCounterpartyPayee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee", + value: MsgRegisterCounterpartyPayee.fromPartial(value), + }; + }, + payPacketFee(value: MsgPayPacketFee) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFee", + value: MsgPayPacketFee.fromPartial(value), + }; + }, + payPacketFeeAsync(value: MsgPayPacketFeeAsync) { + return { + typeUrl: "/ibc.applications.fee.v1.MsgPayPacketFeeAsync", + value: MsgPayPacketFeeAsync.fromPartial(value), + }; + }, + }, +}; diff --git a/src/ibc/applications/fee/v1/tx.ts b/src/ibc/applications/fee/v1/tx.ts index c8f577d..f088651 100644 --- a/src/ibc/applications/fee/v1/tx.ts +++ b/src/ibc/applications/fee/v1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Fee, PacketFee } from "./fee"; import { PacketId } from "../../../core/channel/v1/channel"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.applications.fee.v1"; /** MsgRegisterPayee defines the request type for the RegisterPayee rpc */ export interface MsgRegisterPayee { @@ -70,7 +70,7 @@ function createBaseMsgRegisterPayee(): MsgRegisterPayee { }; } export const MsgRegisterPayee = { - encode(message: MsgRegisterPayee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRegisterPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -85,8 +85,8 @@ export const MsgRegisterPayee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterPayee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterPayee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterPayee(); while (reader.pos < end) { @@ -127,7 +127,7 @@ export const MsgRegisterPayee = { message.payee !== undefined && (obj.payee = message.payee); return obj; }, - fromPartial, I>>(object: I): MsgRegisterPayee { + fromPartial(object: Partial): MsgRegisterPayee { const message = createBaseMsgRegisterPayee(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -140,11 +140,11 @@ function createBaseMsgRegisterPayeeResponse(): MsgRegisterPayeeResponse { return {}; } export const MsgRegisterPayeeResponse = { - encode(_: MsgRegisterPayeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRegisterPayeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterPayeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterPayeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterPayeeResponse(); while (reader.pos < end) { @@ -165,7 +165,7 @@ export const MsgRegisterPayeeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgRegisterPayeeResponse { + fromPartial(_: Partial): MsgRegisterPayeeResponse { const message = createBaseMsgRegisterPayeeResponse(); return message; }, @@ -179,7 +179,7 @@ function createBaseMsgRegisterCounterpartyPayee(): MsgRegisterCounterpartyPayee }; } export const MsgRegisterCounterpartyPayee = { - encode(message: MsgRegisterCounterpartyPayee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRegisterCounterpartyPayee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -194,8 +194,8 @@ export const MsgRegisterCounterpartyPayee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterCounterpartyPayee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterCounterpartyPayee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterCounterpartyPayee(); while (reader.pos < end) { @@ -236,9 +236,7 @@ export const MsgRegisterCounterpartyPayee = { message.counterpartyPayee !== undefined && (obj.counterpartyPayee = message.counterpartyPayee); return obj; }, - fromPartial, I>>( - object: I, - ): MsgRegisterCounterpartyPayee { + fromPartial(object: Partial): MsgRegisterCounterpartyPayee { const message = createBaseMsgRegisterCounterpartyPayee(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -251,11 +249,14 @@ function createBaseMsgRegisterCounterpartyPayeeResponse(): MsgRegisterCounterpar return {}; } export const MsgRegisterCounterpartyPayeeResponse = { - encode(_: MsgRegisterCounterpartyPayeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + _: MsgRegisterCounterpartyPayeeResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterCounterpartyPayeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterCounterpartyPayeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterCounterpartyPayeeResponse(); while (reader.pos < end) { @@ -276,9 +277,7 @@ export const MsgRegisterCounterpartyPayeeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgRegisterCounterpartyPayeeResponse { + fromPartial(_: Partial): MsgRegisterCounterpartyPayeeResponse { const message = createBaseMsgRegisterCounterpartyPayeeResponse(); return message; }, @@ -293,7 +292,7 @@ function createBaseMsgPayPacketFee(): MsgPayPacketFee { }; } export const MsgPayPacketFee = { - encode(message: MsgPayPacketFee, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgPayPacketFee, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(10).fork()).ldelim(); } @@ -311,8 +310,8 @@ export const MsgPayPacketFee = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPayPacketFee { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayPacketFee { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPayPacketFee(); while (reader.pos < end) { @@ -362,7 +361,7 @@ export const MsgPayPacketFee = { } return obj; }, - fromPartial, I>>(object: I): MsgPayPacketFee { + fromPartial(object: Partial): MsgPayPacketFee { const message = createBaseMsgPayPacketFee(); if (object.fee !== undefined && object.fee !== null) { message.fee = Fee.fromPartial(object.fee); @@ -378,11 +377,11 @@ function createBaseMsgPayPacketFeeResponse(): MsgPayPacketFeeResponse { return {}; } export const MsgPayPacketFeeResponse = { - encode(_: MsgPayPacketFeeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgPayPacketFeeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPayPacketFeeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayPacketFeeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPayPacketFeeResponse(); while (reader.pos < end) { @@ -403,7 +402,7 @@ export const MsgPayPacketFeeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgPayPacketFeeResponse { + fromPartial(_: Partial): MsgPayPacketFeeResponse { const message = createBaseMsgPayPacketFeeResponse(); return message; }, @@ -415,7 +414,7 @@ function createBaseMsgPayPacketFeeAsync(): MsgPayPacketFeeAsync { }; } export const MsgPayPacketFeeAsync = { - encode(message: MsgPayPacketFeeAsync, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgPayPacketFeeAsync, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packetId !== undefined) { PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim(); } @@ -424,8 +423,8 @@ export const MsgPayPacketFeeAsync = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPayPacketFeeAsync { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayPacketFeeAsync { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPayPacketFeeAsync(); while (reader.pos < end) { @@ -458,7 +457,7 @@ export const MsgPayPacketFeeAsync = { (obj.packetFee = message.packetFee ? PacketFee.toJSON(message.packetFee) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgPayPacketFeeAsync { + fromPartial(object: Partial): MsgPayPacketFeeAsync { const message = createBaseMsgPayPacketFeeAsync(); if (object.packetId !== undefined && object.packetId !== null) { message.packetId = PacketId.fromPartial(object.packetId); @@ -473,11 +472,11 @@ function createBaseMsgPayPacketFeeAsyncResponse(): MsgPayPacketFeeAsyncResponse return {}; } export const MsgPayPacketFeeAsyncResponse = { - encode(_: MsgPayPacketFeeAsyncResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgPayPacketFeeAsyncResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgPayPacketFeeAsyncResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgPayPacketFeeAsyncResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgPayPacketFeeAsyncResponse(); while (reader.pos < end) { @@ -498,9 +497,7 @@ export const MsgPayPacketFeeAsyncResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgPayPacketFeeAsyncResponse { + fromPartial(_: Partial): MsgPayPacketFeeAsyncResponse { const message = createBaseMsgPayPacketFeeAsyncResponse(); return message; }, @@ -552,23 +549,23 @@ export class MsgClientImpl implements Msg { RegisterPayee(request: MsgRegisterPayee): Promise { const data = MsgRegisterPayee.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Msg", "RegisterPayee", data); - return promise.then((data) => MsgRegisterPayeeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRegisterPayeeResponse.decode(new BinaryReader(data))); } RegisterCounterpartyPayee( request: MsgRegisterCounterpartyPayee, ): Promise { const data = MsgRegisterCounterpartyPayee.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Msg", "RegisterCounterpartyPayee", data); - return promise.then((data) => MsgRegisterCounterpartyPayeeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRegisterCounterpartyPayeeResponse.decode(new BinaryReader(data))); } PayPacketFee(request: MsgPayPacketFee): Promise { const data = MsgPayPacketFee.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Msg", "PayPacketFee", data); - return promise.then((data) => MsgPayPacketFeeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgPayPacketFeeResponse.decode(new BinaryReader(data))); } PayPacketFeeAsync(request: MsgPayPacketFeeAsync): Promise { const data = MsgPayPacketFeeAsync.encode(request).finish(); const promise = this.rpc.request("ibc.applications.fee.v1.Msg", "PayPacketFeeAsync", data); - return promise.then((data) => MsgPayPacketFeeAsyncResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgPayPacketFeeAsyncResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/interchain_accounts/controller/v1/controller.ts b/src/ibc/applications/interchain_accounts/controller/v1/controller.ts index ea27448..6ea9a25 100644 --- a/src/ibc/applications/interchain_accounts/controller/v1/controller.ts +++ b/src/ibc/applications/interchain_accounts/controller/v1/controller.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.controller.v1"; /** * Params defines the set of on-chain interchain accounts parameters. @@ -16,14 +16,14 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.controllerEnabled === true) { writer.uint32(8).bool(message.controllerEnabled); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -49,7 +49,7 @@ export const Params = { message.controllerEnabled !== undefined && (obj.controllerEnabled = message.controllerEnabled); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.controllerEnabled = object.controllerEnabled ?? false; return message; diff --git a/src/ibc/applications/interchain_accounts/controller/v1/query.ts b/src/ibc/applications/interchain_accounts/controller/v1/query.ts index 4904b3b..d4afaa5 100644 --- a/src/ibc/applications/interchain_accounts/controller/v1/query.ts +++ b/src/ibc/applications/interchain_accounts/controller/v1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./controller"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet, Rpc } from "../../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.controller.v1"; /** QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. */ export interface QueryInterchainAccountRequest { @@ -26,7 +26,7 @@ function createBaseQueryInterchainAccountRequest(): QueryInterchainAccountReques }; } export const QueryInterchainAccountRequest = { - encode(message: QueryInterchainAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryInterchainAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -35,8 +35,8 @@ export const QueryInterchainAccountRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInterchainAccountRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInterchainAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInterchainAccountRequest(); while (reader.pos < end) { @@ -67,9 +67,7 @@ export const QueryInterchainAccountRequest = { message.connectionId !== undefined && (obj.connectionId = message.connectionId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryInterchainAccountRequest { + fromPartial(object: Partial): QueryInterchainAccountRequest { const message = createBaseQueryInterchainAccountRequest(); message.owner = object.owner ?? ""; message.connectionId = object.connectionId ?? ""; @@ -82,14 +80,17 @@ function createBaseQueryInterchainAccountResponse(): QueryInterchainAccountRespo }; } export const QueryInterchainAccountResponse = { - encode(message: QueryInterchainAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryInterchainAccountResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryInterchainAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryInterchainAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryInterchainAccountResponse(); while (reader.pos < end) { @@ -115,9 +116,7 @@ export const QueryInterchainAccountResponse = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>( - object: I, - ): QueryInterchainAccountResponse { + fromPartial(object: Partial): QueryInterchainAccountResponse { const message = createBaseQueryInterchainAccountResponse(); message.address = object.address ?? ""; return message; @@ -127,11 +126,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -152,7 +151,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -163,14 +162,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -196,7 +195,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -225,7 +224,7 @@ export class QueryClientImpl implements Query { "InterchainAccount", data, ); - return promise.then((data) => QueryInterchainAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryInterchainAccountResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); @@ -234,6 +233,6 @@ export class QueryClientImpl implements Query { "Params", data, ); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts b/src/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts new file mode 100644 index 0000000..62c60ca --- /dev/null +++ b/src/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts @@ -0,0 +1,89 @@ +/* eslint-disable */ +import { typeFromJSON } from "../../v1/packet"; +import { AminoMsg } from "@cosmjs/amino"; +import { MsgRegisterInterchainAccount, MsgSendTx } from "./tx"; +export interface MsgRegisterInterchainAccountAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRegisterInterchainAccount"; + value: { + owner: string; + connection_id: string; + version: string; + }; +} +export interface MsgSendTxAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSendTx"; + value: { + owner: string; + connection_id: string; + packet_data: { + type: number; + data: Uint8Array; + memo: string; + }; + relative_timeout: string; + }; +} +export const AminoConverter = { + "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount": { + aminoType: "cosmos-sdk/MsgRegisterInterchainAccount", + toAmino: ({ + owner, + connectionId, + version, + }: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountAminoType["value"] => { + return { + owner, + connection_id: connectionId, + version, + }; + }, + fromAmino: ({ + owner, + connection_id, + version, + }: MsgRegisterInterchainAccountAminoType["value"]): MsgRegisterInterchainAccount => { + return { + owner, + connectionId: connection_id, + version, + }; + }, + }, + "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx": { + aminoType: "cosmos-sdk/MsgSendTx", + toAmino: ({ + owner, + connectionId, + packetData, + relativeTimeout, + }: MsgSendTx): MsgSendTxAminoType["value"] => { + return { + owner, + connection_id: connectionId, + packet_data: { + type: packetData.type, + data: packetData.data, + memo: packetData.memo, + }, + relative_timeout: relativeTimeout.toString(), + }; + }, + fromAmino: ({ + owner, + connection_id, + packet_data, + relative_timeout, + }: MsgSendTxAminoType["value"]): MsgSendTx => { + return { + owner, + connectionId: connection_id, + packetData: { + type: typeFromJSON(packet_data.type), + data: packet_data.data, + memo: packet_data.memo, + }, + relativeTimeout: BigInt(relative_timeout), + }; + }, + }, +}; diff --git a/src/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts b/src/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts new file mode 100644 index 0000000..9320555 --- /dev/null +++ b/src/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts @@ -0,0 +1,88 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterInterchainAccount, MsgSendTx } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + [ + "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + MsgRegisterInterchainAccount, + ], + ["/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", MsgSendTx], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.encode(value).finish(), + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value, + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value, + }; + }, + }, + toJSON: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.toJSON(value), + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.toJSON(value), + }; + }, + }, + fromJSON: { + registerInterchainAccount(value: any) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.fromJSON(value), + }; + }, + sendTx(value: any) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.fromJSON(value), + }; + }, + }, + fromPartial: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.fromPartial(value), + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.fromPartial(value), + }; + }, + }, +}; diff --git a/src/ibc/applications/interchain_accounts/controller/v1/tx.ts b/src/ibc/applications/interchain_accounts/controller/v1/tx.ts index 2296eae..4209e8c 100644 --- a/src/ibc/applications/interchain_accounts/controller/v1/tx.ts +++ b/src/ibc/applications/interchain_accounts/controller/v1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { InterchainAccountPacketData } from "../../v1/packet"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet, Rpc } from "../../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.controller.v1"; /** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ export interface MsgRegisterInterchainAccount { @@ -23,11 +23,11 @@ export interface MsgSendTx { * Relative timeout timestamp provided will be added to the current block time during transaction execution. * The timeout timestamp must be non-zero. */ - relativeTimeout: Long; + relativeTimeout: bigint; } /** MsgSendTxResponse defines the response for MsgSendTx */ export interface MsgSendTxResponse { - sequence: Long; + sequence: bigint; } function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount { return { @@ -37,7 +37,7 @@ function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount }; } export const MsgRegisterInterchainAccount = { - encode(message: MsgRegisterInterchainAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRegisterInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -49,8 +49,8 @@ export const MsgRegisterInterchainAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterInterchainAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterInterchainAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterInterchainAccount(); while (reader.pos < end) { @@ -86,9 +86,7 @@ export const MsgRegisterInterchainAccount = { message.version !== undefined && (obj.version = message.version); return obj; }, - fromPartial, I>>( - object: I, - ): MsgRegisterInterchainAccount { + fromPartial(object: Partial): MsgRegisterInterchainAccount { const message = createBaseMsgRegisterInterchainAccount(); message.owner = object.owner ?? ""; message.connectionId = object.connectionId ?? ""; @@ -105,8 +103,8 @@ function createBaseMsgRegisterInterchainAccountResponse(): MsgRegisterInterchain export const MsgRegisterInterchainAccountResponse = { encode( message: MsgRegisterInterchainAccountResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } @@ -115,8 +113,8 @@ export const MsgRegisterInterchainAccountResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterInterchainAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterInterchainAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterInterchainAccountResponse(); while (reader.pos < end) { @@ -147,9 +145,7 @@ export const MsgRegisterInterchainAccountResponse = { message.portId !== undefined && (obj.portId = message.portId); return obj; }, - fromPartial, I>>( - object: I, - ): MsgRegisterInterchainAccountResponse { + fromPartial(object: Partial): MsgRegisterInterchainAccountResponse { const message = createBaseMsgRegisterInterchainAccountResponse(); message.channelId = object.channelId ?? ""; message.portId = object.portId ?? ""; @@ -161,11 +157,11 @@ function createBaseMsgSendTx(): MsgSendTx { owner: "", connectionId: "", packetData: InterchainAccountPacketData.fromPartial({}), - relativeTimeout: Long.UZERO, + relativeTimeout: BigInt(0), }; } export const MsgSendTx = { - encode(message: MsgSendTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSendTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.owner !== "") { writer.uint32(10).string(message.owner); } @@ -175,13 +171,13 @@ export const MsgSendTx = { if (message.packetData !== undefined) { InterchainAccountPacketData.encode(message.packetData, writer.uint32(26).fork()).ldelim(); } - if (!message.relativeTimeout.isZero()) { + if (message.relativeTimeout !== BigInt(0)) { writer.uint32(32).uint64(message.relativeTimeout); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendTx(); while (reader.pos < end) { @@ -197,7 +193,7 @@ export const MsgSendTx = { message.packetData = InterchainAccountPacketData.decode(reader, reader.uint32()); break; case 4: - message.relativeTimeout = reader.uint64() as Long; + message.relativeTimeout = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -211,7 +207,7 @@ export const MsgSendTx = { if (isSet(object.owner)) obj.owner = String(object.owner); if (isSet(object.connectionId)) obj.connectionId = String(object.connectionId); if (isSet(object.packetData)) obj.packetData = InterchainAccountPacketData.fromJSON(object.packetData); - if (isSet(object.relativeTimeout)) obj.relativeTimeout = Long.fromValue(object.relativeTimeout); + if (isSet(object.relativeTimeout)) obj.relativeTimeout = BigInt(object.relativeTimeout.toString()); return obj; }, toJSON(message: MsgSendTx): unknown { @@ -223,10 +219,10 @@ export const MsgSendTx = { ? InterchainAccountPacketData.toJSON(message.packetData) : undefined); message.relativeTimeout !== undefined && - (obj.relativeTimeout = (message.relativeTimeout || Long.UZERO).toString()); + (obj.relativeTimeout = (message.relativeTimeout || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgSendTx { + fromPartial(object: Partial): MsgSendTx { const message = createBaseMsgSendTx(); message.owner = object.owner ?? ""; message.connectionId = object.connectionId ?? ""; @@ -234,32 +230,32 @@ export const MsgSendTx = { message.packetData = InterchainAccountPacketData.fromPartial(object.packetData); } if (object.relativeTimeout !== undefined && object.relativeTimeout !== null) { - message.relativeTimeout = Long.fromValue(object.relativeTimeout); + message.relativeTimeout = BigInt(object.relativeTimeout.toString()); } return message; }, }; function createBaseMsgSendTxResponse(): MsgSendTxResponse { return { - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const MsgSendTxResponse = { - encode(message: MsgSendTxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: MsgSendTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSendTxResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSendTxResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -270,18 +266,18 @@ export const MsgSendTxResponse = { }, fromJSON(object: any): MsgSendTxResponse { const obj = createBaseMsgSendTxResponse(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: MsgSendTxResponse): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgSendTxResponse { + fromPartial(object: Partial): MsgSendTxResponse { const message = createBaseMsgSendTxResponse(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -311,7 +307,7 @@ export class MsgClientImpl implements Msg { "RegisterInterchainAccount", data, ); - return promise.then((data) => MsgRegisterInterchainAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRegisterInterchainAccountResponse.decode(new BinaryReader(data))); } SendTx(request: MsgSendTx): Promise { const data = MsgSendTx.encode(request).finish(); @@ -320,6 +316,6 @@ export class MsgClientImpl implements Msg { "SendTx", data, ); - return promise.then((data) => MsgSendTxResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSendTxResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/interchain_accounts/genesis/v1/genesis.ts b/src/ibc/applications/interchain_accounts/genesis/v1/genesis.ts index bc30c8d..e0e1350 100644 --- a/src/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +++ b/src/ibc/applications/interchain_accounts/genesis/v1/genesis.ts @@ -1,8 +1,9 @@ +//@ts-nocheck /* eslint-disable */ import { Params as Params1 } from "../../controller/v1/controller"; import { Params as Params2 } from "../../host/v1/host"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.genesis.v1"; /** GenesisState defines the interchain accounts genesis state */ export interface GenesisState { @@ -46,7 +47,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.controllerGenesisState !== undefined) { ControllerGenesisState.encode(message.controllerGenesisState, writer.uint32(10).fork()).ldelim(); } @@ -55,8 +56,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -95,7 +96,7 @@ export const GenesisState = { : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.controllerGenesisState !== undefined && object.controllerGenesisState !== null) { message.controllerGenesisState = ControllerGenesisState.fromPartial(object.controllerGenesisState); @@ -115,7 +116,7 @@ function createBaseControllerGenesisState(): ControllerGenesisState { }; } export const ControllerGenesisState = { - encode(message: ControllerGenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ControllerGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.activeChannels) { ActiveChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -130,8 +131,8 @@ export const ControllerGenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ControllerGenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ControllerGenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseControllerGenesisState(); while (reader.pos < end) { @@ -191,7 +192,7 @@ export const ControllerGenesisState = { (obj.params = message.params ? Params1.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): ControllerGenesisState { + fromPartial(object: Partial): ControllerGenesisState { const message = createBaseControllerGenesisState(); message.activeChannels = object.activeChannels?.map((e) => ActiveChannel.fromPartial(e)) || []; message.interchainAccounts = @@ -212,7 +213,7 @@ function createBaseHostGenesisState(): HostGenesisState { }; } export const HostGenesisState = { - encode(message: HostGenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.activeChannels) { ActiveChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -227,8 +228,8 @@ export const HostGenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostGenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostGenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostGenesisState(); while (reader.pos < end) { @@ -284,7 +285,7 @@ export const HostGenesisState = { (obj.params = message.params ? Params2.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): HostGenesisState { + fromPartial(object: Partial): HostGenesisState { const message = createBaseHostGenesisState(); message.activeChannels = object.activeChannels?.map((e) => ActiveChannel.fromPartial(e)) || []; message.interchainAccounts = @@ -305,7 +306,7 @@ function createBaseActiveChannel(): ActiveChannel { }; } export const ActiveChannel = { - encode(message: ActiveChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ActiveChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } @@ -320,8 +321,8 @@ export const ActiveChannel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ActiveChannel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ActiveChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseActiveChannel(); while (reader.pos < end) { @@ -362,7 +363,7 @@ export const ActiveChannel = { message.isMiddlewareEnabled !== undefined && (obj.isMiddlewareEnabled = message.isMiddlewareEnabled); return obj; }, - fromPartial, I>>(object: I): ActiveChannel { + fromPartial(object: Partial): ActiveChannel { const message = createBaseActiveChannel(); message.connectionId = object.connectionId ?? ""; message.portId = object.portId ?? ""; @@ -379,7 +380,7 @@ function createBaseRegisteredInterchainAccount(): RegisteredInterchainAccount { }; } export const RegisteredInterchainAccount = { - encode(message: RegisteredInterchainAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RegisteredInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } @@ -391,8 +392,8 @@ export const RegisteredInterchainAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RegisteredInterchainAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredInterchainAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRegisteredInterchainAccount(); while (reader.pos < end) { @@ -428,9 +429,7 @@ export const RegisteredInterchainAccount = { message.accountAddress !== undefined && (obj.accountAddress = message.accountAddress); return obj; }, - fromPartial, I>>( - object: I, - ): RegisteredInterchainAccount { + fromPartial(object: Partial): RegisteredInterchainAccount { const message = createBaseRegisteredInterchainAccount(); message.connectionId = object.connectionId ?? ""; message.portId = object.portId ?? ""; diff --git a/src/ibc/applications/interchain_accounts/host/v1/host.ts b/src/ibc/applications/interchain_accounts/host/v1/host.ts index 36ca6a3..4517aab 100644 --- a/src/ibc/applications/interchain_accounts/host/v1/host.ts +++ b/src/ibc/applications/interchain_accounts/host/v1/host.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet } from "../../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.host.v1"; /** * Params defines the set of on-chain interchain accounts parameters. @@ -19,7 +19,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hostEnabled === true) { writer.uint32(8).bool(message.hostEnabled); } @@ -28,8 +28,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -65,7 +65,7 @@ export const Params = { } return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.hostEnabled = object.hostEnabled ?? false; message.allowMessages = object.allowMessages?.map((e) => e) || []; diff --git a/src/ibc/applications/interchain_accounts/host/v1/query.ts b/src/ibc/applications/interchain_accounts/host/v1/query.ts index 73a57dd..d845298 100644 --- a/src/ibc/applications/interchain_accounts/host/v1/query.ts +++ b/src/ibc/applications/interchain_accounts/host/v1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./host"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { isSet, Rpc } from "../../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.host.v1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -14,11 +14,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -39,7 +39,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -50,14 +50,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -83,7 +83,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -105,6 +105,6 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/interchain_accounts/v1/account.ts b/src/ibc/applications/interchain_accounts/v1/account.ts index a376875..0b8c55a 100644 --- a/src/ibc/applications/interchain_accounts/v1/account.ts +++ b/src/ibc/applications/interchain_accounts/v1/account.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { BaseAccount } from "../../../../cosmos/auth/v1beta1/auth"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.v1"; /** An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain */ export interface InterchainAccount { @@ -15,7 +15,7 @@ function createBaseInterchainAccount(): InterchainAccount { }; } export const InterchainAccount = { - encode(message: InterchainAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.baseAccount !== undefined) { BaseAccount.encode(message.baseAccount, writer.uint32(10).fork()).ldelim(); } @@ -24,8 +24,8 @@ export const InterchainAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterchainAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterchainAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterchainAccount(); while (reader.pos < end) { @@ -57,7 +57,7 @@ export const InterchainAccount = { message.accountOwner !== undefined && (obj.accountOwner = message.accountOwner); return obj; }, - fromPartial, I>>(object: I): InterchainAccount { + fromPartial(object: Partial): InterchainAccount { const message = createBaseInterchainAccount(); if (object.baseAccount !== undefined && object.baseAccount !== null) { message.baseAccount = BaseAccount.fromPartial(object.baseAccount); diff --git a/src/ibc/applications/interchain_accounts/v1/metadata.ts b/src/ibc/applications/interchain_accounts/v1/metadata.ts index 97f3559..4061ad5 100644 --- a/src/ibc/applications/interchain_accounts/v1/metadata.ts +++ b/src/ibc/applications/interchain_accounts/v1/metadata.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.v1"; /** * Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring @@ -34,7 +34,7 @@ function createBaseMetadata(): Metadata { }; } export const Metadata = { - encode(message: Metadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); } @@ -55,8 +55,8 @@ export const Metadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Metadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMetadata(); while (reader.pos < end) { @@ -109,7 +109,7 @@ export const Metadata = { message.txType !== undefined && (obj.txType = message.txType); return obj; }, - fromPartial, I>>(object: I): Metadata { + fromPartial(object: Partial): Metadata { const message = createBaseMetadata(); message.version = object.version ?? ""; message.controllerConnectionId = object.controllerConnectionId ?? ""; diff --git a/src/ibc/applications/interchain_accounts/v1/packet.ts b/src/ibc/applications/interchain_accounts/v1/packet.ts index d0eb4eb..bc82720 100644 --- a/src/ibc/applications/interchain_accounts/v1/packet.ts +++ b/src/ibc/applications/interchain_accounts/v1/packet.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "ibc.applications.interchain_accounts.v1"; /** * Type defines a classification of message issued from a controller chain to its associated interchain accounts @@ -57,7 +57,7 @@ function createBaseInterchainAccountPacketData(): InterchainAccountPacketData { }; } export const InterchainAccountPacketData = { - encode(message: InterchainAccountPacketData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: InterchainAccountPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -69,8 +69,8 @@ export const InterchainAccountPacketData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): InterchainAccountPacketData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): InterchainAccountPacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseInterchainAccountPacketData(); while (reader.pos < end) { @@ -107,9 +107,7 @@ export const InterchainAccountPacketData = { message.memo !== undefined && (obj.memo = message.memo); return obj; }, - fromPartial, I>>( - object: I, - ): InterchainAccountPacketData { + fromPartial(object: Partial): InterchainAccountPacketData { const message = createBaseInterchainAccountPacketData(); message.type = object.type ?? 0; message.data = object.data ?? new Uint8Array(); @@ -123,14 +121,14 @@ function createBaseCosmosTx(): CosmosTx { }; } export const CosmosTx = { - encode(message: CosmosTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CosmosTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.messages) { Any.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CosmosTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CosmosTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCosmosTx(); while (reader.pos < end) { @@ -160,7 +158,7 @@ export const CosmosTx = { } return obj; }, - fromPartial, I>>(object: I): CosmosTx { + fromPartial(object: Partial): CosmosTx { const message = createBaseCosmosTx(); message.messages = object.messages?.map((e) => Any.fromPartial(e)) || []; return message; diff --git a/src/ibc/applications/transfer/v1/authz.ts b/src/ibc/applications/transfer/v1/authz.ts index 2329243..0900e4d 100644 --- a/src/ibc/applications/transfer/v1/authz.ts +++ b/src/ibc/applications/transfer/v1/authz.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Coin } from "../../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.transfer.v1"; /** Allocation defines the spend limit for a particular port and channel */ export interface Allocation { @@ -31,7 +31,7 @@ function createBaseAllocation(): Allocation { }; } export const Allocation = { - encode(message: Allocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Allocation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sourcePort !== "") { writer.uint32(10).string(message.sourcePort); } @@ -46,8 +46,8 @@ export const Allocation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Allocation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Allocation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllocation(); while (reader.pos < end) { @@ -97,7 +97,7 @@ export const Allocation = { } return obj; }, - fromPartial, I>>(object: I): Allocation { + fromPartial(object: Partial): Allocation { const message = createBaseAllocation(); message.sourcePort = object.sourcePort ?? ""; message.sourceChannel = object.sourceChannel ?? ""; @@ -112,14 +112,14 @@ function createBaseTransferAuthorization(): TransferAuthorization { }; } export const TransferAuthorization = { - encode(message: TransferAuthorization, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TransferAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allocations) { Allocation.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TransferAuthorization { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TransferAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTransferAuthorization(); while (reader.pos < end) { @@ -150,7 +150,7 @@ export const TransferAuthorization = { } return obj; }, - fromPartial, I>>(object: I): TransferAuthorization { + fromPartial(object: Partial): TransferAuthorization { const message = createBaseTransferAuthorization(); message.allocations = object.allocations?.map((e) => Allocation.fromPartial(e)) || []; return message; diff --git a/src/ibc/applications/transfer/v1/genesis.ts b/src/ibc/applications/transfer/v1/genesis.ts index 7b2ab7e..bb8d087 100644 --- a/src/ibc/applications/transfer/v1/genesis.ts +++ b/src/ibc/applications/transfer/v1/genesis.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { DenomTrace, Params } from "./transfer"; import { Coin } from "../../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.transfer.v1"; /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisState { @@ -24,7 +24,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -39,8 +39,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -91,7 +91,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.portId = object.portId ?? ""; message.denomTraces = object.denomTraces?.map((e) => DenomTrace.fromPartial(e)) || []; diff --git a/src/ibc/applications/transfer/v1/query.ts b/src/ibc/applications/transfer/v1/query.ts index 5873c4d..cde9c08 100644 --- a/src/ibc/applications/transfer/v1/query.ts +++ b/src/ibc/applications/transfer/v1/query.ts @@ -2,8 +2,8 @@ import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; import { DenomTrace, Params } from "./transfer"; import { Coin } from "../../../../cosmos/base/v1beta1/coin"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.applications.transfer.v1"; /** * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -88,14 +88,14 @@ function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { }; } export const QueryDenomTraceRequest = { - encode(message: QueryDenomTraceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomTraceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTraceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTraceRequest(); while (reader.pos < end) { @@ -121,7 +121,7 @@ export const QueryDenomTraceRequest = { message.hash !== undefined && (obj.hash = message.hash); return obj; }, - fromPartial, I>>(object: I): QueryDenomTraceRequest { + fromPartial(object: Partial): QueryDenomTraceRequest { const message = createBaseQueryDenomTraceRequest(); message.hash = object.hash ?? ""; return message; @@ -133,14 +133,14 @@ function createBaseQueryDenomTraceResponse(): QueryDenomTraceResponse { }; } export const QueryDenomTraceResponse = { - encode(message: QueryDenomTraceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomTraceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denomTrace !== undefined) { DenomTrace.encode(message.denomTrace, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTraceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTraceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTraceResponse(); while (reader.pos < end) { @@ -167,7 +167,7 @@ export const QueryDenomTraceResponse = { (obj.denomTrace = message.denomTrace ? DenomTrace.toJSON(message.denomTrace) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDenomTraceResponse { + fromPartial(object: Partial): QueryDenomTraceResponse { const message = createBaseQueryDenomTraceResponse(); if (object.denomTrace !== undefined && object.denomTrace !== null) { message.denomTrace = DenomTrace.fromPartial(object.denomTrace); @@ -181,14 +181,14 @@ function createBaseQueryDenomTracesRequest(): QueryDenomTracesRequest { }; } export const QueryDenomTracesRequest = { - encode(message: QueryDenomTracesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomTracesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTracesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTracesRequest(); while (reader.pos < end) { @@ -215,7 +215,7 @@ export const QueryDenomTracesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryDenomTracesRequest { + fromPartial(object: Partial): QueryDenomTracesRequest { const message = createBaseQueryDenomTracesRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -230,7 +230,7 @@ function createBaseQueryDenomTracesResponse(): QueryDenomTracesResponse { }; } export const QueryDenomTracesResponse = { - encode(message: QueryDenomTracesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomTracesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.denomTraces) { DenomTrace.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -239,8 +239,8 @@ export const QueryDenomTracesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomTracesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomTracesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomTracesResponse(); while (reader.pos < end) { @@ -277,9 +277,7 @@ export const QueryDenomTracesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDenomTracesResponse { + fromPartial(object: Partial): QueryDenomTracesResponse { const message = createBaseQueryDenomTracesResponse(); message.denomTraces = object.denomTraces?.map((e) => DenomTrace.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -292,11 +290,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -317,7 +315,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -328,14 +326,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -361,7 +359,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -375,14 +373,14 @@ function createBaseQueryDenomHashRequest(): QueryDenomHashRequest { }; } export const QueryDenomHashRequest = { - encode(message: QueryDenomHashRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomHashRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.trace !== "") { writer.uint32(10).string(message.trace); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomHashRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomHashRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomHashRequest(); while (reader.pos < end) { @@ -408,7 +406,7 @@ export const QueryDenomHashRequest = { message.trace !== undefined && (obj.trace = message.trace); return obj; }, - fromPartial, I>>(object: I): QueryDenomHashRequest { + fromPartial(object: Partial): QueryDenomHashRequest { const message = createBaseQueryDenomHashRequest(); message.trace = object.trace ?? ""; return message; @@ -420,14 +418,14 @@ function createBaseQueryDenomHashResponse(): QueryDenomHashResponse { }; } export const QueryDenomHashResponse = { - encode(message: QueryDenomHashResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDenomHashResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash !== "") { writer.uint32(10).string(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomHashResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomHashResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDenomHashResponse(); while (reader.pos < end) { @@ -453,7 +451,7 @@ export const QueryDenomHashResponse = { message.hash !== undefined && (obj.hash = message.hash); return obj; }, - fromPartial, I>>(object: I): QueryDenomHashResponse { + fromPartial(object: Partial): QueryDenomHashResponse { const message = createBaseQueryDenomHashResponse(); message.hash = object.hash ?? ""; return message; @@ -466,7 +464,7 @@ function createBaseQueryEscrowAddressRequest(): QueryEscrowAddressRequest { }; } export const QueryEscrowAddressRequest = { - encode(message: QueryEscrowAddressRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryEscrowAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -475,8 +473,8 @@ export const QueryEscrowAddressRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEscrowAddressRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEscrowAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEscrowAddressRequest(); while (reader.pos < end) { @@ -507,9 +505,7 @@ export const QueryEscrowAddressRequest = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryEscrowAddressRequest { + fromPartial(object: Partial): QueryEscrowAddressRequest { const message = createBaseQueryEscrowAddressRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -522,14 +518,14 @@ function createBaseQueryEscrowAddressResponse(): QueryEscrowAddressResponse { }; } export const QueryEscrowAddressResponse = { - encode(message: QueryEscrowAddressResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryEscrowAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.escrowAddress !== "") { writer.uint32(10).string(message.escrowAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEscrowAddressResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEscrowAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEscrowAddressResponse(); while (reader.pos < end) { @@ -555,9 +551,7 @@ export const QueryEscrowAddressResponse = { message.escrowAddress !== undefined && (obj.escrowAddress = message.escrowAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryEscrowAddressResponse { + fromPartial(object: Partial): QueryEscrowAddressResponse { const message = createBaseQueryEscrowAddressResponse(); message.escrowAddress = object.escrowAddress ?? ""; return message; @@ -569,14 +563,17 @@ function createBaseQueryTotalEscrowForDenomRequest(): QueryTotalEscrowForDenomRe }; } export const QueryTotalEscrowForDenomRequest = { - encode(message: QueryTotalEscrowForDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalEscrowForDenomRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalEscrowForDenomRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalEscrowForDenomRequest(); while (reader.pos < end) { @@ -602,9 +599,7 @@ export const QueryTotalEscrowForDenomRequest = { message.denom !== undefined && (obj.denom = message.denom); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalEscrowForDenomRequest { + fromPartial(object: Partial): QueryTotalEscrowForDenomRequest { const message = createBaseQueryTotalEscrowForDenomRequest(); message.denom = object.denom ?? ""; return message; @@ -616,14 +611,17 @@ function createBaseQueryTotalEscrowForDenomResponse(): QueryTotalEscrowForDenomR }; } export const QueryTotalEscrowForDenomResponse = { - encode(message: QueryTotalEscrowForDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryTotalEscrowForDenomResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalEscrowForDenomResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryTotalEscrowForDenomResponse(); while (reader.pos < end) { @@ -649,9 +647,7 @@ export const QueryTotalEscrowForDenomResponse = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryTotalEscrowForDenomResponse { + fromPartial(object: Partial): QueryTotalEscrowForDenomResponse { const message = createBaseQueryTotalEscrowForDenomResponse(); if (object.amount !== undefined && object.amount !== null) { message.amount = Coin.fromPartial(object.amount); @@ -688,7 +684,7 @@ export class QueryClientImpl implements Query { DenomTrace(request: QueryDenomTraceRequest): Promise { const data = QueryDenomTraceRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTrace", data); - return promise.then((data) => QueryDenomTraceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDenomTraceResponse.decode(new BinaryReader(data))); } DenomTraces( request: QueryDenomTracesRequest = { @@ -697,26 +693,26 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryDenomTracesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomTraces", data); - return promise.then((data) => QueryDenomTracesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDenomTracesResponse.decode(new BinaryReader(data))); } Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } DenomHash(request: QueryDenomHashRequest): Promise { const data = QueryDenomHashRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "DenomHash", data); - return promise.then((data) => QueryDenomHashResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDenomHashResponse.decode(new BinaryReader(data))); } EscrowAddress(request: QueryEscrowAddressRequest): Promise { const data = QueryEscrowAddressRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "EscrowAddress", data); - return promise.then((data) => QueryEscrowAddressResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryEscrowAddressResponse.decode(new BinaryReader(data))); } TotalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { const data = QueryTotalEscrowForDenomRequest.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "TotalEscrowForDenom", data); - return promise.then((data) => QueryTotalEscrowForDenomResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryTotalEscrowForDenomResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/transfer/v1/transfer.ts b/src/ibc/applications/transfer/v1/transfer.ts index 327d83f..42646bb 100644 --- a/src/ibc/applications/transfer/v1/transfer.ts +++ b/src/ibc/applications/transfer/v1/transfer.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.transfer.v1"; /** * DenomTrace contains the base denomination for ICS20 fungible tokens and the @@ -40,7 +40,7 @@ function createBaseDenomTrace(): DenomTrace { }; } export const DenomTrace = { - encode(message: DenomTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DenomTrace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.path !== "") { writer.uint32(10).string(message.path); } @@ -49,8 +49,8 @@ export const DenomTrace = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DenomTrace { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DenomTrace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDenomTrace(); while (reader.pos < end) { @@ -81,7 +81,7 @@ export const DenomTrace = { message.baseDenom !== undefined && (obj.baseDenom = message.baseDenom); return obj; }, - fromPartial, I>>(object: I): DenomTrace { + fromPartial(object: Partial): DenomTrace { const message = createBaseDenomTrace(); message.path = object.path ?? ""; message.baseDenom = object.baseDenom ?? ""; @@ -95,7 +95,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sendEnabled === true) { writer.uint32(8).bool(message.sendEnabled); } @@ -104,8 +104,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -136,7 +136,7 @@ export const Params = { message.receiveEnabled !== undefined && (obj.receiveEnabled = message.receiveEnabled); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.sendEnabled = object.sendEnabled ?? false; message.receiveEnabled = object.receiveEnabled ?? false; diff --git a/src/ibc/applications/transfer/v1/tx.amino.ts b/src/ibc/applications/transfer/v1/tx.amino.ts new file mode 100644 index 0000000..0d62c76 --- /dev/null +++ b/src/ibc/applications/transfer/v1/tx.amino.ts @@ -0,0 +1,83 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { AminoHeight, omitDefault } from "../../../../helpers"; +import { MsgTransfer } from "./tx"; +export interface MsgTransferAminoType extends AminoMsg { + type: "cosmos-sdk/MsgTransfer"; + value: { + source_port: string; + source_channel: string; + token: { + denom: string; + amount: string; + }; + sender: string; + receiver: string; + timeout_height: AminoHeight; + timeout_timestamp: string; + memo: string; + }; +} +export const AminoConverter = { + "/ibc.applications.transfer.v1.MsgTransfer": { + aminoType: "cosmos-sdk/MsgTransfer", + toAmino: ({ + sourcePort, + sourceChannel, + token, + sender, + receiver, + timeoutHeight, + timeoutTimestamp, + memo, + }: MsgTransfer): MsgTransferAminoType["value"] => { + return { + source_port: sourcePort, + source_channel: sourceChannel, + token: { + denom: token.denom, + amount: token.amount, + }, + sender, + receiver, + timeout_height: timeoutHeight + ? { + revision_height: omitDefault(timeoutHeight.revisionHeight)?.toString(), + revision_number: omitDefault(timeoutHeight.revisionNumber)?.toString(), + } + : {}, + timeout_timestamp: timeoutTimestamp.toString(), + memo, + }; + }, + fromAmino: ({ + source_port, + source_channel, + token, + sender, + receiver, + timeout_height, + timeout_timestamp, + memo, + }: MsgTransferAminoType["value"]): MsgTransfer => { + return { + sourcePort: source_port, + sourceChannel: source_channel, + token: { + denom: token.denom, + amount: token.amount, + }, + sender, + receiver, + timeoutHeight: timeout_height + ? { + revisionHeight: BigInt(timeout_height.revision_height || "0"), + revisionNumber: BigInt(timeout_height.revision_number || "0"), + } + : undefined, + timeoutTimestamp: BigInt(timeout_timestamp), + memo, + }; + }, + }, +}; diff --git a/src/ibc/applications/transfer/v1/tx.registry.ts b/src/ibc/applications/transfer/v1/tx.registry.ts new file mode 100644 index 0000000..1b7b41b --- /dev/null +++ b/src/ibc/applications/transfer/v1/tx.registry.ts @@ -0,0 +1,54 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value, + }; + }, + }, + toJSON: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.toJSON(value), + }; + }, + }, + fromJSON: { + transfer(value: any) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.fromJSON(value), + }; + }, + }, + fromPartial: { + transfer(value: MsgTransfer) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", + value: MsgTransfer.fromPartial(value), + }; + }, + }, +}; diff --git a/src/ibc/applications/transfer/v1/tx.ts b/src/ibc/applications/transfer/v1/tx.ts index efbf8fd..08e8421 100644 --- a/src/ibc/applications/transfer/v1/tx.ts +++ b/src/ibc/applications/transfer/v1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../../../cosmos/base/v1beta1/coin"; import { Height } from "../../../core/client/v1/client"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.applications.transfer.v1"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between @@ -29,14 +29,14 @@ export interface MsgTransfer { * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. */ - timeoutTimestamp: Long; + timeoutTimestamp: bigint; /** optional memo */ memo: string; } /** MsgTransferResponse defines the Msg/Transfer response type. */ export interface MsgTransferResponse { /** sequence number of the transfer packet sent */ - sequence: Long; + sequence: bigint; } function createBaseMsgTransfer(): MsgTransfer { return { @@ -46,12 +46,12 @@ function createBaseMsgTransfer(): MsgTransfer { sender: "", receiver: "", timeoutHeight: Height.fromPartial({}), - timeoutTimestamp: Long.UZERO, + timeoutTimestamp: BigInt(0), memo: "", }; } export const MsgTransfer = { - encode(message: MsgTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sourcePort !== "") { writer.uint32(10).string(message.sourcePort); } @@ -70,7 +70,7 @@ export const MsgTransfer = { if (message.timeoutHeight !== undefined) { Height.encode(message.timeoutHeight, writer.uint32(50).fork()).ldelim(); } - if (!message.timeoutTimestamp.isZero()) { + if (message.timeoutTimestamp !== BigInt(0)) { writer.uint32(56).uint64(message.timeoutTimestamp); } if (message.memo !== "") { @@ -78,8 +78,8 @@ export const MsgTransfer = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransfer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTransfer(); while (reader.pos < end) { @@ -104,7 +104,7 @@ export const MsgTransfer = { message.timeoutHeight = Height.decode(reader, reader.uint32()); break; case 7: - message.timeoutTimestamp = reader.uint64() as Long; + message.timeoutTimestamp = reader.uint64(); break; case 8: message.memo = reader.string(); @@ -124,7 +124,7 @@ export const MsgTransfer = { if (isSet(object.sender)) obj.sender = String(object.sender); if (isSet(object.receiver)) obj.receiver = String(object.receiver); if (isSet(object.timeoutHeight)) obj.timeoutHeight = Height.fromJSON(object.timeoutHeight); - if (isSet(object.timeoutTimestamp)) obj.timeoutTimestamp = Long.fromValue(object.timeoutTimestamp); + if (isSet(object.timeoutTimestamp)) obj.timeoutTimestamp = BigInt(object.timeoutTimestamp.toString()); if (isSet(object.memo)) obj.memo = String(object.memo); return obj; }, @@ -138,11 +138,11 @@ export const MsgTransfer = { message.timeoutHeight !== undefined && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); message.timeoutTimestamp !== undefined && - (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); message.memo !== undefined && (obj.memo = message.memo); return obj; }, - fromPartial, I>>(object: I): MsgTransfer { + fromPartial(object: Partial): MsgTransfer { const message = createBaseMsgTransfer(); message.sourcePort = object.sourcePort ?? ""; message.sourceChannel = object.sourceChannel ?? ""; @@ -155,7 +155,7 @@ export const MsgTransfer = { message.timeoutHeight = Height.fromPartial(object.timeoutHeight); } if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { - message.timeoutTimestamp = Long.fromValue(object.timeoutTimestamp); + message.timeoutTimestamp = BigInt(object.timeoutTimestamp.toString()); } message.memo = object.memo ?? ""; return message; @@ -163,25 +163,25 @@ export const MsgTransfer = { }; function createBaseMsgTransferResponse(): MsgTransferResponse { return { - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const MsgTransferResponse = { - encode(message: MsgTransferResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: MsgTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTransferResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTransferResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -192,18 +192,18 @@ export const MsgTransferResponse = { }, fromJSON(object: any): MsgTransferResponse { const obj = createBaseMsgTransferResponse(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: MsgTransferResponse): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgTransferResponse { + fromPartial(object: Partial): MsgTransferResponse { const message = createBaseMsgTransferResponse(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -222,6 +222,6 @@ export class MsgClientImpl implements Msg { Transfer(request: MsgTransfer): Promise { const data = MsgTransfer.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); - return promise.then((data) => MsgTransferResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgTransferResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/applications/transfer/v2/packet.ts b/src/ibc/applications/transfer/v2/packet.ts index a1a29c5..04a0802 100644 --- a/src/ibc/applications/transfer/v2/packet.ts +++ b/src/ibc/applications/transfer/v2/packet.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.applications.transfer.v2"; /** * FungibleTokenPacketData defines a struct for the packet payload @@ -29,7 +29,7 @@ function createBaseFungibleTokenPacketData(): FungibleTokenPacketData { }; } export const FungibleTokenPacketData = { - encode(message: FungibleTokenPacketData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: FungibleTokenPacketData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.denom !== "") { writer.uint32(10).string(message.denom); } @@ -47,8 +47,8 @@ export const FungibleTokenPacketData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): FungibleTokenPacketData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): FungibleTokenPacketData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFungibleTokenPacketData(); while (reader.pos < end) { @@ -94,7 +94,7 @@ export const FungibleTokenPacketData = { message.memo !== undefined && (obj.memo = message.memo); return obj; }, - fromPartial, I>>(object: I): FungibleTokenPacketData { + fromPartial(object: Partial): FungibleTokenPacketData { const message = createBaseFungibleTokenPacketData(); message.denom = object.denom ?? ""; message.amount = object.amount ?? ""; diff --git a/src/ibc/client.ts b/src/ibc/client.ts new file mode 100644 index 0000000..7074afd --- /dev/null +++ b/src/ibc/client.ts @@ -0,0 +1,59 @@ +/* eslint-disable */ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as ibcApplicationsFeeV1TxRegistry from "./applications/fee/v1/tx.registry"; +import * as ibcApplicationsInterchainAccountsControllerV1TxRegistry from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; +import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; +import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; +import * as ibcCoreConnectionV1TxRegistry from "./core/connection/v1/tx.registry"; +import * as ibcApplicationsFeeV1TxAmino from "./applications/fee/v1/tx.amino"; +import * as ibcApplicationsInterchainAccountsControllerV1TxAmino from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; +import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; +import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; +import * as ibcCoreConnectionV1TxAmino from "./core/connection/v1/tx.amino"; +export const ibcAminoConverters = { + ...ibcApplicationsFeeV1TxAmino.AminoConverter, + ...ibcApplicationsInterchainAccountsControllerV1TxAmino.AminoConverter, + ...ibcApplicationsTransferV1TxAmino.AminoConverter, + ...ibcCoreChannelV1TxAmino.AminoConverter, + ...ibcCoreClientV1TxAmino.AminoConverter, + ...ibcCoreConnectionV1TxAmino.AminoConverter, +}; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...ibcApplicationsFeeV1TxRegistry.registry, + ...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, + ...ibcApplicationsTransferV1TxRegistry.registry, + ...ibcCoreChannelV1TxRegistry.registry, + ...ibcCoreClientV1TxRegistry.registry, + ...ibcCoreConnectionV1TxRegistry.registry, +]; +export const getSigningIbcClientOptions = (): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...ibcProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...ibcAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningIbcClient = async ({ + rpcEndpoint, + signer, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +}) => { + const { registry, aminoTypes } = getSigningIbcClientOptions(); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes, + }); + return client; +}; diff --git a/src/ibc/core/channel/v1/channel.ts b/src/ibc/core/channel/v1/channel.ts index 5db6ea2..944396c 100644 --- a/src/ibc/core/channel/v1/channel.ts +++ b/src/ibc/core/channel/v1/channel.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Height } from "../../client/v1/client"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "ibc.core.channel.v1"; /** * State defines if a channel is in one of the following states: @@ -166,7 +166,7 @@ export interface Packet { * with an earlier sequence number must be sent and received before a Packet * with a later sequence number. */ - sequence: Long; + sequence: bigint; /** identifies the port on the sending chain. */ sourcePort: string; /** identifies the channel end on the sending chain. */ @@ -180,7 +180,7 @@ export interface Packet { /** block height after which the packet times out */ timeoutHeight: Height; /** block timestamp (in nanoseconds) after which the packet times out */ - timeoutTimestamp: Long; + timeoutTimestamp: bigint; } /** * PacketState defines the generic type necessary to retrieve and store @@ -194,7 +194,7 @@ export interface PacketState { /** channel unique identifier. */ channelId: string; /** packet sequence. */ - sequence: Long; + sequence: bigint; /** embedded data that represents packet state. */ data: Uint8Array; } @@ -209,7 +209,7 @@ export interface PacketId { /** channel unique identifier */ channelId: string; /** packet sequence */ - sequence: Long; + sequence: bigint; } /** * Acknowledgement is the recommended acknowledgement format to be used by @@ -234,7 +234,7 @@ function createBaseChannel(): Channel { }; } export const Channel = { - encode(message: Channel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Channel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.state !== 0) { writer.uint32(8).int32(message.state); } @@ -252,8 +252,8 @@ export const Channel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Channel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Channel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseChannel(); while (reader.pos < end) { @@ -305,7 +305,7 @@ export const Channel = { message.version !== undefined && (obj.version = message.version); return obj; }, - fromPartial, I>>(object: I): Channel { + fromPartial(object: Partial): Channel { const message = createBaseChannel(); message.state = object.state ?? 0; message.ordering = object.ordering ?? 0; @@ -329,7 +329,7 @@ function createBaseIdentifiedChannel(): IdentifiedChannel { }; } export const IdentifiedChannel = { - encode(message: IdentifiedChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IdentifiedChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.state !== 0) { writer.uint32(8).int32(message.state); } @@ -353,8 +353,8 @@ export const IdentifiedChannel = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedChannel { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedChannel(); while (reader.pos < end) { @@ -416,7 +416,7 @@ export const IdentifiedChannel = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>(object: I): IdentifiedChannel { + fromPartial(object: Partial): IdentifiedChannel { const message = createBaseIdentifiedChannel(); message.state = object.state ?? 0; message.ordering = object.ordering ?? 0; @@ -437,7 +437,7 @@ function createBaseCounterparty(): Counterparty { }; } export const Counterparty = { - encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -446,8 +446,8 @@ export const Counterparty = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCounterparty(); while (reader.pos < end) { @@ -478,7 +478,7 @@ export const Counterparty = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>(object: I): Counterparty { + fromPartial(object: Partial): Counterparty { const message = createBaseCounterparty(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -487,19 +487,19 @@ export const Counterparty = { }; function createBasePacket(): Packet { return { - sequence: Long.UZERO, + sequence: BigInt(0), sourcePort: "", sourceChannel: "", destinationPort: "", destinationChannel: "", data: new Uint8Array(), timeoutHeight: Height.fromPartial({}), - timeoutTimestamp: Long.UZERO, + timeoutTimestamp: BigInt(0), }; } export const Packet = { - encode(message: Packet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: Packet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } if (message.sourcePort !== "") { @@ -520,20 +520,20 @@ export const Packet = { if (message.timeoutHeight !== undefined) { Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); } - if (!message.timeoutTimestamp.isZero()) { + if (message.timeoutTimestamp !== BigInt(0)) { writer.uint32(64).uint64(message.timeoutTimestamp); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Packet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Packet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePacket(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; case 2: message.sourcePort = reader.string(); @@ -554,7 +554,7 @@ export const Packet = { message.timeoutHeight = Height.decode(reader, reader.uint32()); break; case 8: - message.timeoutTimestamp = reader.uint64() as Long; + message.timeoutTimestamp = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -565,19 +565,19 @@ export const Packet = { }, fromJSON(object: any): Packet { const obj = createBasePacket(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); if (isSet(object.sourcePort)) obj.sourcePort = String(object.sourcePort); if (isSet(object.sourceChannel)) obj.sourceChannel = String(object.sourceChannel); if (isSet(object.destinationPort)) obj.destinationPort = String(object.destinationPort); if (isSet(object.destinationChannel)) obj.destinationChannel = String(object.destinationChannel); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); if (isSet(object.timeoutHeight)) obj.timeoutHeight = Height.fromJSON(object.timeoutHeight); - if (isSet(object.timeoutTimestamp)) obj.timeoutTimestamp = Long.fromValue(object.timeoutTimestamp); + if (isSet(object.timeoutTimestamp)) obj.timeoutTimestamp = BigInt(object.timeoutTimestamp.toString()); return obj; }, toJSON(message: Packet): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort); @@ -587,13 +587,13 @@ export const Packet = { message.timeoutHeight !== undefined && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); message.timeoutTimestamp !== undefined && - (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); + (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Packet { + fromPartial(object: Partial): Packet { const message = createBasePacket(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } message.sourcePort = object.sourcePort ?? ""; message.sourceChannel = object.sourceChannel ?? ""; @@ -604,7 +604,7 @@ export const Packet = { message.timeoutHeight = Height.fromPartial(object.timeoutHeight); } if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { - message.timeoutTimestamp = Long.fromValue(object.timeoutTimestamp); + message.timeoutTimestamp = BigInt(object.timeoutTimestamp.toString()); } return message; }, @@ -613,19 +613,19 @@ function createBasePacketState(): PacketState { return { portId: "", channelId: "", - sequence: Long.UZERO, + sequence: BigInt(0), data: new Uint8Array(), }; } export const PacketState = { - encode(message: PacketState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PacketState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } if (message.data.length !== 0) { @@ -633,8 +633,8 @@ export const PacketState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PacketState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PacketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePacketState(); while (reader.pos < end) { @@ -647,7 +647,7 @@ export const PacketState = { message.channelId = reader.string(); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; case 4: message.data = reader.bytes(); @@ -663,7 +663,7 @@ export const PacketState = { const obj = createBasePacketState(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); return obj; }, @@ -671,17 +671,17 @@ export const PacketState = { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): PacketState { + fromPartial(object: Partial): PacketState { const message = createBasePacketState(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } message.data = object.data ?? new Uint8Array(); return message; @@ -691,24 +691,24 @@ function createBasePacketId(): PacketId { return { portId: "", channelId: "", - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const PacketId = { - encode(message: PacketId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PacketId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PacketId { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PacketId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePacketId(); while (reader.pos < end) { @@ -721,7 +721,7 @@ export const PacketId = { message.channelId = reader.string(); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -734,22 +734,22 @@ export const PacketId = { const obj = createBasePacketId(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: PacketId): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): PacketId { + fromPartial(object: Partial): PacketId { const message = createBasePacketId(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -761,7 +761,7 @@ function createBaseAcknowledgement(): Acknowledgement { }; } export const Acknowledgement = { - encode(message: Acknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Acknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== undefined) { writer.uint32(170).bytes(message.result); } @@ -770,8 +770,8 @@ export const Acknowledgement = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Acknowledgement { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAcknowledgement(); while (reader.pos < end) { @@ -803,7 +803,7 @@ export const Acknowledgement = { message.error !== undefined && (obj.error = message.error); return obj; }, - fromPartial, I>>(object: I): Acknowledgement { + fromPartial(object: Partial): Acknowledgement { const message = createBaseAcknowledgement(); message.result = object.result ?? undefined; message.error = object.error ?? undefined; diff --git a/src/ibc/core/channel/v1/genesis.ts b/src/ibc/core/channel/v1/genesis.ts index 68064c9..d30e454 100644 --- a/src/ibc/core/channel/v1/genesis.ts +++ b/src/ibc/core/channel/v1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { IdentifiedChannel, PacketState } from "./channel"; -import { Long, isSet, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.core.channel.v1"; /** GenesisState defines the ibc channel submodule's genesis state. */ export interface GenesisState { @@ -13,7 +13,7 @@ export interface GenesisState { recvSequences: PacketSequence[]; ackSequences: PacketSequence[]; /** the sequence for the next generated channel identifier */ - nextChannelSequence: Long; + nextChannelSequence: bigint; } /** * PacketSequence defines the genesis type necessary to retrieve and store @@ -22,7 +22,7 @@ export interface GenesisState { export interface PacketSequence { portId: string; channelId: string; - sequence: Long; + sequence: bigint; } function createBaseGenesisState(): GenesisState { return { @@ -33,11 +33,11 @@ function createBaseGenesisState(): GenesisState { sendSequences: [], recvSequences: [], ackSequences: [], - nextChannelSequence: Long.UZERO, + nextChannelSequence: BigInt(0), }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.channels) { IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -59,13 +59,13 @@ export const GenesisState = { for (const v of message.ackSequences) { PacketSequence.encode(v!, writer.uint32(58).fork()).ldelim(); } - if (!message.nextChannelSequence.isZero()) { + if (message.nextChannelSequence !== BigInt(0)) { writer.uint32(64).uint64(message.nextChannelSequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -93,7 +93,7 @@ export const GenesisState = { message.ackSequences.push(PacketSequence.decode(reader, reader.uint32())); break; case 8: - message.nextChannelSequence = reader.uint64() as Long; + message.nextChannelSequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -119,7 +119,7 @@ export const GenesisState = { if (Array.isArray(object?.ackSequences)) obj.ackSequences = object.ackSequences.map((e: any) => PacketSequence.fromJSON(e)); if (isSet(object.nextChannelSequence)) - obj.nextChannelSequence = Long.fromValue(object.nextChannelSequence); + obj.nextChannelSequence = BigInt(object.nextChannelSequence.toString()); return obj; }, toJSON(message: GenesisState): unknown { @@ -160,10 +160,10 @@ export const GenesisState = { obj.ackSequences = []; } message.nextChannelSequence !== undefined && - (obj.nextChannelSequence = (message.nextChannelSequence || Long.UZERO).toString()); + (obj.nextChannelSequence = (message.nextChannelSequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.channels = object.channels?.map((e) => IdentifiedChannel.fromPartial(e)) || []; message.acknowledgements = object.acknowledgements?.map((e) => PacketState.fromPartial(e)) || []; @@ -173,7 +173,7 @@ export const GenesisState = { message.recvSequences = object.recvSequences?.map((e) => PacketSequence.fromPartial(e)) || []; message.ackSequences = object.ackSequences?.map((e) => PacketSequence.fromPartial(e)) || []; if (object.nextChannelSequence !== undefined && object.nextChannelSequence !== null) { - message.nextChannelSequence = Long.fromValue(object.nextChannelSequence); + message.nextChannelSequence = BigInt(object.nextChannelSequence.toString()); } return message; }, @@ -182,24 +182,24 @@ function createBasePacketSequence(): PacketSequence { return { portId: "", channelId: "", - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const PacketSequence = { - encode(message: PacketSequence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PacketSequence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PacketSequence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PacketSequence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePacketSequence(); while (reader.pos < end) { @@ -212,7 +212,7 @@ export const PacketSequence = { message.channelId = reader.string(); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -225,22 +225,22 @@ export const PacketSequence = { const obj = createBasePacketSequence(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: PacketSequence): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): PacketSequence { + fromPartial(object: Partial): PacketSequence { const message = createBasePacketSequence(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, diff --git a/src/ibc/core/channel/v1/query.ts b/src/ibc/core/channel/v1/query.ts index 7a20ea5..7883189 100644 --- a/src/ibc/core/channel/v1/query.ts +++ b/src/ibc/core/channel/v1/query.ts @@ -3,8 +3,8 @@ import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1 import { Channel, IdentifiedChannel, PacketState } from "./channel"; import { Height, IdentifiedClientState } from "../../client/v1/client"; import { Any } from "../../../../google/protobuf/any"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.core.channel.v1"; /** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequest { @@ -94,9 +94,9 @@ export interface QueryChannelConsensusStateRequest { /** channel unique identifier */ channelId: string; /** revision number of the consensus state */ - revisionNumber: Long; + revisionNumber: bigint; /** revision height of the consensus state */ - revisionHeight: Long; + revisionHeight: bigint; } /** * QueryChannelClientStateResponse is the Response type for the @@ -122,7 +122,7 @@ export interface QueryPacketCommitmentRequest { /** channel unique identifier */ channelId: string; /** packet sequence */ - sequence: Long; + sequence: bigint; } /** * QueryPacketCommitmentResponse defines the client query response for a packet @@ -170,7 +170,7 @@ export interface QueryPacketReceiptRequest { /** channel unique identifier */ channelId: string; /** packet sequence */ - sequence: Long; + sequence: bigint; } /** * QueryPacketReceiptResponse defines the client query response for a packet @@ -195,7 +195,7 @@ export interface QueryPacketAcknowledgementRequest { /** channel unique identifier */ channelId: string; /** packet sequence */ - sequence: Long; + sequence: bigint; } /** * QueryPacketAcknowledgementResponse defines the client query response for a @@ -222,7 +222,7 @@ export interface QueryPacketAcknowledgementsRequest { /** pagination request */ pagination: PageRequest; /** list of packet sequences */ - packetCommitmentSequences: Long[]; + packetCommitmentSequences: bigint[]; } /** * QueryPacketAcknowledgemetsResponse is the request type for the @@ -245,7 +245,7 @@ export interface QueryUnreceivedPacketsRequest { /** channel unique identifier */ channelId: string; /** list of packet sequences */ - packetCommitmentSequences: Long[]; + packetCommitmentSequences: bigint[]; } /** * QueryUnreceivedPacketsResponse is the response type for the @@ -253,7 +253,7 @@ export interface QueryUnreceivedPacketsRequest { */ export interface QueryUnreceivedPacketsResponse { /** list of unreceived packet sequences */ - sequences: Long[]; + sequences: bigint[]; /** query block height */ height: Height; } @@ -267,7 +267,7 @@ export interface QueryUnreceivedAcksRequest { /** channel unique identifier */ channelId: string; /** list of acknowledgement sequences */ - packetAckSequences: Long[]; + packetAckSequences: bigint[]; } /** * QueryUnreceivedAcksResponse is the response type for the @@ -275,7 +275,7 @@ export interface QueryUnreceivedAcksRequest { */ export interface QueryUnreceivedAcksResponse { /** list of unreceived acknowledgement sequences */ - sequences: Long[]; + sequences: bigint[]; /** query block height */ height: Height; } @@ -295,7 +295,7 @@ export interface QueryNextSequenceReceiveRequest { */ export interface QueryNextSequenceReceiveResponse { /** next sequence receive number */ - nextSequenceReceive: Long; + nextSequenceReceive: bigint; /** merkle proof of existence */ proof: Uint8Array; /** height at which the proof was retrieved */ @@ -308,7 +308,7 @@ function createBaseQueryChannelRequest(): QueryChannelRequest { }; } export const QueryChannelRequest = { - encode(message: QueryChannelRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryChannelRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -317,8 +317,8 @@ export const QueryChannelRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelRequest(); while (reader.pos < end) { @@ -349,7 +349,7 @@ export const QueryChannelRequest = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>(object: I): QueryChannelRequest { + fromPartial(object: Partial): QueryChannelRequest { const message = createBaseQueryChannelRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -364,7 +364,7 @@ function createBaseQueryChannelResponse(): QueryChannelResponse { }; } export const QueryChannelResponse = { - encode(message: QueryChannelResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryChannelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channel !== undefined) { Channel.encode(message.channel, writer.uint32(10).fork()).ldelim(); } @@ -376,8 +376,8 @@ export const QueryChannelResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelResponse(); while (reader.pos < end) { @@ -416,7 +416,7 @@ export const QueryChannelResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryChannelResponse { + fromPartial(object: Partial): QueryChannelResponse { const message = createBaseQueryChannelResponse(); if (object.channel !== undefined && object.channel !== null) { message.channel = Channel.fromPartial(object.channel); @@ -434,14 +434,14 @@ function createBaseQueryChannelsRequest(): QueryChannelsRequest { }; } export const QueryChannelsRequest = { - encode(message: QueryChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryChannelsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelsRequest(); while (reader.pos < end) { @@ -468,7 +468,7 @@ export const QueryChannelsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryChannelsRequest { + fromPartial(object: Partial): QueryChannelsRequest { const message = createBaseQueryChannelsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -484,7 +484,7 @@ function createBaseQueryChannelsResponse(): QueryChannelsResponse { }; } export const QueryChannelsResponse = { - encode(message: QueryChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryChannelsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.channels) { IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -496,8 +496,8 @@ export const QueryChannelsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelsResponse(); while (reader.pos < end) { @@ -539,7 +539,7 @@ export const QueryChannelsResponse = { message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryChannelsResponse { + fromPartial(object: Partial): QueryChannelsResponse { const message = createBaseQueryChannelsResponse(); message.channels = object.channels?.map((e) => IdentifiedChannel.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -558,7 +558,10 @@ function createBaseQueryConnectionChannelsRequest(): QueryConnectionChannelsRequ }; } export const QueryConnectionChannelsRequest = { - encode(message: QueryConnectionChannelsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryConnectionChannelsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.connection !== "") { writer.uint32(10).string(message.connection); } @@ -567,8 +570,8 @@ export const QueryConnectionChannelsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionChannelsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionChannelsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionChannelsRequest(); while (reader.pos < end) { @@ -600,9 +603,7 @@ export const QueryConnectionChannelsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionChannelsRequest { + fromPartial(object: Partial): QueryConnectionChannelsRequest { const message = createBaseQueryConnectionChannelsRequest(); message.connection = object.connection ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -619,7 +620,10 @@ function createBaseQueryConnectionChannelsResponse(): QueryConnectionChannelsRes }; } export const QueryConnectionChannelsResponse = { - encode(message: QueryConnectionChannelsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryConnectionChannelsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.channels) { IdentifiedChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -631,8 +635,8 @@ export const QueryConnectionChannelsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionChannelsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionChannelsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionChannelsResponse(); while (reader.pos < end) { @@ -674,9 +678,7 @@ export const QueryConnectionChannelsResponse = { message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionChannelsResponse { + fromPartial(object: Partial): QueryConnectionChannelsResponse { const message = createBaseQueryConnectionChannelsResponse(); message.channels = object.channels?.map((e) => IdentifiedChannel.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -695,7 +697,10 @@ function createBaseQueryChannelClientStateRequest(): QueryChannelClientStateRequ }; } export const QueryChannelClientStateRequest = { - encode(message: QueryChannelClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryChannelClientStateRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -704,8 +709,8 @@ export const QueryChannelClientStateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelClientStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelClientStateRequest(); while (reader.pos < end) { @@ -736,9 +741,7 @@ export const QueryChannelClientStateRequest = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryChannelClientStateRequest { + fromPartial(object: Partial): QueryChannelClientStateRequest { const message = createBaseQueryChannelClientStateRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -753,7 +756,10 @@ function createBaseQueryChannelClientStateResponse(): QueryChannelClientStateRes }; } export const QueryChannelClientStateResponse = { - encode(message: QueryChannelClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryChannelClientStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.identifiedClientState !== undefined) { IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); } @@ -765,8 +771,8 @@ export const QueryChannelClientStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelClientStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelClientStateResponse(); while (reader.pos < end) { @@ -808,9 +814,7 @@ export const QueryChannelClientStateResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryChannelClientStateResponse { + fromPartial(object: Partial): QueryChannelClientStateResponse { const message = createBaseQueryChannelClientStateResponse(); if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { message.identifiedClientState = IdentifiedClientState.fromPartial(object.identifiedClientState); @@ -826,28 +830,31 @@ function createBaseQueryChannelConsensusStateRequest(): QueryChannelConsensusSta return { portId: "", channelId: "", - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), }; } export const QueryChannelConsensusStateRequest = { - encode(message: QueryChannelConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryChannelConsensusStateRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.revisionNumber.isZero()) { + if (message.revisionNumber !== BigInt(0)) { writer.uint32(24).uint64(message.revisionNumber); } - if (!message.revisionHeight.isZero()) { + if (message.revisionHeight !== BigInt(0)) { writer.uint32(32).uint64(message.revisionHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelConsensusStateRequest(); while (reader.pos < end) { @@ -860,10 +867,10 @@ export const QueryChannelConsensusStateRequest = { message.channelId = reader.string(); break; case 3: - message.revisionNumber = reader.uint64() as Long; + message.revisionNumber = reader.uint64(); break; case 4: - message.revisionHeight = reader.uint64() as Long; + message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -876,8 +883,8 @@ export const QueryChannelConsensusStateRequest = { const obj = createBaseQueryChannelConsensusStateRequest(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.revisionNumber)) obj.revisionNumber = Long.fromValue(object.revisionNumber); - if (isSet(object.revisionHeight)) obj.revisionHeight = Long.fromValue(object.revisionHeight); + if (isSet(object.revisionNumber)) obj.revisionNumber = BigInt(object.revisionNumber.toString()); + if (isSet(object.revisionHeight)) obj.revisionHeight = BigInt(object.revisionHeight.toString()); return obj; }, toJSON(message: QueryChannelConsensusStateRequest): unknown { @@ -885,22 +892,20 @@ export const QueryChannelConsensusStateRequest = { message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); message.revisionNumber !== undefined && - (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); message.revisionHeight !== undefined && - (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryChannelConsensusStateRequest { + fromPartial(object: Partial): QueryChannelConsensusStateRequest { const message = createBaseQueryChannelConsensusStateRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.revisionNumber !== undefined && object.revisionNumber !== null) { - message.revisionNumber = Long.fromValue(object.revisionNumber); + message.revisionNumber = BigInt(object.revisionNumber.toString()); } if (object.revisionHeight !== undefined && object.revisionHeight !== null) { - message.revisionHeight = Long.fromValue(object.revisionHeight); + message.revisionHeight = BigInt(object.revisionHeight.toString()); } return message; }, @@ -914,7 +919,10 @@ function createBaseQueryChannelConsensusStateResponse(): QueryChannelConsensusSt }; } export const QueryChannelConsensusStateResponse = { - encode(message: QueryChannelConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryChannelConsensusStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); } @@ -929,8 +937,8 @@ export const QueryChannelConsensusStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryChannelConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryChannelConsensusStateResponse(); while (reader.pos < end) { @@ -974,9 +982,7 @@ export const QueryChannelConsensusStateResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryChannelConsensusStateResponse { + fromPartial(object: Partial): QueryChannelConsensusStateResponse { const message = createBaseQueryChannelConsensusStateResponse(); if (object.consensusState !== undefined && object.consensusState !== null) { message.consensusState = Any.fromPartial(object.consensusState); @@ -993,24 +999,24 @@ function createBaseQueryPacketCommitmentRequest(): QueryPacketCommitmentRequest return { portId: "", channelId: "", - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const QueryPacketCommitmentRequest = { - encode(message: QueryPacketCommitmentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPacketCommitmentRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentRequest(); while (reader.pos < end) { @@ -1023,7 +1029,7 @@ export const QueryPacketCommitmentRequest = { message.channelId = reader.string(); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1036,24 +1042,22 @@ export const QueryPacketCommitmentRequest = { const obj = createBaseQueryPacketCommitmentRequest(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: QueryPacketCommitmentRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketCommitmentRequest { + fromPartial(object: Partial): QueryPacketCommitmentRequest { const message = createBaseQueryPacketCommitmentRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -1066,7 +1070,7 @@ function createBaseQueryPacketCommitmentResponse(): QueryPacketCommitmentRespons }; } export const QueryPacketCommitmentResponse = { - encode(message: QueryPacketCommitmentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPacketCommitmentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.commitment.length !== 0) { writer.uint32(10).bytes(message.commitment); } @@ -1078,8 +1082,8 @@ export const QueryPacketCommitmentResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentResponse(); while (reader.pos < end) { @@ -1120,9 +1124,7 @@ export const QueryPacketCommitmentResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketCommitmentResponse { + fromPartial(object: Partial): QueryPacketCommitmentResponse { const message = createBaseQueryPacketCommitmentResponse(); message.commitment = object.commitment ?? new Uint8Array(); message.proof = object.proof ?? new Uint8Array(); @@ -1140,7 +1142,7 @@ function createBaseQueryPacketCommitmentsRequest(): QueryPacketCommitmentsReques }; } export const QueryPacketCommitmentsRequest = { - encode(message: QueryPacketCommitmentsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPacketCommitmentsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -1152,8 +1154,8 @@ export const QueryPacketCommitmentsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentsRequest(); while (reader.pos < end) { @@ -1190,9 +1192,7 @@ export const QueryPacketCommitmentsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketCommitmentsRequest { + fromPartial(object: Partial): QueryPacketCommitmentsRequest { const message = createBaseQueryPacketCommitmentsRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -1210,7 +1210,10 @@ function createBaseQueryPacketCommitmentsResponse(): QueryPacketCommitmentsRespo }; } export const QueryPacketCommitmentsResponse = { - encode(message: QueryPacketCommitmentsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPacketCommitmentsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.commitments) { PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1222,8 +1225,8 @@ export const QueryPacketCommitmentsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketCommitmentsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketCommitmentsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketCommitmentsResponse(); while (reader.pos < end) { @@ -1265,9 +1268,7 @@ export const QueryPacketCommitmentsResponse = { message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketCommitmentsResponse { + fromPartial(object: Partial): QueryPacketCommitmentsResponse { const message = createBaseQueryPacketCommitmentsResponse(); message.commitments = object.commitments?.map((e) => PacketState.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1283,24 +1284,24 @@ function createBaseQueryPacketReceiptRequest(): QueryPacketReceiptRequest { return { portId: "", channelId: "", - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const QueryPacketReceiptRequest = { - encode(message: QueryPacketReceiptRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPacketReceiptRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketReceiptRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketReceiptRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketReceiptRequest(); while (reader.pos < end) { @@ -1313,7 +1314,7 @@ export const QueryPacketReceiptRequest = { message.channelId = reader.string(); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1326,24 +1327,22 @@ export const QueryPacketReceiptRequest = { const obj = createBaseQueryPacketReceiptRequest(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: QueryPacketReceiptRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketReceiptRequest { + fromPartial(object: Partial): QueryPacketReceiptRequest { const message = createBaseQueryPacketReceiptRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -1356,7 +1355,7 @@ function createBaseQueryPacketReceiptResponse(): QueryPacketReceiptResponse { }; } export const QueryPacketReceiptResponse = { - encode(message: QueryPacketReceiptResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPacketReceiptResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.received === true) { writer.uint32(16).bool(message.received); } @@ -1368,8 +1367,8 @@ export const QueryPacketReceiptResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketReceiptResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketReceiptResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketReceiptResponse(); while (reader.pos < end) { @@ -1407,9 +1406,7 @@ export const QueryPacketReceiptResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketReceiptResponse { + fromPartial(object: Partial): QueryPacketReceiptResponse { const message = createBaseQueryPacketReceiptResponse(); message.received = object.received ?? false; message.proof = object.proof ?? new Uint8Array(); @@ -1423,24 +1420,27 @@ function createBaseQueryPacketAcknowledgementRequest(): QueryPacketAcknowledgeme return { portId: "", channelId: "", - sequence: Long.UZERO, + sequence: BigInt(0), }; } export const QueryPacketAcknowledgementRequest = { - encode(message: QueryPacketAcknowledgementRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPacketAcknowledgementRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } if (message.channelId !== "") { writer.uint32(18).string(message.channelId); } - if (!message.sequence.isZero()) { + if (message.sequence !== BigInt(0)) { writer.uint32(24).uint64(message.sequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketAcknowledgementRequest(); while (reader.pos < end) { @@ -1453,7 +1453,7 @@ export const QueryPacketAcknowledgementRequest = { message.channelId = reader.string(); break; case 3: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -1466,24 +1466,22 @@ export const QueryPacketAcknowledgementRequest = { const obj = createBaseQueryPacketAcknowledgementRequest(); if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); return obj; }, toJSON(message: QueryPacketAcknowledgementRequest): unknown { const obj: any = {}; message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketAcknowledgementRequest { + fromPartial(object: Partial): QueryPacketAcknowledgementRequest { const message = createBaseQueryPacketAcknowledgementRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } return message; }, @@ -1496,7 +1494,10 @@ function createBaseQueryPacketAcknowledgementResponse(): QueryPacketAcknowledgem }; } export const QueryPacketAcknowledgementResponse = { - encode(message: QueryPacketAcknowledgementResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPacketAcknowledgementResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.acknowledgement.length !== 0) { writer.uint32(10).bytes(message.acknowledgement); } @@ -1508,8 +1509,8 @@ export const QueryPacketAcknowledgementResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketAcknowledgementResponse(); while (reader.pos < end) { @@ -1550,9 +1551,7 @@ export const QueryPacketAcknowledgementResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketAcknowledgementResponse { + fromPartial(object: Partial): QueryPacketAcknowledgementResponse { const message = createBaseQueryPacketAcknowledgementResponse(); message.acknowledgement = object.acknowledgement ?? new Uint8Array(); message.proof = object.proof ?? new Uint8Array(); @@ -1571,7 +1570,10 @@ function createBaseQueryPacketAcknowledgementsRequest(): QueryPacketAcknowledgem }; } export const QueryPacketAcknowledgementsRequest = { - encode(message: QueryPacketAcknowledgementsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPacketAcknowledgementsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -1588,8 +1590,8 @@ export const QueryPacketAcknowledgementsRequest = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketAcknowledgementsRequest(); while (reader.pos < end) { @@ -1608,10 +1610,10 @@ export const QueryPacketAcknowledgementsRequest = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.packetCommitmentSequences.push(reader.uint64() as Long); + message.packetCommitmentSequences.push(reader.uint64()); } } else { - message.packetCommitmentSequences.push(reader.uint64() as Long); + message.packetCommitmentSequences.push(reader.uint64()); } break; default: @@ -1627,7 +1629,7 @@ export const QueryPacketAcknowledgementsRequest = { if (isSet(object.channelId)) obj.channelId = String(object.channelId); if (isSet(object.pagination)) obj.pagination = PageRequest.fromJSON(object.pagination); if (Array.isArray(object?.packetCommitmentSequences)) - obj.packetCommitmentSequences = object.packetCommitmentSequences.map((e: any) => Long.fromValue(e)); + obj.packetCommitmentSequences = object.packetCommitmentSequences.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: QueryPacketAcknowledgementsRequest): unknown { @@ -1638,23 +1640,22 @@ export const QueryPacketAcknowledgementsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); if (message.packetCommitmentSequences) { obj.packetCommitmentSequences = message.packetCommitmentSequences.map((e) => - (e || Long.UZERO).toString(), + (e || BigInt(0)).toString(), ); } else { obj.packetCommitmentSequences = []; } return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketAcknowledgementsRequest { + fromPartial(object: Partial): QueryPacketAcknowledgementsRequest { const message = createBaseQueryPacketAcknowledgementsRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); } - message.packetCommitmentSequences = object.packetCommitmentSequences?.map((e) => Long.fromValue(e)) || []; + message.packetCommitmentSequences = + object.packetCommitmentSequences?.map((e) => BigInt(e.toString())) || []; return message; }, }; @@ -1666,7 +1667,10 @@ function createBaseQueryPacketAcknowledgementsResponse(): QueryPacketAcknowledge }; } export const QueryPacketAcknowledgementsResponse = { - encode(message: QueryPacketAcknowledgementsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPacketAcknowledgementsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.acknowledgements) { PacketState.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -1678,8 +1682,8 @@ export const QueryPacketAcknowledgementsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPacketAcknowledgementsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPacketAcknowledgementsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPacketAcknowledgementsResponse(); while (reader.pos < end) { @@ -1721,9 +1725,7 @@ export const QueryPacketAcknowledgementsResponse = { message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPacketAcknowledgementsResponse { + fromPartial(object: Partial): QueryPacketAcknowledgementsResponse { const message = createBaseQueryPacketAcknowledgementsResponse(); message.acknowledgements = object.acknowledgements?.map((e) => PacketState.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -1743,7 +1745,7 @@ function createBaseQueryUnreceivedPacketsRequest(): QueryUnreceivedPacketsReques }; } export const QueryUnreceivedPacketsRequest = { - encode(message: QueryUnreceivedPacketsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnreceivedPacketsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -1757,8 +1759,8 @@ export const QueryUnreceivedPacketsRequest = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedPacketsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedPacketsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnreceivedPacketsRequest(); while (reader.pos < end) { @@ -1774,10 +1776,10 @@ export const QueryUnreceivedPacketsRequest = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.packetCommitmentSequences.push(reader.uint64() as Long); + message.packetCommitmentSequences.push(reader.uint64()); } } else { - message.packetCommitmentSequences.push(reader.uint64() as Long); + message.packetCommitmentSequences.push(reader.uint64()); } break; default: @@ -1792,7 +1794,7 @@ export const QueryUnreceivedPacketsRequest = { if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); if (Array.isArray(object?.packetCommitmentSequences)) - obj.packetCommitmentSequences = object.packetCommitmentSequences.map((e: any) => Long.fromValue(e)); + obj.packetCommitmentSequences = object.packetCommitmentSequences.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: QueryUnreceivedPacketsRequest): unknown { @@ -1801,20 +1803,19 @@ export const QueryUnreceivedPacketsRequest = { message.channelId !== undefined && (obj.channelId = message.channelId); if (message.packetCommitmentSequences) { obj.packetCommitmentSequences = message.packetCommitmentSequences.map((e) => - (e || Long.UZERO).toString(), + (e || BigInt(0)).toString(), ); } else { obj.packetCommitmentSequences = []; } return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnreceivedPacketsRequest { + fromPartial(object: Partial): QueryUnreceivedPacketsRequest { const message = createBaseQueryUnreceivedPacketsRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; - message.packetCommitmentSequences = object.packetCommitmentSequences?.map((e) => Long.fromValue(e)) || []; + message.packetCommitmentSequences = + object.packetCommitmentSequences?.map((e) => BigInt(e.toString())) || []; return message; }, }; @@ -1825,7 +1826,10 @@ function createBaseQueryUnreceivedPacketsResponse(): QueryUnreceivedPacketsRespo }; } export const QueryUnreceivedPacketsResponse = { - encode(message: QueryUnreceivedPacketsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUnreceivedPacketsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { writer.uint32(10).fork(); for (const v of message.sequences) { writer.uint64(v); @@ -1836,8 +1840,8 @@ export const QueryUnreceivedPacketsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedPacketsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedPacketsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnreceivedPacketsResponse(); while (reader.pos < end) { @@ -1847,10 +1851,10 @@ export const QueryUnreceivedPacketsResponse = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.sequences.push(reader.uint64() as Long); + message.sequences.push(reader.uint64()); } } else { - message.sequences.push(reader.uint64() as Long); + message.sequences.push(reader.uint64()); } break; case 2: @@ -1865,25 +1869,24 @@ export const QueryUnreceivedPacketsResponse = { }, fromJSON(object: any): QueryUnreceivedPacketsResponse { const obj = createBaseQueryUnreceivedPacketsResponse(); - if (Array.isArray(object?.sequences)) obj.sequences = object.sequences.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.sequences)) + obj.sequences = object.sequences.map((e: any) => BigInt(e.toString())); if (isSet(object.height)) obj.height = Height.fromJSON(object.height); return obj; }, toJSON(message: QueryUnreceivedPacketsResponse): unknown { const obj: any = {}; if (message.sequences) { - obj.sequences = message.sequences.map((e) => (e || Long.UZERO).toString()); + obj.sequences = message.sequences.map((e) => (e || BigInt(0)).toString()); } else { obj.sequences = []; } message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnreceivedPacketsResponse { + fromPartial(object: Partial): QueryUnreceivedPacketsResponse { const message = createBaseQueryUnreceivedPacketsResponse(); - message.sequences = object.sequences?.map((e) => Long.fromValue(e)) || []; + message.sequences = object.sequences?.map((e) => BigInt(e.toString())) || []; if (object.height !== undefined && object.height !== null) { message.height = Height.fromPartial(object.height); } @@ -1898,7 +1901,7 @@ function createBaseQueryUnreceivedAcksRequest(): QueryUnreceivedAcksRequest { }; } export const QueryUnreceivedAcksRequest = { - encode(message: QueryUnreceivedAcksRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnreceivedAcksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -1912,8 +1915,8 @@ export const QueryUnreceivedAcksRequest = { writer.ldelim(); return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedAcksRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedAcksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnreceivedAcksRequest(); while (reader.pos < end) { @@ -1929,10 +1932,10 @@ export const QueryUnreceivedAcksRequest = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.packetAckSequences.push(reader.uint64() as Long); + message.packetAckSequences.push(reader.uint64()); } } else { - message.packetAckSequences.push(reader.uint64() as Long); + message.packetAckSequences.push(reader.uint64()); } break; default: @@ -1947,7 +1950,7 @@ export const QueryUnreceivedAcksRequest = { if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.channelId)) obj.channelId = String(object.channelId); if (Array.isArray(object?.packetAckSequences)) - obj.packetAckSequences = object.packetAckSequences.map((e: any) => Long.fromValue(e)); + obj.packetAckSequences = object.packetAckSequences.map((e: any) => BigInt(e.toString())); return obj; }, toJSON(message: QueryUnreceivedAcksRequest): unknown { @@ -1955,19 +1958,17 @@ export const QueryUnreceivedAcksRequest = { message.portId !== undefined && (obj.portId = message.portId); message.channelId !== undefined && (obj.channelId = message.channelId); if (message.packetAckSequences) { - obj.packetAckSequences = message.packetAckSequences.map((e) => (e || Long.UZERO).toString()); + obj.packetAckSequences = message.packetAckSequences.map((e) => (e || BigInt(0)).toString()); } else { obj.packetAckSequences = []; } return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnreceivedAcksRequest { + fromPartial(object: Partial): QueryUnreceivedAcksRequest { const message = createBaseQueryUnreceivedAcksRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; - message.packetAckSequences = object.packetAckSequences?.map((e) => Long.fromValue(e)) || []; + message.packetAckSequences = object.packetAckSequences?.map((e) => BigInt(e.toString())) || []; return message; }, }; @@ -1978,7 +1979,7 @@ function createBaseQueryUnreceivedAcksResponse(): QueryUnreceivedAcksResponse { }; } export const QueryUnreceivedAcksResponse = { - encode(message: QueryUnreceivedAcksResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnreceivedAcksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { writer.uint32(10).fork(); for (const v of message.sequences) { writer.uint64(v); @@ -1989,8 +1990,8 @@ export const QueryUnreceivedAcksResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnreceivedAcksResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnreceivedAcksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnreceivedAcksResponse(); while (reader.pos < end) { @@ -2000,10 +2001,10 @@ export const QueryUnreceivedAcksResponse = { if ((tag & 7) === 2) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.sequences.push(reader.uint64() as Long); + message.sequences.push(reader.uint64()); } } else { - message.sequences.push(reader.uint64() as Long); + message.sequences.push(reader.uint64()); } break; case 2: @@ -2018,25 +2019,24 @@ export const QueryUnreceivedAcksResponse = { }, fromJSON(object: any): QueryUnreceivedAcksResponse { const obj = createBaseQueryUnreceivedAcksResponse(); - if (Array.isArray(object?.sequences)) obj.sequences = object.sequences.map((e: any) => Long.fromValue(e)); + if (Array.isArray(object?.sequences)) + obj.sequences = object.sequences.map((e: any) => BigInt(e.toString())); if (isSet(object.height)) obj.height = Height.fromJSON(object.height); return obj; }, toJSON(message: QueryUnreceivedAcksResponse): unknown { const obj: any = {}; if (message.sequences) { - obj.sequences = message.sequences.map((e) => (e || Long.UZERO).toString()); + obj.sequences = message.sequences.map((e) => (e || BigInt(0)).toString()); } else { obj.sequences = []; } message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnreceivedAcksResponse { + fromPartial(object: Partial): QueryUnreceivedAcksResponse { const message = createBaseQueryUnreceivedAcksResponse(); - message.sequences = object.sequences?.map((e) => Long.fromValue(e)) || []; + message.sequences = object.sequences?.map((e) => BigInt(e.toString())) || []; if (object.height !== undefined && object.height !== null) { message.height = Height.fromPartial(object.height); } @@ -2050,7 +2050,10 @@ function createBaseQueryNextSequenceReceiveRequest(): QueryNextSequenceReceiveRe }; } export const QueryNextSequenceReceiveRequest = { - encode(message: QueryNextSequenceReceiveRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryNextSequenceReceiveRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -2059,8 +2062,8 @@ export const QueryNextSequenceReceiveRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextSequenceReceiveRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceReceiveRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNextSequenceReceiveRequest(); while (reader.pos < end) { @@ -2091,9 +2094,7 @@ export const QueryNextSequenceReceiveRequest = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryNextSequenceReceiveRequest { + fromPartial(object: Partial): QueryNextSequenceReceiveRequest { const message = createBaseQueryNextSequenceReceiveRequest(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -2102,14 +2103,17 @@ export const QueryNextSequenceReceiveRequest = { }; function createBaseQueryNextSequenceReceiveResponse(): QueryNextSequenceReceiveResponse { return { - nextSequenceReceive: Long.UZERO, + nextSequenceReceive: BigInt(0), proof: new Uint8Array(), proofHeight: Height.fromPartial({}), }; } export const QueryNextSequenceReceiveResponse = { - encode(message: QueryNextSequenceReceiveResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.nextSequenceReceive.isZero()) { + encode( + message: QueryNextSequenceReceiveResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.nextSequenceReceive !== BigInt(0)) { writer.uint32(8).uint64(message.nextSequenceReceive); } if (message.proof.length !== 0) { @@ -2120,15 +2124,15 @@ export const QueryNextSequenceReceiveResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryNextSequenceReceiveResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceReceiveResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryNextSequenceReceiveResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nextSequenceReceive = reader.uint64() as Long; + message.nextSequenceReceive = reader.uint64(); break; case 2: message.proof = reader.bytes(); @@ -2146,7 +2150,7 @@ export const QueryNextSequenceReceiveResponse = { fromJSON(object: any): QueryNextSequenceReceiveResponse { const obj = createBaseQueryNextSequenceReceiveResponse(); if (isSet(object.nextSequenceReceive)) - obj.nextSequenceReceive = Long.fromValue(object.nextSequenceReceive); + obj.nextSequenceReceive = BigInt(object.nextSequenceReceive.toString()); if (isSet(object.proof)) obj.proof = bytesFromBase64(object.proof); if (isSet(object.proofHeight)) obj.proofHeight = Height.fromJSON(object.proofHeight); return obj; @@ -2154,19 +2158,17 @@ export const QueryNextSequenceReceiveResponse = { toJSON(message: QueryNextSequenceReceiveResponse): unknown { const obj: any = {}; message.nextSequenceReceive !== undefined && - (obj.nextSequenceReceive = (message.nextSequenceReceive || Long.UZERO).toString()); + (obj.nextSequenceReceive = (message.nextSequenceReceive || BigInt(0)).toString()); message.proof !== undefined && (obj.proof = base64FromBytes(message.proof !== undefined ? message.proof : new Uint8Array())); message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryNextSequenceReceiveResponse { + fromPartial(object: Partial): QueryNextSequenceReceiveResponse { const message = createBaseQueryNextSequenceReceiveResponse(); if (object.nextSequenceReceive !== undefined && object.nextSequenceReceive !== null) { - message.nextSequenceReceive = Long.fromValue(object.nextSequenceReceive); + message.nextSequenceReceive = BigInt(object.nextSequenceReceive.toString()); } message.proof = object.proof ?? new Uint8Array(); if (object.proofHeight !== undefined && object.proofHeight !== null) { @@ -2255,7 +2257,7 @@ export class QueryClientImpl implements Query { Channel(request: QueryChannelRequest): Promise { const data = QueryChannelRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channel", data); - return promise.then((data) => QueryChannelResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryChannelResponse.decode(new BinaryReader(data))); } Channels( request: QueryChannelsRequest = { @@ -2264,67 +2266,67 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryChannelsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "Channels", data); - return promise.then((data) => QueryChannelsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryChannelsResponse.decode(new BinaryReader(data))); } ConnectionChannels(request: QueryConnectionChannelsRequest): Promise { const data = QueryConnectionChannelsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "ConnectionChannels", data); - return promise.then((data) => QueryConnectionChannelsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConnectionChannelsResponse.decode(new BinaryReader(data))); } ChannelClientState(request: QueryChannelClientStateRequest): Promise { const data = QueryChannelClientStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelClientState", data); - return promise.then((data) => QueryChannelClientStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryChannelClientStateResponse.decode(new BinaryReader(data))); } ChannelConsensusState( request: QueryChannelConsensusStateRequest, ): Promise { const data = QueryChannelConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelConsensusState", data); - return promise.then((data) => QueryChannelConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryChannelConsensusStateResponse.decode(new BinaryReader(data))); } PacketCommitment(request: QueryPacketCommitmentRequest): Promise { const data = QueryPacketCommitmentRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitment", data); - return promise.then((data) => QueryPacketCommitmentResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPacketCommitmentResponse.decode(new BinaryReader(data))); } PacketCommitments(request: QueryPacketCommitmentsRequest): Promise { const data = QueryPacketCommitmentsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketCommitments", data); - return promise.then((data) => QueryPacketCommitmentsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPacketCommitmentsResponse.decode(new BinaryReader(data))); } PacketReceipt(request: QueryPacketReceiptRequest): Promise { const data = QueryPacketReceiptRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketReceipt", data); - return promise.then((data) => QueryPacketReceiptResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPacketReceiptResponse.decode(new BinaryReader(data))); } PacketAcknowledgement( request: QueryPacketAcknowledgementRequest, ): Promise { const data = QueryPacketAcknowledgementRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgement", data); - return promise.then((data) => QueryPacketAcknowledgementResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPacketAcknowledgementResponse.decode(new BinaryReader(data))); } PacketAcknowledgements( request: QueryPacketAcknowledgementsRequest, ): Promise { const data = QueryPacketAcknowledgementsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "PacketAcknowledgements", data); - return promise.then((data) => QueryPacketAcknowledgementsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPacketAcknowledgementsResponse.decode(new BinaryReader(data))); } UnreceivedPackets(request: QueryUnreceivedPacketsRequest): Promise { const data = QueryUnreceivedPacketsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedPackets", data); - return promise.then((data) => QueryUnreceivedPacketsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnreceivedPacketsResponse.decode(new BinaryReader(data))); } UnreceivedAcks(request: QueryUnreceivedAcksRequest): Promise { const data = QueryUnreceivedAcksRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "UnreceivedAcks", data); - return promise.then((data) => QueryUnreceivedAcksResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnreceivedAcksResponse.decode(new BinaryReader(data))); } NextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { const data = QueryNextSequenceReceiveRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); - return promise.then((data) => QueryNextSequenceReceiveResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryNextSequenceReceiveResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/core/channel/v1/tx.amino.ts b/src/ibc/core/channel/v1/tx.amino.ts new file mode 100644 index 0000000..b9b80f9 --- /dev/null +++ b/src/ibc/core/channel/v1/tx.amino.ts @@ -0,0 +1,718 @@ +/* eslint-disable */ +import { stateFromJSON, orderFromJSON } from "./channel"; +import { AminoMsg } from "@cosmjs/amino"; +import { AminoHeight, omitDefault } from "../../../../helpers"; +import { + MsgChannelOpenInit, + MsgChannelOpenTry, + MsgChannelOpenAck, + MsgChannelOpenConfirm, + MsgChannelCloseInit, + MsgChannelCloseConfirm, + MsgRecvPacket, + MsgTimeout, + MsgTimeoutOnClose, + MsgAcknowledgement, +} from "./tx"; +export interface MsgChannelOpenInitAminoType extends AminoMsg { + type: "cosmos-sdk/MsgChannelOpenInit"; + value: { + port_id: string; + channel: { + state: number; + ordering: number; + counterparty: { + port_id: string; + channel_id: string; + }; + connection_hops: string[]; + version: string; + }; + signer: string; + }; +} +export interface MsgChannelOpenTryAminoType extends AminoMsg { + type: "cosmos-sdk/MsgChannelOpenTry"; + value: { + port_id: string; + previous_channel_id: string; + channel: { + state: number; + ordering: number; + counterparty: { + port_id: string; + channel_id: string; + }; + connection_hops: string[]; + version: string; + }; + counterparty_version: string; + proof_init: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export interface MsgChannelOpenAckAminoType extends AminoMsg { + type: "cosmos-sdk/MsgChannelOpenAck"; + value: { + port_id: string; + channel_id: string; + counterparty_channel_id: string; + counterparty_version: string; + proof_try: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export interface MsgChannelOpenConfirmAminoType extends AminoMsg { + type: "cosmos-sdk/MsgChannelOpenConfirm"; + value: { + port_id: string; + channel_id: string; + proof_ack: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export interface MsgChannelCloseInitAminoType extends AminoMsg { + type: "cosmos-sdk/MsgChannelCloseInit"; + value: { + port_id: string; + channel_id: string; + signer: string; + }; +} +export interface MsgChannelCloseConfirmAminoType extends AminoMsg { + type: "cosmos-sdk/MsgChannelCloseConfirm"; + value: { + port_id: string; + channel_id: string; + proof_init: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export interface MsgRecvPacketAminoType extends AminoMsg { + type: "cosmos-sdk/MsgRecvPacket"; + value: { + packet: { + sequence: string; + source_port: string; + source_channel: string; + destination_port: string; + destination_channel: string; + data: Uint8Array; + timeout_height: AminoHeight; + timeout_timestamp: string; + }; + proof_commitment: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export interface MsgTimeoutAminoType extends AminoMsg { + type: "cosmos-sdk/MsgTimeout"; + value: { + packet: { + sequence: string; + source_port: string; + source_channel: string; + destination_port: string; + destination_channel: string; + data: Uint8Array; + timeout_height: AminoHeight; + timeout_timestamp: string; + }; + proof_unreceived: Uint8Array; + proof_height: AminoHeight; + next_sequence_recv: string; + signer: string; + }; +} +export interface MsgTimeoutOnCloseAminoType extends AminoMsg { + type: "cosmos-sdk/MsgTimeoutOnClose"; + value: { + packet: { + sequence: string; + source_port: string; + source_channel: string; + destination_port: string; + destination_channel: string; + data: Uint8Array; + timeout_height: AminoHeight; + timeout_timestamp: string; + }; + proof_unreceived: Uint8Array; + proof_close: Uint8Array; + proof_height: AminoHeight; + next_sequence_recv: string; + signer: string; + }; +} +export interface MsgAcknowledgementAminoType extends AminoMsg { + type: "cosmos-sdk/MsgAcknowledgement"; + value: { + packet: { + sequence: string; + source_port: string; + source_channel: string; + destination_port: string; + destination_channel: string; + data: Uint8Array; + timeout_height: AminoHeight; + timeout_timestamp: string; + }; + acknowledgement: Uint8Array; + proof_acked: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export const AminoConverter = { + "/ibc.core.channel.v1.MsgChannelOpenInit": { + aminoType: "cosmos-sdk/MsgChannelOpenInit", + toAmino: ({ portId, channel, signer }: MsgChannelOpenInit): MsgChannelOpenInitAminoType["value"] => { + return { + port_id: portId, + channel: { + state: channel.state, + ordering: channel.ordering, + counterparty: { + port_id: channel.counterparty.portId, + channel_id: channel.counterparty.channelId, + }, + connection_hops: channel.connectionHops, + version: channel.version, + }, + signer, + }; + }, + fromAmino: ({ port_id, channel, signer }: MsgChannelOpenInitAminoType["value"]): MsgChannelOpenInit => { + return { + portId: port_id, + channel: { + state: stateFromJSON(channel.state), + ordering: orderFromJSON(channel.ordering), + counterparty: { + portId: channel.counterparty.port_id, + channelId: channel.counterparty.channel_id, + }, + connectionHops: channel.connection_hops, + version: channel.version, + }, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgChannelOpenTry": { + aminoType: "cosmos-sdk/MsgChannelOpenTry", + toAmino: ({ + portId, + previousChannelId, + channel, + counterpartyVersion, + proofInit, + proofHeight, + signer, + }: MsgChannelOpenTry): MsgChannelOpenTryAminoType["value"] => { + return { + port_id: portId, + previous_channel_id: previousChannelId, + channel: { + state: channel.state, + ordering: channel.ordering, + counterparty: { + port_id: channel.counterparty.portId, + channel_id: channel.counterparty.channelId, + }, + connection_hops: channel.connectionHops, + version: channel.version, + }, + counterparty_version: counterpartyVersion, + proof_init: proofInit, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + port_id, + previous_channel_id, + channel, + counterparty_version, + proof_init, + proof_height, + signer, + }: MsgChannelOpenTryAminoType["value"]): MsgChannelOpenTry => { + return { + portId: port_id, + previousChannelId: previous_channel_id, + channel: { + state: stateFromJSON(channel.state), + ordering: orderFromJSON(channel.ordering), + counterparty: { + portId: channel.counterparty.port_id, + channelId: channel.counterparty.channel_id, + }, + connectionHops: channel.connection_hops, + version: channel.version, + }, + counterpartyVersion: counterparty_version, + proofInit: proof_init, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgChannelOpenAck": { + aminoType: "cosmos-sdk/MsgChannelOpenAck", + toAmino: ({ + portId, + channelId, + counterpartyChannelId, + counterpartyVersion, + proofTry, + proofHeight, + signer, + }: MsgChannelOpenAck): MsgChannelOpenAckAminoType["value"] => { + return { + port_id: portId, + channel_id: channelId, + counterparty_channel_id: counterpartyChannelId, + counterparty_version: counterpartyVersion, + proof_try: proofTry, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + port_id, + channel_id, + counterparty_channel_id, + counterparty_version, + proof_try, + proof_height, + signer, + }: MsgChannelOpenAckAminoType["value"]): MsgChannelOpenAck => { + return { + portId: port_id, + channelId: channel_id, + counterpartyChannelId: counterparty_channel_id, + counterpartyVersion: counterparty_version, + proofTry: proof_try, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgChannelOpenConfirm": { + aminoType: "cosmos-sdk/MsgChannelOpenConfirm", + toAmino: ({ + portId, + channelId, + proofAck, + proofHeight, + signer, + }: MsgChannelOpenConfirm): MsgChannelOpenConfirmAminoType["value"] => { + return { + port_id: portId, + channel_id: channelId, + proof_ack: proofAck, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + port_id, + channel_id, + proof_ack, + proof_height, + signer, + }: MsgChannelOpenConfirmAminoType["value"]): MsgChannelOpenConfirm => { + return { + portId: port_id, + channelId: channel_id, + proofAck: proof_ack, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgChannelCloseInit": { + aminoType: "cosmos-sdk/MsgChannelCloseInit", + toAmino: ({ portId, channelId, signer }: MsgChannelCloseInit): MsgChannelCloseInitAminoType["value"] => { + return { + port_id: portId, + channel_id: channelId, + signer, + }; + }, + fromAmino: ({ + port_id, + channel_id, + signer, + }: MsgChannelCloseInitAminoType["value"]): MsgChannelCloseInit => { + return { + portId: port_id, + channelId: channel_id, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgChannelCloseConfirm": { + aminoType: "cosmos-sdk/MsgChannelCloseConfirm", + toAmino: ({ + portId, + channelId, + proofInit, + proofHeight, + signer, + }: MsgChannelCloseConfirm): MsgChannelCloseConfirmAminoType["value"] => { + return { + port_id: portId, + channel_id: channelId, + proof_init: proofInit, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + port_id, + channel_id, + proof_init, + proof_height, + signer, + }: MsgChannelCloseConfirmAminoType["value"]): MsgChannelCloseConfirm => { + return { + portId: port_id, + channelId: channel_id, + proofInit: proof_init, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgRecvPacket": { + aminoType: "cosmos-sdk/MsgRecvPacket", + toAmino: ({ + packet, + proofCommitment, + proofHeight, + signer, + }: MsgRecvPacket): MsgRecvPacketAminoType["value"] => { + return { + packet: { + sequence: packet.sequence.toString(), + source_port: packet.sourcePort, + source_channel: packet.sourceChannel, + destination_port: packet.destinationPort, + destination_channel: packet.destinationChannel, + data: packet.data, + timeout_height: packet.timeoutHeight + ? { + revision_height: omitDefault(packet.timeoutHeight.revisionHeight)?.toString(), + revision_number: omitDefault(packet.timeoutHeight.revisionNumber)?.toString(), + } + : {}, + timeout_timestamp: packet.timeoutTimestamp.toString(), + }, + proof_commitment: proofCommitment, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + packet, + proof_commitment, + proof_height, + signer, + }: MsgRecvPacketAminoType["value"]): MsgRecvPacket => { + return { + packet: { + sequence: BigInt(packet.sequence), + sourcePort: packet.source_port, + sourceChannel: packet.source_channel, + destinationPort: packet.destination_port, + destinationChannel: packet.destination_channel, + data: packet.data, + timeoutHeight: packet.timeout_height + ? { + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0"), + } + : undefined, + timeoutTimestamp: BigInt(packet.timeout_timestamp), + }, + proofCommitment: proof_commitment, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgTimeout": { + aminoType: "cosmos-sdk/MsgTimeout", + toAmino: ({ + packet, + proofUnreceived, + proofHeight, + nextSequenceRecv, + signer, + }: MsgTimeout): MsgTimeoutAminoType["value"] => { + return { + packet: { + sequence: packet.sequence.toString(), + source_port: packet.sourcePort, + source_channel: packet.sourceChannel, + destination_port: packet.destinationPort, + destination_channel: packet.destinationChannel, + data: packet.data, + timeout_height: packet.timeoutHeight + ? { + revision_height: omitDefault(packet.timeoutHeight.revisionHeight)?.toString(), + revision_number: omitDefault(packet.timeoutHeight.revisionNumber)?.toString(), + } + : {}, + timeout_timestamp: packet.timeoutTimestamp.toString(), + }, + proof_unreceived: proofUnreceived, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + next_sequence_recv: nextSequenceRecv.toString(), + signer, + }; + }, + fromAmino: ({ + packet, + proof_unreceived, + proof_height, + next_sequence_recv, + signer, + }: MsgTimeoutAminoType["value"]): MsgTimeout => { + return { + packet: { + sequence: BigInt(packet.sequence), + sourcePort: packet.source_port, + sourceChannel: packet.source_channel, + destinationPort: packet.destination_port, + destinationChannel: packet.destination_channel, + data: packet.data, + timeoutHeight: packet.timeout_height + ? { + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0"), + } + : undefined, + timeoutTimestamp: BigInt(packet.timeout_timestamp), + }, + proofUnreceived: proof_unreceived, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + nextSequenceRecv: BigInt(next_sequence_recv), + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgTimeoutOnClose": { + aminoType: "cosmos-sdk/MsgTimeoutOnClose", + toAmino: ({ + packet, + proofUnreceived, + proofClose, + proofHeight, + nextSequenceRecv, + signer, + }: MsgTimeoutOnClose): MsgTimeoutOnCloseAminoType["value"] => { + return { + packet: { + sequence: packet.sequence.toString(), + source_port: packet.sourcePort, + source_channel: packet.sourceChannel, + destination_port: packet.destinationPort, + destination_channel: packet.destinationChannel, + data: packet.data, + timeout_height: packet.timeoutHeight + ? { + revision_height: omitDefault(packet.timeoutHeight.revisionHeight)?.toString(), + revision_number: omitDefault(packet.timeoutHeight.revisionNumber)?.toString(), + } + : {}, + timeout_timestamp: packet.timeoutTimestamp.toString(), + }, + proof_unreceived: proofUnreceived, + proof_close: proofClose, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + next_sequence_recv: nextSequenceRecv.toString(), + signer, + }; + }, + fromAmino: ({ + packet, + proof_unreceived, + proof_close, + proof_height, + next_sequence_recv, + signer, + }: MsgTimeoutOnCloseAminoType["value"]): MsgTimeoutOnClose => { + return { + packet: { + sequence: BigInt(packet.sequence), + sourcePort: packet.source_port, + sourceChannel: packet.source_channel, + destinationPort: packet.destination_port, + destinationChannel: packet.destination_channel, + data: packet.data, + timeoutHeight: packet.timeout_height + ? { + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0"), + } + : undefined, + timeoutTimestamp: BigInt(packet.timeout_timestamp), + }, + proofUnreceived: proof_unreceived, + proofClose: proof_close, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + nextSequenceRecv: BigInt(next_sequence_recv), + signer, + }; + }, + }, + "/ibc.core.channel.v1.MsgAcknowledgement": { + aminoType: "cosmos-sdk/MsgAcknowledgement", + toAmino: ({ + packet, + acknowledgement, + proofAcked, + proofHeight, + signer, + }: MsgAcknowledgement): MsgAcknowledgementAminoType["value"] => { + return { + packet: { + sequence: packet.sequence.toString(), + source_port: packet.sourcePort, + source_channel: packet.sourceChannel, + destination_port: packet.destinationPort, + destination_channel: packet.destinationChannel, + data: packet.data, + timeout_height: packet.timeoutHeight + ? { + revision_height: omitDefault(packet.timeoutHeight.revisionHeight)?.toString(), + revision_number: omitDefault(packet.timeoutHeight.revisionNumber)?.toString(), + } + : {}, + timeout_timestamp: packet.timeoutTimestamp.toString(), + }, + acknowledgement, + proof_acked: proofAcked, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + packet, + acknowledgement, + proof_acked, + proof_height, + signer, + }: MsgAcknowledgementAminoType["value"]): MsgAcknowledgement => { + return { + packet: { + sequence: BigInt(packet.sequence), + sourcePort: packet.source_port, + sourceChannel: packet.source_channel, + destinationPort: packet.destination_port, + destinationChannel: packet.destination_channel, + data: packet.data, + timeoutHeight: packet.timeout_height + ? { + revisionHeight: BigInt(packet.timeout_height.revision_height || "0"), + revisionNumber: BigInt(packet.timeout_height.revision_number || "0"), + } + : undefined, + timeoutTimestamp: BigInt(packet.timeout_timestamp), + }, + acknowledgement, + proofAcked: proof_acked, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, +}; diff --git a/src/ibc/core/channel/v1/tx.registry.ts b/src/ibc/core/channel/v1/tx.registry.ts new file mode 100644 index 0000000..184b64e --- /dev/null +++ b/src/ibc/core/channel/v1/tx.registry.ts @@ -0,0 +1,344 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgChannelOpenInit, + MsgChannelOpenTry, + MsgChannelOpenAck, + MsgChannelOpenConfirm, + MsgChannelCloseInit, + MsgChannelCloseConfirm, + MsgRecvPacket, + MsgTimeout, + MsgTimeoutOnClose, + MsgAcknowledgement, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], + ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], + ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], + ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], + ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], + ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], + ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], + ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], + ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], + ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.encode(value).finish(), + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.encode(value).finish(), + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.encode(value).finish(), + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.encode(value).finish(), + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.encode(value).finish(), + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.encode(value).finish(), + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.encode(value).finish(), + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.encode(value).finish(), + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.encode(value).finish(), + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value, + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value, + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value, + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value, + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value, + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value, + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value, + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value, + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value, + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value, + }; + }, + }, + toJSON: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.toJSON(value), + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.toJSON(value), + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.toJSON(value), + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.toJSON(value), + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.toJSON(value), + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.toJSON(value), + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.toJSON(value), + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.toJSON(value), + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.toJSON(value), + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.toJSON(value), + }; + }, + }, + fromJSON: { + channelOpenInit(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.fromJSON(value), + }; + }, + channelOpenTry(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.fromJSON(value), + }; + }, + channelOpenAck(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.fromJSON(value), + }; + }, + channelOpenConfirm(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.fromJSON(value), + }; + }, + channelCloseInit(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.fromJSON(value), + }; + }, + channelCloseConfirm(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.fromJSON(value), + }; + }, + recvPacket(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.fromJSON(value), + }; + }, + timeout(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.fromJSON(value), + }; + }, + timeoutOnClose(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.fromJSON(value), + }; + }, + acknowledgement(value: any) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.fromJSON(value), + }; + }, + }, + fromPartial: { + channelOpenInit(value: MsgChannelOpenInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenInit", + value: MsgChannelOpenInit.fromPartial(value), + }; + }, + channelOpenTry(value: MsgChannelOpenTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTry", + value: MsgChannelOpenTry.fromPartial(value), + }; + }, + channelOpenAck(value: MsgChannelOpenAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenAck", + value: MsgChannelOpenAck.fromPartial(value), + }; + }, + channelOpenConfirm(value: MsgChannelOpenConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelOpenConfirm", + value: MsgChannelOpenConfirm.fromPartial(value), + }; + }, + channelCloseInit(value: MsgChannelCloseInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseInit", + value: MsgChannelCloseInit.fromPartial(value), + }; + }, + channelCloseConfirm(value: MsgChannelCloseConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm", + value: MsgChannelCloseConfirm.fromPartial(value), + }; + }, + recvPacket(value: MsgRecvPacket) { + return { + typeUrl: "/ibc.core.channel.v1.MsgRecvPacket", + value: MsgRecvPacket.fromPartial(value), + }; + }, + timeout(value: MsgTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeout", + value: MsgTimeout.fromPartial(value), + }; + }, + timeoutOnClose(value: MsgTimeoutOnClose) { + return { + typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose", + value: MsgTimeoutOnClose.fromPartial(value), + }; + }, + acknowledgement(value: MsgAcknowledgement) { + return { + typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", + value: MsgAcknowledgement.fromPartial(value), + }; + }, + }, +}; diff --git a/src/ibc/core/channel/v1/tx.ts b/src/ibc/core/channel/v1/tx.ts index 586b460..10c49aa 100644 --- a/src/ibc/core/channel/v1/tx.ts +++ b/src/ibc/core/channel/v1/tx.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Channel, Packet } from "./channel"; import { Height } from "../../client/v1/client"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.core.channel.v1"; /** ResponseResultType defines the possible outcomes of the execution of a message */ export enum ResponseResultType { @@ -154,7 +154,7 @@ export interface MsgTimeout { packet: Packet; proofUnreceived: Uint8Array; proofHeight: Height; - nextSequenceRecv: Long; + nextSequenceRecv: bigint; signer: string; } /** MsgTimeoutResponse defines the Msg/Timeout response type. */ @@ -167,7 +167,7 @@ export interface MsgTimeoutOnClose { proofUnreceived: Uint8Array; proofClose: Uint8Array; proofHeight: Height; - nextSequenceRecv: Long; + nextSequenceRecv: bigint; signer: string; } /** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ @@ -194,7 +194,7 @@ function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { }; } export const MsgChannelOpenInit = { - encode(message: MsgChannelOpenInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -206,8 +206,8 @@ export const MsgChannelOpenInit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenInit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenInit(); while (reader.pos < end) { @@ -244,7 +244,7 @@ export const MsgChannelOpenInit = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgChannelOpenInit { + fromPartial(object: Partial): MsgChannelOpenInit { const message = createBaseMsgChannelOpenInit(); message.portId = object.portId ?? ""; if (object.channel !== undefined && object.channel !== null) { @@ -261,7 +261,7 @@ function createBaseMsgChannelOpenInitResponse(): MsgChannelOpenInitResponse { }; } export const MsgChannelOpenInitResponse = { - encode(message: MsgChannelOpenInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.channelId !== "") { writer.uint32(10).string(message.channelId); } @@ -270,8 +270,8 @@ export const MsgChannelOpenInitResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenInitResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenInitResponse(); while (reader.pos < end) { @@ -302,9 +302,7 @@ export const MsgChannelOpenInitResponse = { message.version !== undefined && (obj.version = message.version); return obj; }, - fromPartial, I>>( - object: I, - ): MsgChannelOpenInitResponse { + fromPartial(object: Partial): MsgChannelOpenInitResponse { const message = createBaseMsgChannelOpenInitResponse(); message.channelId = object.channelId ?? ""; message.version = object.version ?? ""; @@ -323,7 +321,7 @@ function createBaseMsgChannelOpenTry(): MsgChannelOpenTry { }; } export const MsgChannelOpenTry = { - encode(message: MsgChannelOpenTry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -347,8 +345,8 @@ export const MsgChannelOpenTry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenTry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenTry(); while (reader.pos < end) { @@ -409,7 +407,7 @@ export const MsgChannelOpenTry = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgChannelOpenTry { + fromPartial(object: Partial): MsgChannelOpenTry { const message = createBaseMsgChannelOpenTry(); message.portId = object.portId ?? ""; message.previousChannelId = object.previousChannelId ?? ""; @@ -432,7 +430,7 @@ function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { }; } export const MsgChannelOpenTryResponse = { - encode(message: MsgChannelOpenTryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); } @@ -441,8 +439,8 @@ export const MsgChannelOpenTryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenTryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenTryResponse(); while (reader.pos < end) { @@ -473,9 +471,7 @@ export const MsgChannelOpenTryResponse = { message.channelId !== undefined && (obj.channelId = message.channelId); return obj; }, - fromPartial, I>>( - object: I, - ): MsgChannelOpenTryResponse { + fromPartial(object: Partial): MsgChannelOpenTryResponse { const message = createBaseMsgChannelOpenTryResponse(); message.version = object.version ?? ""; message.channelId = object.channelId ?? ""; @@ -494,7 +490,7 @@ function createBaseMsgChannelOpenAck(): MsgChannelOpenAck { }; } export const MsgChannelOpenAck = { - encode(message: MsgChannelOpenAck, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -518,8 +514,8 @@ export const MsgChannelOpenAck = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenAck { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenAck(); while (reader.pos < end) { @@ -578,7 +574,7 @@ export const MsgChannelOpenAck = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgChannelOpenAck { + fromPartial(object: Partial): MsgChannelOpenAck { const message = createBaseMsgChannelOpenAck(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -596,11 +592,11 @@ function createBaseMsgChannelOpenAckResponse(): MsgChannelOpenAckResponse { return {}; } export const MsgChannelOpenAckResponse = { - encode(_: MsgChannelOpenAckResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgChannelOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenAckResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenAckResponse(); while (reader.pos < end) { @@ -621,7 +617,7 @@ export const MsgChannelOpenAckResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgChannelOpenAckResponse { + fromPartial(_: Partial): MsgChannelOpenAckResponse { const message = createBaseMsgChannelOpenAckResponse(); return message; }, @@ -636,7 +632,7 @@ function createBaseMsgChannelOpenConfirm(): MsgChannelOpenConfirm { }; } export const MsgChannelOpenConfirm = { - encode(message: MsgChannelOpenConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -654,8 +650,8 @@ export const MsgChannelOpenConfirm = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenConfirm { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenConfirm(); while (reader.pos < end) { @@ -703,7 +699,7 @@ export const MsgChannelOpenConfirm = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgChannelOpenConfirm { + fromPartial(object: Partial): MsgChannelOpenConfirm { const message = createBaseMsgChannelOpenConfirm(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -719,11 +715,11 @@ function createBaseMsgChannelOpenConfirmResponse(): MsgChannelOpenConfirmRespons return {}; } export const MsgChannelOpenConfirmResponse = { - encode(_: MsgChannelOpenConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgChannelOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelOpenConfirmResponse(); while (reader.pos < end) { @@ -744,9 +740,7 @@ export const MsgChannelOpenConfirmResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgChannelOpenConfirmResponse { + fromPartial(_: Partial): MsgChannelOpenConfirmResponse { const message = createBaseMsgChannelOpenConfirmResponse(); return message; }, @@ -759,7 +753,7 @@ function createBaseMsgChannelCloseInit(): MsgChannelCloseInit { }; } export const MsgChannelCloseInit = { - encode(message: MsgChannelCloseInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelCloseInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -771,8 +765,8 @@ export const MsgChannelCloseInit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseInit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelCloseInit(); while (reader.pos < end) { @@ -808,7 +802,7 @@ export const MsgChannelCloseInit = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgChannelCloseInit { + fromPartial(object: Partial): MsgChannelCloseInit { const message = createBaseMsgChannelCloseInit(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -820,11 +814,11 @@ function createBaseMsgChannelCloseInitResponse(): MsgChannelCloseInitResponse { return {}; } export const MsgChannelCloseInitResponse = { - encode(_: MsgChannelCloseInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgChannelCloseInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseInitResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelCloseInitResponse(); while (reader.pos < end) { @@ -845,9 +839,7 @@ export const MsgChannelCloseInitResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgChannelCloseInitResponse { + fromPartial(_: Partial): MsgChannelCloseInitResponse { const message = createBaseMsgChannelCloseInitResponse(); return message; }, @@ -862,7 +854,7 @@ function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { }; } export const MsgChannelCloseConfirm = { - encode(message: MsgChannelCloseConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChannelCloseConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.portId !== "") { writer.uint32(10).string(message.portId); } @@ -880,8 +872,8 @@ export const MsgChannelCloseConfirm = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseConfirm { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelCloseConfirm(); while (reader.pos < end) { @@ -931,7 +923,7 @@ export const MsgChannelCloseConfirm = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgChannelCloseConfirm { + fromPartial(object: Partial): MsgChannelCloseConfirm { const message = createBaseMsgChannelCloseConfirm(); message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; @@ -947,11 +939,11 @@ function createBaseMsgChannelCloseConfirmResponse(): MsgChannelCloseConfirmRespo return {}; } export const MsgChannelCloseConfirmResponse = { - encode(_: MsgChannelCloseConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgChannelCloseConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChannelCloseConfirmResponse(); while (reader.pos < end) { @@ -972,9 +964,7 @@ export const MsgChannelCloseConfirmResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgChannelCloseConfirmResponse { + fromPartial(_: Partial): MsgChannelCloseConfirmResponse { const message = createBaseMsgChannelCloseConfirmResponse(); return message; }, @@ -988,7 +978,7 @@ function createBaseMsgRecvPacket(): MsgRecvPacket { }; } export const MsgRecvPacket = { - encode(message: MsgRecvPacket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRecvPacket, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); } @@ -1003,8 +993,8 @@ export const MsgRecvPacket = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecvPacket { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacket { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRecvPacket(); while (reader.pos < end) { @@ -1049,7 +1039,7 @@ export const MsgRecvPacket = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgRecvPacket { + fromPartial(object: Partial): MsgRecvPacket { const message = createBaseMsgRecvPacket(); if (object.packet !== undefined && object.packet !== null) { message.packet = Packet.fromPartial(object.packet); @@ -1068,14 +1058,14 @@ function createBaseMsgRecvPacketResponse(): MsgRecvPacketResponse { }; } export const MsgRecvPacketResponse = { - encode(message: MsgRecvPacketResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRecvPacketResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecvPacketResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecvPacketResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRecvPacketResponse(); while (reader.pos < end) { @@ -1101,7 +1091,7 @@ export const MsgRecvPacketResponse = { message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); return obj; }, - fromPartial, I>>(object: I): MsgRecvPacketResponse { + fromPartial(object: Partial): MsgRecvPacketResponse { const message = createBaseMsgRecvPacketResponse(); message.result = object.result ?? 0; return message; @@ -1112,12 +1102,12 @@ function createBaseMsgTimeout(): MsgTimeout { packet: Packet.fromPartial({}), proofUnreceived: new Uint8Array(), proofHeight: Height.fromPartial({}), - nextSequenceRecv: Long.UZERO, + nextSequenceRecv: BigInt(0), signer: "", }; } export const MsgTimeout = { - encode(message: MsgTimeout, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); } @@ -1127,7 +1117,7 @@ export const MsgTimeout = { if (message.proofHeight !== undefined) { Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); } - if (!message.nextSequenceRecv.isZero()) { + if (message.nextSequenceRecv !== BigInt(0)) { writer.uint32(32).uint64(message.nextSequenceRecv); } if (message.signer !== "") { @@ -1135,8 +1125,8 @@ export const MsgTimeout = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeout { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTimeout(); while (reader.pos < end) { @@ -1152,7 +1142,7 @@ export const MsgTimeout = { message.proofHeight = Height.decode(reader, reader.uint32()); break; case 4: - message.nextSequenceRecv = reader.uint64() as Long; + message.nextSequenceRecv = reader.uint64(); break; case 5: message.signer = reader.string(); @@ -1169,7 +1159,7 @@ export const MsgTimeout = { if (isSet(object.packet)) obj.packet = Packet.fromJSON(object.packet); if (isSet(object.proofUnreceived)) obj.proofUnreceived = bytesFromBase64(object.proofUnreceived); if (isSet(object.proofHeight)) obj.proofHeight = Height.fromJSON(object.proofHeight); - if (isSet(object.nextSequenceRecv)) obj.nextSequenceRecv = Long.fromValue(object.nextSequenceRecv); + if (isSet(object.nextSequenceRecv)) obj.nextSequenceRecv = BigInt(object.nextSequenceRecv.toString()); if (isSet(object.signer)) obj.signer = String(object.signer); return obj; }, @@ -1183,11 +1173,11 @@ export const MsgTimeout = { message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); message.nextSequenceRecv !== undefined && - (obj.nextSequenceRecv = (message.nextSequenceRecv || Long.UZERO).toString()); + (obj.nextSequenceRecv = (message.nextSequenceRecv || BigInt(0)).toString()); message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgTimeout { + fromPartial(object: Partial): MsgTimeout { const message = createBaseMsgTimeout(); if (object.packet !== undefined && object.packet !== null) { message.packet = Packet.fromPartial(object.packet); @@ -1197,7 +1187,7 @@ export const MsgTimeout = { message.proofHeight = Height.fromPartial(object.proofHeight); } if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) { - message.nextSequenceRecv = Long.fromValue(object.nextSequenceRecv); + message.nextSequenceRecv = BigInt(object.nextSequenceRecv.toString()); } message.signer = object.signer ?? ""; return message; @@ -1209,14 +1199,14 @@ function createBaseMsgTimeoutResponse(): MsgTimeoutResponse { }; } export const MsgTimeoutResponse = { - encode(message: MsgTimeoutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTimeoutResponse(); while (reader.pos < end) { @@ -1242,7 +1232,7 @@ export const MsgTimeoutResponse = { message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); return obj; }, - fromPartial, I>>(object: I): MsgTimeoutResponse { + fromPartial(object: Partial): MsgTimeoutResponse { const message = createBaseMsgTimeoutResponse(); message.result = object.result ?? 0; return message; @@ -1254,12 +1244,12 @@ function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { proofUnreceived: new Uint8Array(), proofClose: new Uint8Array(), proofHeight: Height.fromPartial({}), - nextSequenceRecv: Long.UZERO, + nextSequenceRecv: BigInt(0), signer: "", }; } export const MsgTimeoutOnClose = { - encode(message: MsgTimeoutOnClose, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTimeoutOnClose, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); } @@ -1272,7 +1262,7 @@ export const MsgTimeoutOnClose = { if (message.proofHeight !== undefined) { Height.encode(message.proofHeight, writer.uint32(34).fork()).ldelim(); } - if (!message.nextSequenceRecv.isZero()) { + if (message.nextSequenceRecv !== BigInt(0)) { writer.uint32(40).uint64(message.nextSequenceRecv); } if (message.signer !== "") { @@ -1280,8 +1270,8 @@ export const MsgTimeoutOnClose = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutOnClose { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnClose { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTimeoutOnClose(); while (reader.pos < end) { @@ -1300,7 +1290,7 @@ export const MsgTimeoutOnClose = { message.proofHeight = Height.decode(reader, reader.uint32()); break; case 5: - message.nextSequenceRecv = reader.uint64() as Long; + message.nextSequenceRecv = reader.uint64(); break; case 6: message.signer = reader.string(); @@ -1318,7 +1308,7 @@ export const MsgTimeoutOnClose = { if (isSet(object.proofUnreceived)) obj.proofUnreceived = bytesFromBase64(object.proofUnreceived); if (isSet(object.proofClose)) obj.proofClose = bytesFromBase64(object.proofClose); if (isSet(object.proofHeight)) obj.proofHeight = Height.fromJSON(object.proofHeight); - if (isSet(object.nextSequenceRecv)) obj.nextSequenceRecv = Long.fromValue(object.nextSequenceRecv); + if (isSet(object.nextSequenceRecv)) obj.nextSequenceRecv = BigInt(object.nextSequenceRecv.toString()); if (isSet(object.signer)) obj.signer = String(object.signer); return obj; }, @@ -1336,11 +1326,11 @@ export const MsgTimeoutOnClose = { message.proofHeight !== undefined && (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); message.nextSequenceRecv !== undefined && - (obj.nextSequenceRecv = (message.nextSequenceRecv || Long.UZERO).toString()); + (obj.nextSequenceRecv = (message.nextSequenceRecv || BigInt(0)).toString()); message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgTimeoutOnClose { + fromPartial(object: Partial): MsgTimeoutOnClose { const message = createBaseMsgTimeoutOnClose(); if (object.packet !== undefined && object.packet !== null) { message.packet = Packet.fromPartial(object.packet); @@ -1351,7 +1341,7 @@ export const MsgTimeoutOnClose = { message.proofHeight = Height.fromPartial(object.proofHeight); } if (object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null) { - message.nextSequenceRecv = Long.fromValue(object.nextSequenceRecv); + message.nextSequenceRecv = BigInt(object.nextSequenceRecv.toString()); } message.signer = object.signer ?? ""; return message; @@ -1363,14 +1353,14 @@ function createBaseMsgTimeoutOnCloseResponse(): MsgTimeoutOnCloseResponse { }; } export const MsgTimeoutOnCloseResponse = { - encode(message: MsgTimeoutOnCloseResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgTimeoutOnCloseResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnCloseResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgTimeoutOnCloseResponse(); while (reader.pos < end) { @@ -1396,9 +1386,7 @@ export const MsgTimeoutOnCloseResponse = { message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); return obj; }, - fromPartial, I>>( - object: I, - ): MsgTimeoutOnCloseResponse { + fromPartial(object: Partial): MsgTimeoutOnCloseResponse { const message = createBaseMsgTimeoutOnCloseResponse(); message.result = object.result ?? 0; return message; @@ -1414,7 +1402,7 @@ function createBaseMsgAcknowledgement(): MsgAcknowledgement { }; } export const MsgAcknowledgement = { - encode(message: MsgAcknowledgement, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgAcknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.packet !== undefined) { Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); } @@ -1432,8 +1420,8 @@ export const MsgAcknowledgement = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcknowledgement { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAcknowledgement(); while (reader.pos < end) { @@ -1486,7 +1474,7 @@ export const MsgAcknowledgement = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgAcknowledgement { + fromPartial(object: Partial): MsgAcknowledgement { const message = createBaseMsgAcknowledgement(); if (object.packet !== undefined && object.packet !== null) { message.packet = Packet.fromPartial(object.packet); @@ -1506,14 +1494,14 @@ function createBaseMsgAcknowledgementResponse(): MsgAcknowledgementResponse { }; } export const MsgAcknowledgementResponse = { - encode(message: MsgAcknowledgementResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgAcknowledgementResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgAcknowledgementResponse(); while (reader.pos < end) { @@ -1539,9 +1527,7 @@ export const MsgAcknowledgementResponse = { message.result !== undefined && (obj.result = responseResultTypeToJSON(message.result)); return obj; }, - fromPartial, I>>( - object: I, - ): MsgAcknowledgementResponse { + fromPartial(object: Partial): MsgAcknowledgementResponse { const message = createBaseMsgAcknowledgementResponse(); message.result = object.result ?? 0; return message; @@ -1591,51 +1577,51 @@ export class MsgClientImpl implements Msg { ChannelOpenInit(request: MsgChannelOpenInit): Promise { const data = MsgChannelOpenInit.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenInit", data); - return promise.then((data) => MsgChannelOpenInitResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChannelOpenInitResponse.decode(new BinaryReader(data))); } ChannelOpenTry(request: MsgChannelOpenTry): Promise { const data = MsgChannelOpenTry.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenTry", data); - return promise.then((data) => MsgChannelOpenTryResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChannelOpenTryResponse.decode(new BinaryReader(data))); } ChannelOpenAck(request: MsgChannelOpenAck): Promise { const data = MsgChannelOpenAck.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenAck", data); - return promise.then((data) => MsgChannelOpenAckResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChannelOpenAckResponse.decode(new BinaryReader(data))); } ChannelOpenConfirm(request: MsgChannelOpenConfirm): Promise { const data = MsgChannelOpenConfirm.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelOpenConfirm", data); - return promise.then((data) => MsgChannelOpenConfirmResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChannelOpenConfirmResponse.decode(new BinaryReader(data))); } ChannelCloseInit(request: MsgChannelCloseInit): Promise { const data = MsgChannelCloseInit.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseInit", data); - return promise.then((data) => MsgChannelCloseInitResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChannelCloseInitResponse.decode(new BinaryReader(data))); } ChannelCloseConfirm(request: MsgChannelCloseConfirm): Promise { const data = MsgChannelCloseConfirm.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelCloseConfirm", data); - return promise.then((data) => MsgChannelCloseConfirmResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChannelCloseConfirmResponse.decode(new BinaryReader(data))); } RecvPacket(request: MsgRecvPacket): Promise { const data = MsgRecvPacket.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "RecvPacket", data); - return promise.then((data) => MsgRecvPacketResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRecvPacketResponse.decode(new BinaryReader(data))); } Timeout(request: MsgTimeout): Promise { const data = MsgTimeout.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Timeout", data); - return promise.then((data) => MsgTimeoutResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgTimeoutResponse.decode(new BinaryReader(data))); } TimeoutOnClose(request: MsgTimeoutOnClose): Promise { const data = MsgTimeoutOnClose.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "TimeoutOnClose", data); - return promise.then((data) => MsgTimeoutOnCloseResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgTimeoutOnCloseResponse.decode(new BinaryReader(data))); } Acknowledgement(request: MsgAcknowledgement): Promise { const data = MsgAcknowledgement.encode(request).finish(); const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); - return promise.then((data) => MsgAcknowledgementResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgAcknowledgementResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/core/client/v1/client.ts b/src/ibc/core/client/v1/client.ts index 3eed2c4..1dfadbf 100644 --- a/src/ibc/core/client/v1/client.ts +++ b/src/ibc/core/client/v1/client.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Any } from "../../../../google/protobuf/any"; import { Plan } from "../../../../cosmos/upgrade/v1beta1/upgrade"; -import { Long, isSet, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.core.client.v1"; /** * IdentifiedClientState defines a client state with an additional client @@ -85,9 +85,9 @@ export interface UpgradeProposal { */ export interface Height { /** the revision that the client is currently on */ - revisionNumber: Long; + revisionNumber: bigint; /** the height within the given revision */ - revisionHeight: Long; + revisionHeight: bigint; } /** Params defines the set of IBC light client parameters. */ export interface Params { @@ -105,7 +105,7 @@ function createBaseIdentifiedClientState(): IdentifiedClientState { }; } export const IdentifiedClientState = { - encode(message: IdentifiedClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -114,8 +114,8 @@ export const IdentifiedClientState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedClientState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedClientState(); while (reader.pos < end) { @@ -147,7 +147,7 @@ export const IdentifiedClientState = { (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); return obj; }, - fromPartial, I>>(object: I): IdentifiedClientState { + fromPartial(object: Partial): IdentifiedClientState { const message = createBaseIdentifiedClientState(); message.clientId = object.clientId ?? ""; if (object.clientState !== undefined && object.clientState !== null) { @@ -163,7 +163,7 @@ function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { }; } export const ConsensusStateWithHeight = { - encode(message: ConsensusStateWithHeight, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConsensusStateWithHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.height !== undefined) { Height.encode(message.height, writer.uint32(10).fork()).ldelim(); } @@ -172,8 +172,8 @@ export const ConsensusStateWithHeight = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusStateWithHeight { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusStateWithHeight(); while (reader.pos < end) { @@ -205,9 +205,7 @@ export const ConsensusStateWithHeight = { (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): ConsensusStateWithHeight { + fromPartial(object: Partial): ConsensusStateWithHeight { const message = createBaseConsensusStateWithHeight(); if (object.height !== undefined && object.height !== null) { message.height = Height.fromPartial(object.height); @@ -225,7 +223,7 @@ function createBaseClientConsensusStates(): ClientConsensusStates { }; } export const ClientConsensusStates = { - encode(message: ClientConsensusStates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -234,8 +232,8 @@ export const ClientConsensusStates = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientConsensusStates { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientConsensusStates(); while (reader.pos < end) { @@ -273,7 +271,7 @@ export const ClientConsensusStates = { } return obj; }, - fromPartial, I>>(object: I): ClientConsensusStates { + fromPartial(object: Partial): ClientConsensusStates { const message = createBaseClientConsensusStates(); message.clientId = object.clientId ?? ""; message.consensusStates = @@ -290,7 +288,7 @@ function createBaseClientUpdateProposal(): ClientUpdateProposal { }; } export const ClientUpdateProposal = { - encode(message: ClientUpdateProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -305,8 +303,8 @@ export const ClientUpdateProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientUpdateProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientUpdateProposal(); while (reader.pos < end) { @@ -347,7 +345,7 @@ export const ClientUpdateProposal = { message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); return obj; }, - fromPartial, I>>(object: I): ClientUpdateProposal { + fromPartial(object: Partial): ClientUpdateProposal { const message = createBaseClientUpdateProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -365,7 +363,7 @@ function createBaseUpgradeProposal(): UpgradeProposal { }; } export const UpgradeProposal = { - encode(message: UpgradeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -380,8 +378,8 @@ export const UpgradeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UpgradeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUpgradeProposal(); while (reader.pos < end) { @@ -425,7 +423,7 @@ export const UpgradeProposal = { : undefined); return obj; }, - fromPartial, I>>(object: I): UpgradeProposal { + fromPartial(object: Partial): UpgradeProposal { const message = createBaseUpgradeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -440,32 +438,32 @@ export const UpgradeProposal = { }; function createBaseHeight(): Height { return { - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), }; } export const Height = { - encode(message: Height, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.revisionNumber.isZero()) { + encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { writer.uint32(8).uint64(message.revisionNumber); } - if (!message.revisionHeight.isZero()) { + if (message.revisionHeight !== BigInt(0)) { writer.uint32(16).uint64(message.revisionHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Height { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeight(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revisionNumber = reader.uint64() as Long; + message.revisionNumber = reader.uint64(); break; case 2: - message.revisionHeight = reader.uint64() as Long; + message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -476,25 +474,25 @@ export const Height = { }, fromJSON(object: any): Height { const obj = createBaseHeight(); - if (isSet(object.revisionNumber)) obj.revisionNumber = Long.fromValue(object.revisionNumber); - if (isSet(object.revisionHeight)) obj.revisionHeight = Long.fromValue(object.revisionHeight); + if (isSet(object.revisionNumber)) obj.revisionNumber = BigInt(object.revisionNumber.toString()); + if (isSet(object.revisionHeight)) obj.revisionHeight = BigInt(object.revisionHeight.toString()); return obj; }, toJSON(message: Height): unknown { const obj: any = {}; message.revisionNumber !== undefined && - (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); message.revisionHeight !== undefined && - (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Height { + fromPartial(object: Partial): Height { const message = createBaseHeight(); if (object.revisionNumber !== undefined && object.revisionNumber !== null) { - message.revisionNumber = Long.fromValue(object.revisionNumber); + message.revisionNumber = BigInt(object.revisionNumber.toString()); } if (object.revisionHeight !== undefined && object.revisionHeight !== null) { - message.revisionHeight = Long.fromValue(object.revisionHeight); + message.revisionHeight = BigInt(object.revisionHeight.toString()); } return message; }, @@ -505,14 +503,14 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowedClients) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -543,7 +541,7 @@ export const Params = { } return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.allowedClients = object.allowedClients?.map((e) => e) || []; return message; diff --git a/src/ibc/core/client/v1/genesis.ts b/src/ibc/core/client/v1/genesis.ts index 256d39c..2cb2270 100644 --- a/src/ibc/core/client/v1/genesis.ts +++ b/src/ibc/core/client/v1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { IdentifiedClientState, ClientConsensusStates, Params } from "./client"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "ibc.core.client.v1"; /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisState { @@ -15,7 +15,7 @@ export interface GenesisState { /** create localhost on initialization */ createLocalhost: boolean; /** the sequence for the next generated client identifier */ - nextClientSequence: Long; + nextClientSequence: bigint; } /** * GenesisMetadata defines the genesis type for metadata that clients may return @@ -42,11 +42,11 @@ function createBaseGenesisState(): GenesisState { clientsMetadata: [], params: Params.fromPartial({}), createLocalhost: false, - nextClientSequence: Long.UZERO, + nextClientSequence: BigInt(0), }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clients) { IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -62,13 +62,13 @@ export const GenesisState = { if (message.createLocalhost === true) { writer.uint32(40).bool(message.createLocalhost); } - if (!message.nextClientSequence.isZero()) { + if (message.nextClientSequence !== BigInt(0)) { writer.uint32(48).uint64(message.nextClientSequence); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -90,7 +90,7 @@ export const GenesisState = { message.createLocalhost = reader.bool(); break; case 6: - message.nextClientSequence = reader.uint64() as Long; + message.nextClientSequence = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -109,7 +109,8 @@ export const GenesisState = { obj.clientsMetadata = object.clientsMetadata.map((e: any) => IdentifiedGenesisMetadata.fromJSON(e)); if (isSet(object.params)) obj.params = Params.fromJSON(object.params); if (isSet(object.createLocalhost)) obj.createLocalhost = Boolean(object.createLocalhost); - if (isSet(object.nextClientSequence)) obj.nextClientSequence = Long.fromValue(object.nextClientSequence); + if (isSet(object.nextClientSequence)) + obj.nextClientSequence = BigInt(object.nextClientSequence.toString()); return obj; }, toJSON(message: GenesisState): unknown { @@ -136,10 +137,10 @@ export const GenesisState = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); message.createLocalhost !== undefined && (obj.createLocalhost = message.createLocalhost); message.nextClientSequence !== undefined && - (obj.nextClientSequence = (message.nextClientSequence || Long.UZERO).toString()); + (obj.nextClientSequence = (message.nextClientSequence || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.clients = object.clients?.map((e) => IdentifiedClientState.fromPartial(e)) || []; message.clientsConsensus = @@ -151,7 +152,7 @@ export const GenesisState = { } message.createLocalhost = object.createLocalhost ?? false; if (object.nextClientSequence !== undefined && object.nextClientSequence !== null) { - message.nextClientSequence = Long.fromValue(object.nextClientSequence); + message.nextClientSequence = BigInt(object.nextClientSequence.toString()); } return message; }, @@ -163,7 +164,7 @@ function createBaseGenesisMetadata(): GenesisMetadata { }; } export const GenesisMetadata = { - encode(message: GenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -172,8 +173,8 @@ export const GenesisMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisMetadata(); while (reader.pos < end) { @@ -206,7 +207,7 @@ export const GenesisMetadata = { (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): GenesisMetadata { + fromPartial(object: Partial): GenesisMetadata { const message = createBaseGenesisMetadata(); message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); @@ -220,7 +221,7 @@ function createBaseIdentifiedGenesisMetadata(): IdentifiedGenesisMetadata { }; } export const IdentifiedGenesisMetadata = { - encode(message: IdentifiedGenesisMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IdentifiedGenesisMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -229,8 +230,8 @@ export const IdentifiedGenesisMetadata = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedGenesisMetadata { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedGenesisMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedGenesisMetadata(); while (reader.pos < end) { @@ -266,9 +267,7 @@ export const IdentifiedGenesisMetadata = { } return obj; }, - fromPartial, I>>( - object: I, - ): IdentifiedGenesisMetadata { + fromPartial(object: Partial): IdentifiedGenesisMetadata { const message = createBaseIdentifiedGenesisMetadata(); message.clientId = object.clientId ?? ""; message.clientMetadata = object.clientMetadata?.map((e) => GenesisMetadata.fromPartial(e)) || []; diff --git a/src/ibc/core/client/v1/query.ts b/src/ibc/core/client/v1/query.ts index 735105d..5637a13 100644 --- a/src/ibc/core/client/v1/query.ts +++ b/src/ibc/core/client/v1/query.ts @@ -2,8 +2,8 @@ import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination"; import { Any } from "../../../../google/protobuf/any"; import { Height, IdentifiedClientState, ConsensusStateWithHeight, Params } from "./client"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.core.client.v1"; /** * QueryClientStateRequest is the request type for the Query/ClientState RPC @@ -53,9 +53,9 @@ export interface QueryConsensusStateRequest { /** client identifier */ clientId: string; /** consensus state revision number */ - revisionNumber: Long; + revisionNumber: bigint; /** consensus state revision height */ - revisionHeight: Long; + revisionHeight: bigint; /** * latest_height overrrides the height field and queries the latest stored * ConsensusState @@ -174,14 +174,14 @@ function createBaseQueryClientStateRequest(): QueryClientStateRequest { }; } export const QueryClientStateRequest = { - encode(message: QueryClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStateRequest(); while (reader.pos < end) { @@ -207,7 +207,7 @@ export const QueryClientStateRequest = { message.clientId !== undefined && (obj.clientId = message.clientId); return obj; }, - fromPartial, I>>(object: I): QueryClientStateRequest { + fromPartial(object: Partial): QueryClientStateRequest { const message = createBaseQueryClientStateRequest(); message.clientId = object.clientId ?? ""; return message; @@ -221,7 +221,7 @@ function createBaseQueryClientStateResponse(): QueryClientStateResponse { }; } export const QueryClientStateResponse = { - encode(message: QueryClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientState !== undefined) { Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); } @@ -233,8 +233,8 @@ export const QueryClientStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStateResponse(); while (reader.pos < end) { @@ -273,9 +273,7 @@ export const QueryClientStateResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientStateResponse { + fromPartial(object: Partial): QueryClientStateResponse { const message = createBaseQueryClientStateResponse(); if (object.clientState !== undefined && object.clientState !== null) { message.clientState = Any.fromPartial(object.clientState); @@ -293,14 +291,14 @@ function createBaseQueryClientStatesRequest(): QueryClientStatesRequest { }; } export const QueryClientStatesRequest = { - encode(message: QueryClientStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatesRequest(); while (reader.pos < end) { @@ -327,9 +325,7 @@ export const QueryClientStatesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientStatesRequest { + fromPartial(object: Partial): QueryClientStatesRequest { const message = createBaseQueryClientStatesRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -344,7 +340,7 @@ function createBaseQueryClientStatesResponse(): QueryClientStatesResponse { }; } export const QueryClientStatesResponse = { - encode(message: QueryClientStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.clientStates) { IdentifiedClientState.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -353,8 +349,8 @@ export const QueryClientStatesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatesResponse(); while (reader.pos < end) { @@ -391,9 +387,7 @@ export const QueryClientStatesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientStatesResponse { + fromPartial(object: Partial): QueryClientStatesResponse { const message = createBaseQueryClientStatesResponse(); message.clientStates = object.clientStates?.map((e) => IdentifiedClientState.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -405,20 +399,20 @@ export const QueryClientStatesResponse = { function createBaseQueryConsensusStateRequest(): QueryConsensusStateRequest { return { clientId: "", - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), latestHeight: false, }; } export const QueryConsensusStateRequest = { - encode(message: QueryConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } - if (!message.revisionNumber.isZero()) { + if (message.revisionNumber !== BigInt(0)) { writer.uint32(16).uint64(message.revisionNumber); } - if (!message.revisionHeight.isZero()) { + if (message.revisionHeight !== BigInt(0)) { writer.uint32(24).uint64(message.revisionHeight); } if (message.latestHeight === true) { @@ -426,8 +420,8 @@ export const QueryConsensusStateRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateRequest(); while (reader.pos < end) { @@ -437,10 +431,10 @@ export const QueryConsensusStateRequest = { message.clientId = reader.string(); break; case 2: - message.revisionNumber = reader.uint64() as Long; + message.revisionNumber = reader.uint64(); break; case 3: - message.revisionHeight = reader.uint64() as Long; + message.revisionHeight = reader.uint64(); break; case 4: message.latestHeight = reader.bool(); @@ -455,8 +449,8 @@ export const QueryConsensusStateRequest = { fromJSON(object: any): QueryConsensusStateRequest { const obj = createBaseQueryConsensusStateRequest(); if (isSet(object.clientId)) obj.clientId = String(object.clientId); - if (isSet(object.revisionNumber)) obj.revisionNumber = Long.fromValue(object.revisionNumber); - if (isSet(object.revisionHeight)) obj.revisionHeight = Long.fromValue(object.revisionHeight); + if (isSet(object.revisionNumber)) obj.revisionNumber = BigInt(object.revisionNumber.toString()); + if (isSet(object.revisionHeight)) obj.revisionHeight = BigInt(object.revisionHeight.toString()); if (isSet(object.latestHeight)) obj.latestHeight = Boolean(object.latestHeight); return obj; }, @@ -464,22 +458,20 @@ export const QueryConsensusStateRequest = { const obj: any = {}; message.clientId !== undefined && (obj.clientId = message.clientId); message.revisionNumber !== undefined && - (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); message.revisionHeight !== undefined && - (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); message.latestHeight !== undefined && (obj.latestHeight = message.latestHeight); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConsensusStateRequest { + fromPartial(object: Partial): QueryConsensusStateRequest { const message = createBaseQueryConsensusStateRequest(); message.clientId = object.clientId ?? ""; if (object.revisionNumber !== undefined && object.revisionNumber !== null) { - message.revisionNumber = Long.fromValue(object.revisionNumber); + message.revisionNumber = BigInt(object.revisionNumber.toString()); } if (object.revisionHeight !== undefined && object.revisionHeight !== null) { - message.revisionHeight = Long.fromValue(object.revisionHeight); + message.revisionHeight = BigInt(object.revisionHeight.toString()); } message.latestHeight = object.latestHeight ?? false; return message; @@ -493,7 +485,7 @@ function createBaseQueryConsensusStateResponse(): QueryConsensusStateResponse { }; } export const QueryConsensusStateResponse = { - encode(message: QueryConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConsensusStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); } @@ -505,8 +497,8 @@ export const QueryConsensusStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateResponse(); while (reader.pos < end) { @@ -545,9 +537,7 @@ export const QueryConsensusStateResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConsensusStateResponse { + fromPartial(object: Partial): QueryConsensusStateResponse { const message = createBaseQueryConsensusStateResponse(); if (object.consensusState !== undefined && object.consensusState !== null) { message.consensusState = Any.fromPartial(object.consensusState); @@ -566,7 +556,7 @@ function createBaseQueryConsensusStatesRequest(): QueryConsensusStatesRequest { }; } export const QueryConsensusStatesRequest = { - encode(message: QueryConsensusStatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConsensusStatesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -575,8 +565,8 @@ export const QueryConsensusStatesRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStatesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStatesRequest(); while (reader.pos < end) { @@ -608,9 +598,7 @@ export const QueryConsensusStatesRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConsensusStatesRequest { + fromPartial(object: Partial): QueryConsensusStatesRequest { const message = createBaseQueryConsensusStatesRequest(); message.clientId = object.clientId ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -626,7 +614,7 @@ function createBaseQueryConsensusStatesResponse(): QueryConsensusStatesResponse }; } export const QueryConsensusStatesResponse = { - encode(message: QueryConsensusStatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConsensusStatesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.consensusStates) { ConsensusStateWithHeight.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -635,8 +623,8 @@ export const QueryConsensusStatesResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStatesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStatesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStatesResponse(); while (reader.pos < end) { @@ -675,9 +663,7 @@ export const QueryConsensusStatesResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConsensusStatesResponse { + fromPartial(object: Partial): QueryConsensusStatesResponse { const message = createBaseQueryConsensusStatesResponse(); message.consensusStates = object.consensusStates?.map((e) => ConsensusStateWithHeight.fromPartial(e)) || []; @@ -694,7 +680,10 @@ function createBaseQueryConsensusStateHeightsRequest(): QueryConsensusStateHeigh }; } export const QueryConsensusStateHeightsRequest = { - encode(message: QueryConsensusStateHeightsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryConsensusStateHeightsRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -703,8 +692,8 @@ export const QueryConsensusStateHeightsRequest = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateHeightsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateHeightsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateHeightsRequest(); while (reader.pos < end) { @@ -736,9 +725,7 @@ export const QueryConsensusStateHeightsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConsensusStateHeightsRequest { + fromPartial(object: Partial): QueryConsensusStateHeightsRequest { const message = createBaseQueryConsensusStateHeightsRequest(); message.clientId = object.clientId ?? ""; if (object.pagination !== undefined && object.pagination !== null) { @@ -754,7 +741,10 @@ function createBaseQueryConsensusStateHeightsResponse(): QueryConsensusStateHeig }; } export const QueryConsensusStateHeightsResponse = { - encode(message: QueryConsensusStateHeightsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryConsensusStateHeightsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.consensusStateHeights) { Height.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -763,8 +753,8 @@ export const QueryConsensusStateHeightsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConsensusStateHeightsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConsensusStateHeightsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConsensusStateHeightsResponse(); while (reader.pos < end) { @@ -803,9 +793,7 @@ export const QueryConsensusStateHeightsResponse = { (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConsensusStateHeightsResponse { + fromPartial(object: Partial): QueryConsensusStateHeightsResponse { const message = createBaseQueryConsensusStateHeightsResponse(); message.consensusStateHeights = object.consensusStateHeights?.map((e) => Height.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -820,14 +808,14 @@ function createBaseQueryClientStatusRequest(): QueryClientStatusRequest { }; } export const QueryClientStatusRequest = { - encode(message: QueryClientStatusRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientStatusRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatusRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatusRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatusRequest(); while (reader.pos < end) { @@ -853,9 +841,7 @@ export const QueryClientStatusRequest = { message.clientId !== undefined && (obj.clientId = message.clientId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientStatusRequest { + fromPartial(object: Partial): QueryClientStatusRequest { const message = createBaseQueryClientStatusRequest(); message.clientId = object.clientId ?? ""; return message; @@ -867,14 +853,14 @@ function createBaseQueryClientStatusResponse(): QueryClientStatusResponse { }; } export const QueryClientStatusResponse = { - encode(message: QueryClientStatusResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientStatusResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== "") { writer.uint32(10).string(message.status); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientStatusResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientStatusResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientStatusResponse(); while (reader.pos < end) { @@ -900,9 +886,7 @@ export const QueryClientStatusResponse = { message.status !== undefined && (obj.status = message.status); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientStatusResponse { + fromPartial(object: Partial): QueryClientStatusResponse { const message = createBaseQueryClientStatusResponse(); message.status = object.status ?? ""; return message; @@ -912,11 +896,11 @@ function createBaseQueryClientParamsRequest(): QueryClientParamsRequest { return {}; } export const QueryClientParamsRequest = { - encode(_: QueryClientParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryClientParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientParamsRequest(); while (reader.pos < end) { @@ -937,7 +921,7 @@ export const QueryClientParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryClientParamsRequest { + fromPartial(_: Partial): QueryClientParamsRequest { const message = createBaseQueryClientParamsRequest(); return message; }, @@ -948,14 +932,14 @@ function createBaseQueryClientParamsResponse(): QueryClientParamsResponse { }; } export const QueryClientParamsResponse = { - encode(message: QueryClientParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientParamsResponse(); while (reader.pos < end) { @@ -981,9 +965,7 @@ export const QueryClientParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientParamsResponse { + fromPartial(object: Partial): QueryClientParamsResponse { const message = createBaseQueryClientParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -995,11 +977,11 @@ function createBaseQueryUpgradedClientStateRequest(): QueryUpgradedClientStateRe return {}; } export const QueryUpgradedClientStateRequest = { - encode(_: QueryUpgradedClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryUpgradedClientStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedClientStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedClientStateRequest(); while (reader.pos < end) { @@ -1020,9 +1002,7 @@ export const QueryUpgradedClientStateRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryUpgradedClientStateRequest { + fromPartial(_: Partial): QueryUpgradedClientStateRequest { const message = createBaseQueryUpgradedClientStateRequest(); return message; }, @@ -1033,14 +1013,17 @@ function createBaseQueryUpgradedClientStateResponse(): QueryUpgradedClientStateR }; } export const QueryUpgradedClientStateResponse = { - encode(message: QueryUpgradedClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUpgradedClientStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.upgradedClientState !== undefined) { Any.encode(message.upgradedClientState, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedClientStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedClientStateResponse(); while (reader.pos < end) { @@ -1069,9 +1052,7 @@ export const QueryUpgradedClientStateResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUpgradedClientStateResponse { + fromPartial(object: Partial): QueryUpgradedClientStateResponse { const message = createBaseQueryUpgradedClientStateResponse(); if (object.upgradedClientState !== undefined && object.upgradedClientState !== null) { message.upgradedClientState = Any.fromPartial(object.upgradedClientState); @@ -1083,11 +1064,11 @@ function createBaseQueryUpgradedConsensusStateRequest(): QueryUpgradedConsensusS return {}; } export const QueryUpgradedConsensusStateRequest = { - encode(_: QueryUpgradedConsensusStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryUpgradedConsensusStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateRequest(); while (reader.pos < end) { @@ -1108,9 +1089,7 @@ export const QueryUpgradedConsensusStateRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryUpgradedConsensusStateRequest { + fromPartial(_: Partial): QueryUpgradedConsensusStateRequest { const message = createBaseQueryUpgradedConsensusStateRequest(); return message; }, @@ -1121,14 +1100,17 @@ function createBaseQueryUpgradedConsensusStateResponse(): QueryUpgradedConsensus }; } export const QueryUpgradedConsensusStateResponse = { - encode(message: QueryUpgradedConsensusStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUpgradedConsensusStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.upgradedConsensusState !== undefined) { Any.encode(message.upgradedConsensusState, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradedConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUpgradedConsensusStateResponse(); while (reader.pos < end) { @@ -1158,9 +1140,7 @@ export const QueryUpgradedConsensusStateResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUpgradedConsensusStateResponse { + fromPartial(object: Partial): QueryUpgradedConsensusStateResponse { const message = createBaseQueryUpgradedConsensusStateResponse(); if (object.upgradedConsensusState !== undefined && object.upgradedConsensusState !== null) { message.upgradedConsensusState = Any.fromPartial(object.upgradedConsensusState); @@ -1216,7 +1196,7 @@ export class QueryClientImpl implements Query { ClientState(request: QueryClientStateRequest): Promise { const data = QueryClientStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientState", data); - return promise.then((data) => QueryClientStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClientStateResponse.decode(new BinaryReader(data))); } ClientStates( request: QueryClientStatesRequest = { @@ -1225,47 +1205,47 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryClientStatesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStates", data); - return promise.then((data) => QueryClientStatesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClientStatesResponse.decode(new BinaryReader(data))); } ConsensusState(request: QueryConsensusStateRequest): Promise { const data = QueryConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusState", data); - return promise.then((data) => QueryConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConsensusStateResponse.decode(new BinaryReader(data))); } ConsensusStates(request: QueryConsensusStatesRequest): Promise { const data = QueryConsensusStatesRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStates", data); - return promise.then((data) => QueryConsensusStatesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConsensusStatesResponse.decode(new BinaryReader(data))); } ConsensusStateHeights( request: QueryConsensusStateHeightsRequest, ): Promise { const data = QueryConsensusStateHeightsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ConsensusStateHeights", data); - return promise.then((data) => QueryConsensusStateHeightsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConsensusStateHeightsResponse.decode(new BinaryReader(data))); } ClientStatus(request: QueryClientStatusRequest): Promise { const data = QueryClientStatusRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientStatus", data); - return promise.then((data) => QueryClientStatusResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClientStatusResponse.decode(new BinaryReader(data))); } ClientParams(request: QueryClientParamsRequest = {}): Promise { const data = QueryClientParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "ClientParams", data); - return promise.then((data) => QueryClientParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClientParamsResponse.decode(new BinaryReader(data))); } UpgradedClientState( request: QueryUpgradedClientStateRequest = {}, ): Promise { const data = QueryUpgradedClientStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedClientState", data); - return promise.then((data) => QueryUpgradedClientStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUpgradedClientStateResponse.decode(new BinaryReader(data))); } UpgradedConsensusState( request: QueryUpgradedConsensusStateRequest = {}, ): Promise { const data = QueryUpgradedConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data); - return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/core/client/v1/tx.amino.ts b/src/ibc/core/client/v1/tx.amino.ts new file mode 100644 index 0000000..f29353b --- /dev/null +++ b/src/ibc/core/client/v1/tx.amino.ts @@ -0,0 +1,202 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +export interface MsgCreateClientAminoType extends AminoMsg { + type: "cosmos-sdk/MsgCreateClient"; + value: { + client_state: { + type_url: string; + value: Uint8Array; + }; + consensus_state: { + type_url: string; + value: Uint8Array; + }; + signer: string; + }; +} +export interface MsgUpdateClientAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpdateClient"; + value: { + client_id: string; + client_message: { + type_url: string; + value: Uint8Array; + }; + signer: string; + }; +} +export interface MsgUpgradeClientAminoType extends AminoMsg { + type: "cosmos-sdk/MsgUpgradeClient"; + value: { + client_id: string; + client_state: { + type_url: string; + value: Uint8Array; + }; + consensus_state: { + type_url: string; + value: Uint8Array; + }; + proof_upgrade_client: Uint8Array; + proof_upgrade_consensus_state: Uint8Array; + signer: string; + }; +} +export interface MsgSubmitMisbehaviourAminoType extends AminoMsg { + type: "cosmos-sdk/MsgSubmitMisbehaviour"; + value: { + client_id: string; + misbehaviour: { + type_url: string; + value: Uint8Array; + }; + signer: string; + }; +} +export const AminoConverter = { + "/ibc.core.client.v1.MsgCreateClient": { + aminoType: "cosmos-sdk/MsgCreateClient", + toAmino: ({ + clientState, + consensusState, + signer, + }: MsgCreateClient): MsgCreateClientAminoType["value"] => { + return { + client_state: { + type_url: clientState.typeUrl, + value: clientState.value, + }, + consensus_state: { + type_url: consensusState.typeUrl, + value: consensusState.value, + }, + signer, + }; + }, + fromAmino: ({ + client_state, + consensus_state, + signer, + }: MsgCreateClientAminoType["value"]): MsgCreateClient => { + return { + clientState: { + typeUrl: client_state.type_url, + value: client_state.value, + }, + consensusState: { + typeUrl: consensus_state.type_url, + value: consensus_state.value, + }, + signer, + }; + }, + }, + "/ibc.core.client.v1.MsgUpdateClient": { + aminoType: "cosmos-sdk/MsgUpdateClient", + toAmino: ({ clientId, clientMessage, signer }: MsgUpdateClient): MsgUpdateClientAminoType["value"] => { + return { + client_id: clientId, + client_message: { + type_url: clientMessage.typeUrl, + value: clientMessage.value, + }, + signer, + }; + }, + fromAmino: ({ + client_id, + client_message, + signer, + }: MsgUpdateClientAminoType["value"]): MsgUpdateClient => { + return { + clientId: client_id, + clientMessage: { + typeUrl: client_message.type_url, + value: client_message.value, + }, + signer, + }; + }, + }, + "/ibc.core.client.v1.MsgUpgradeClient": { + aminoType: "cosmos-sdk/MsgUpgradeClient", + toAmino: ({ + clientId, + clientState, + consensusState, + proofUpgradeClient, + proofUpgradeConsensusState, + signer, + }: MsgUpgradeClient): MsgUpgradeClientAminoType["value"] => { + return { + client_id: clientId, + client_state: { + type_url: clientState.typeUrl, + value: clientState.value, + }, + consensus_state: { + type_url: consensusState.typeUrl, + value: consensusState.value, + }, + proof_upgrade_client: proofUpgradeClient, + proof_upgrade_consensus_state: proofUpgradeConsensusState, + signer, + }; + }, + fromAmino: ({ + client_id, + client_state, + consensus_state, + proof_upgrade_client, + proof_upgrade_consensus_state, + signer, + }: MsgUpgradeClientAminoType["value"]): MsgUpgradeClient => { + return { + clientId: client_id, + clientState: { + typeUrl: client_state.type_url, + value: client_state.value, + }, + consensusState: { + typeUrl: consensus_state.type_url, + value: consensus_state.value, + }, + proofUpgradeClient: proof_upgrade_client, + proofUpgradeConsensusState: proof_upgrade_consensus_state, + signer, + }; + }, + }, + "/ibc.core.client.v1.MsgSubmitMisbehaviour": { + aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", + toAmino: ({ + clientId, + misbehaviour, + signer, + }: MsgSubmitMisbehaviour): MsgSubmitMisbehaviourAminoType["value"] => { + return { + client_id: clientId, + misbehaviour: { + type_url: misbehaviour.typeUrl, + value: misbehaviour.value, + }, + signer, + }; + }, + fromAmino: ({ + client_id, + misbehaviour, + signer, + }: MsgSubmitMisbehaviourAminoType["value"]): MsgSubmitMisbehaviour => { + return { + clientId: client_id, + misbehaviour: { + typeUrl: misbehaviour.type_url, + value: misbehaviour.value, + }, + signer, + }; + }, + }, +}; diff --git a/src/ibc/core/client/v1/tx.registry.ts b/src/ibc/core/client/v1/tx.registry.ts new file mode 100644 index 0000000..85d03e1 --- /dev/null +++ b/src/ibc/core/client/v1/tx.registry.ts @@ -0,0 +1,147 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], + ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], + ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], + ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.encode(value).finish(), + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.encode(value).finish(), + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.encode(value).finish(), + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value, + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value, + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value, + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value, + }; + }, + }, + toJSON: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.toJSON(value), + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.toJSON(value), + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.toJSON(value), + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.toJSON(value), + }; + }, + }, + fromJSON: { + createClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.fromJSON(value), + }; + }, + updateClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.fromJSON(value), + }; + }, + upgradeClient(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.fromJSON(value), + }; + }, + submitMisbehaviour(value: any) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.fromJSON(value), + }; + }, + }, + fromPartial: { + createClient(value: MsgCreateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgCreateClient", + value: MsgCreateClient.fromPartial(value), + }; + }, + updateClient(value: MsgUpdateClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateClient", + value: MsgUpdateClient.fromPartial(value), + }; + }, + upgradeClient(value: MsgUpgradeClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpgradeClient", + value: MsgUpgradeClient.fromPartial(value), + }; + }, + submitMisbehaviour(value: MsgSubmitMisbehaviour) { + return { + typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", + value: MsgSubmitMisbehaviour.fromPartial(value), + }; + }, + }, +}; diff --git a/src/ibc/core/client/v1/tx.ts b/src/ibc/core/client/v1/tx.ts index d918aa7..19e682b 100644 --- a/src/ibc/core/client/v1/tx.ts +++ b/src/ibc/core/client/v1/tx.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../../google/protobuf/any"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.core.client.v1"; /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClient { @@ -83,7 +83,7 @@ function createBaseMsgCreateClient(): MsgCreateClient { }; } export const MsgCreateClient = { - encode(message: MsgCreateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgCreateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientState !== undefined) { Any.encode(message.clientState, writer.uint32(10).fork()).ldelim(); } @@ -95,8 +95,8 @@ export const MsgCreateClient = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClient { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClient(); while (reader.pos < end) { @@ -134,7 +134,7 @@ export const MsgCreateClient = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgCreateClient { + fromPartial(object: Partial): MsgCreateClient { const message = createBaseMsgCreateClient(); if (object.clientState !== undefined && object.clientState !== null) { message.clientState = Any.fromPartial(object.clientState); @@ -150,11 +150,11 @@ function createBaseMsgCreateClientResponse(): MsgCreateClientResponse { return {}; } export const MsgCreateClientResponse = { - encode(_: MsgCreateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgCreateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateClientResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgCreateClientResponse(); while (reader.pos < end) { @@ -175,7 +175,7 @@ export const MsgCreateClientResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgCreateClientResponse { + fromPartial(_: Partial): MsgCreateClientResponse { const message = createBaseMsgCreateClientResponse(); return message; }, @@ -188,7 +188,7 @@ function createBaseMsgUpdateClient(): MsgUpdateClient { }; } export const MsgUpdateClient = { - encode(message: MsgUpdateClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -200,8 +200,8 @@ export const MsgUpdateClient = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClient { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClient(); while (reader.pos < end) { @@ -238,7 +238,7 @@ export const MsgUpdateClient = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgUpdateClient { + fromPartial(object: Partial): MsgUpdateClient { const message = createBaseMsgUpdateClient(); message.clientId = object.clientId ?? ""; if (object.clientMessage !== undefined && object.clientMessage !== null) { @@ -252,11 +252,11 @@ function createBaseMsgUpdateClientResponse(): MsgUpdateClientResponse { return {}; } export const MsgUpdateClientResponse = { - encode(_: MsgUpdateClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateClientResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateClientResponse(); while (reader.pos < end) { @@ -277,7 +277,7 @@ export const MsgUpdateClientResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateClientResponse { + fromPartial(_: Partial): MsgUpdateClientResponse { const message = createBaseMsgUpdateClientResponse(); return message; }, @@ -293,7 +293,7 @@ function createBaseMsgUpgradeClient(): MsgUpgradeClient { }; } export const MsgUpgradeClient = { - encode(message: MsgUpgradeClient, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpgradeClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -314,8 +314,8 @@ export const MsgUpgradeClient = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClient { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpgradeClient(); while (reader.pos < end) { @@ -377,7 +377,7 @@ export const MsgUpgradeClient = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgUpgradeClient { + fromPartial(object: Partial): MsgUpgradeClient { const message = createBaseMsgUpgradeClient(); message.clientId = object.clientId ?? ""; if (object.clientState !== undefined && object.clientState !== null) { @@ -396,11 +396,11 @@ function createBaseMsgUpgradeClientResponse(): MsgUpgradeClientResponse { return {}; } export const MsgUpgradeClientResponse = { - encode(_: MsgUpgradeClientResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpgradeClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpgradeClientResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpgradeClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpgradeClientResponse(); while (reader.pos < end) { @@ -421,7 +421,7 @@ export const MsgUpgradeClientResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpgradeClientResponse { + fromPartial(_: Partial): MsgUpgradeClientResponse { const message = createBaseMsgUpgradeClientResponse(); return message; }, @@ -434,7 +434,7 @@ function createBaseMsgSubmitMisbehaviour(): MsgSubmitMisbehaviour { }; } export const MsgSubmitMisbehaviour = { - encode(message: MsgSubmitMisbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgSubmitMisbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -446,8 +446,8 @@ export const MsgSubmitMisbehaviour = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviour { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitMisbehaviour(); while (reader.pos < end) { @@ -484,7 +484,7 @@ export const MsgSubmitMisbehaviour = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgSubmitMisbehaviour { + fromPartial(object: Partial): MsgSubmitMisbehaviour { const message = createBaseMsgSubmitMisbehaviour(); message.clientId = object.clientId ?? ""; if (object.misbehaviour !== undefined && object.misbehaviour !== null) { @@ -498,11 +498,11 @@ function createBaseMsgSubmitMisbehaviourResponse(): MsgSubmitMisbehaviourRespons return {}; } export const MsgSubmitMisbehaviourResponse = { - encode(_: MsgSubmitMisbehaviourResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgSubmitMisbehaviourResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitMisbehaviourResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgSubmitMisbehaviourResponse(); while (reader.pos < end) { @@ -523,9 +523,7 @@ export const MsgSubmitMisbehaviourResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgSubmitMisbehaviourResponse { + fromPartial(_: Partial): MsgSubmitMisbehaviourResponse { const message = createBaseMsgSubmitMisbehaviourResponse(); return message; }, @@ -553,21 +551,21 @@ export class MsgClientImpl implements Msg { CreateClient(request: MsgCreateClient): Promise { const data = MsgCreateClient.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "CreateClient", data); - return promise.then((data) => MsgCreateClientResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgCreateClientResponse.decode(new BinaryReader(data))); } UpdateClient(request: MsgUpdateClient): Promise { const data = MsgUpdateClient.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClient", data); - return promise.then((data) => MsgUpdateClientResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateClientResponse.decode(new BinaryReader(data))); } UpgradeClient(request: MsgUpgradeClient): Promise { const data = MsgUpgradeClient.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpgradeClient", data); - return promise.then((data) => MsgUpgradeClientResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpgradeClientResponse.decode(new BinaryReader(data))); } SubmitMisbehaviour(request: MsgSubmitMisbehaviour): Promise { const data = MsgSubmitMisbehaviour.encode(request).finish(); const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); - return promise.then((data) => MsgSubmitMisbehaviourResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/core/commitment/v1/commitment.ts b/src/ibc/core/commitment/v1/commitment.ts index 1c7b529..b994fe8 100644 --- a/src/ibc/core/commitment/v1/commitment.ts +++ b/src/ibc/core/commitment/v1/commitment.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { CommitmentProof } from "../../../../cosmos/ics23/v1/proofs"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "ibc.core.commitment.v1"; /** * MerkleRoot defines a merkle root hash. @@ -42,14 +42,14 @@ function createBaseMerkleRoot(): MerkleRoot { }; } export const MerkleRoot = { - encode(message: MerkleRoot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MerkleRoot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MerkleRoot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MerkleRoot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMerkleRoot(); while (reader.pos < end) { @@ -76,7 +76,7 @@ export const MerkleRoot = { (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): MerkleRoot { + fromPartial(object: Partial): MerkleRoot { const message = createBaseMerkleRoot(); message.hash = object.hash ?? new Uint8Array(); return message; @@ -88,14 +88,14 @@ function createBaseMerklePrefix(): MerklePrefix { }; } export const MerklePrefix = { - encode(message: MerklePrefix, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MerklePrefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.keyPrefix.length !== 0) { writer.uint32(10).bytes(message.keyPrefix); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MerklePrefix { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MerklePrefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMerklePrefix(); while (reader.pos < end) { @@ -124,7 +124,7 @@ export const MerklePrefix = { )); return obj; }, - fromPartial, I>>(object: I): MerklePrefix { + fromPartial(object: Partial): MerklePrefix { const message = createBaseMerklePrefix(); message.keyPrefix = object.keyPrefix ?? new Uint8Array(); return message; @@ -136,14 +136,14 @@ function createBaseMerklePath(): MerklePath { }; } export const MerklePath = { - encode(message: MerklePath, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MerklePath, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.keyPath) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MerklePath { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MerklePath { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMerklePath(); while (reader.pos < end) { @@ -173,7 +173,7 @@ export const MerklePath = { } return obj; }, - fromPartial, I>>(object: I): MerklePath { + fromPartial(object: Partial): MerklePath { const message = createBaseMerklePath(); message.keyPath = object.keyPath?.map((e) => e) || []; return message; @@ -185,14 +185,14 @@ function createBaseMerkleProof(): MerkleProof { }; } export const MerkleProof = { - encode(message: MerkleProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MerkleProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.proofs) { CommitmentProof.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MerkleProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MerkleProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMerkleProof(); while (reader.pos < end) { @@ -223,7 +223,7 @@ export const MerkleProof = { } return obj; }, - fromPartial, I>>(object: I): MerkleProof { + fromPartial(object: Partial): MerkleProof { const message = createBaseMerkleProof(); message.proofs = object.proofs?.map((e) => CommitmentProof.fromPartial(e)) || []; return message; diff --git a/src/ibc/core/connection/v1/connection.ts b/src/ibc/core/connection/v1/connection.ts index 6a410dd..d38cf85 100644 --- a/src/ibc/core/connection/v1/connection.ts +++ b/src/ibc/core/connection/v1/connection.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { MerklePrefix } from "../../commitment/v1/commitment"; -import { Long, isSet, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.core.connection.v1"; /** * State defines if a connection is in one of the following states: @@ -79,7 +79,7 @@ export interface ConnectionEnd { * packet-verification NOTE: delay period logic is only implemented by some * clients. */ - delayPeriod: Long; + delayPeriod: bigint; } /** * IdentifiedConnection defines a connection with additional connection @@ -100,7 +100,7 @@ export interface IdentifiedConnection { /** counterparty chain associated with this connection. */ counterparty: Counterparty; /** delay period associated with this connection. */ - delayPeriod: Long; + delayPeriod: bigint; } /** Counterparty defines the counterparty chain associated with a connection end. */ export interface Counterparty { @@ -146,7 +146,7 @@ export interface Params { * largest amount of time that the chain might reasonably take to produce the next block under normal operating * conditions. A safe choice is 3-5x the expected time per block. */ - maxExpectedTimePerBlock: Long; + maxExpectedTimePerBlock: bigint; } function createBaseConnectionEnd(): ConnectionEnd { return { @@ -154,11 +154,11 @@ function createBaseConnectionEnd(): ConnectionEnd { versions: [], state: 0, counterparty: Counterparty.fromPartial({}), - delayPeriod: Long.UZERO, + delayPeriod: BigInt(0), }; } export const ConnectionEnd = { - encode(message: ConnectionEnd, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConnectionEnd, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -171,13 +171,13 @@ export const ConnectionEnd = { if (message.counterparty !== undefined) { Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); } - if (!message.delayPeriod.isZero()) { + if (message.delayPeriod !== BigInt(0)) { writer.uint32(40).uint64(message.delayPeriod); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionEnd { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionEnd { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConnectionEnd(); while (reader.pos < end) { @@ -196,7 +196,7 @@ export const ConnectionEnd = { message.counterparty = Counterparty.decode(reader, reader.uint32()); break; case 5: - message.delayPeriod = reader.uint64() as Long; + message.delayPeriod = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -211,7 +211,7 @@ export const ConnectionEnd = { if (Array.isArray(object?.versions)) obj.versions = object.versions.map((e: any) => Version.fromJSON(e)); if (isSet(object.state)) obj.state = stateFromJSON(object.state); if (isSet(object.counterparty)) obj.counterparty = Counterparty.fromJSON(object.counterparty); - if (isSet(object.delayPeriod)) obj.delayPeriod = Long.fromValue(object.delayPeriod); + if (isSet(object.delayPeriod)) obj.delayPeriod = BigInt(object.delayPeriod.toString()); return obj; }, toJSON(message: ConnectionEnd): unknown { @@ -225,10 +225,10 @@ export const ConnectionEnd = { message.state !== undefined && (obj.state = stateToJSON(message.state)); message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); - message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ConnectionEnd { + fromPartial(object: Partial): ConnectionEnd { const message = createBaseConnectionEnd(); message.clientId = object.clientId ?? ""; message.versions = object.versions?.map((e) => Version.fromPartial(e)) || []; @@ -237,7 +237,7 @@ export const ConnectionEnd = { message.counterparty = Counterparty.fromPartial(object.counterparty); } if (object.delayPeriod !== undefined && object.delayPeriod !== null) { - message.delayPeriod = Long.fromValue(object.delayPeriod); + message.delayPeriod = BigInt(object.delayPeriod.toString()); } return message; }, @@ -249,11 +249,11 @@ function createBaseIdentifiedConnection(): IdentifiedConnection { versions: [], state: 0, counterparty: Counterparty.fromPartial({}), - delayPeriod: Long.UZERO, + delayPeriod: BigInt(0), }; } export const IdentifiedConnection = { - encode(message: IdentifiedConnection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IdentifiedConnection, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -269,13 +269,13 @@ export const IdentifiedConnection = { if (message.counterparty !== undefined) { Counterparty.encode(message.counterparty, writer.uint32(42).fork()).ldelim(); } - if (!message.delayPeriod.isZero()) { + if (message.delayPeriod !== BigInt(0)) { writer.uint32(48).uint64(message.delayPeriod); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IdentifiedConnection { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentifiedConnection(); while (reader.pos < end) { @@ -297,7 +297,7 @@ export const IdentifiedConnection = { message.counterparty = Counterparty.decode(reader, reader.uint32()); break; case 6: - message.delayPeriod = reader.uint64() as Long; + message.delayPeriod = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -313,7 +313,7 @@ export const IdentifiedConnection = { if (Array.isArray(object?.versions)) obj.versions = object.versions.map((e: any) => Version.fromJSON(e)); if (isSet(object.state)) obj.state = stateFromJSON(object.state); if (isSet(object.counterparty)) obj.counterparty = Counterparty.fromJSON(object.counterparty); - if (isSet(object.delayPeriod)) obj.delayPeriod = Long.fromValue(object.delayPeriod); + if (isSet(object.delayPeriod)) obj.delayPeriod = BigInt(object.delayPeriod.toString()); return obj; }, toJSON(message: IdentifiedConnection): unknown { @@ -328,10 +328,10 @@ export const IdentifiedConnection = { message.state !== undefined && (obj.state = stateToJSON(message.state)); message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); - message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): IdentifiedConnection { + fromPartial(object: Partial): IdentifiedConnection { const message = createBaseIdentifiedConnection(); message.id = object.id ?? ""; message.clientId = object.clientId ?? ""; @@ -341,7 +341,7 @@ export const IdentifiedConnection = { message.counterparty = Counterparty.fromPartial(object.counterparty); } if (object.delayPeriod !== undefined && object.delayPeriod !== null) { - message.delayPeriod = Long.fromValue(object.delayPeriod); + message.delayPeriod = BigInt(object.delayPeriod.toString()); } return message; }, @@ -354,7 +354,7 @@ function createBaseCounterparty(): Counterparty { }; } export const Counterparty = { - encode(message: Counterparty, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -366,8 +366,8 @@ export const Counterparty = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Counterparty { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCounterparty(); while (reader.pos < end) { @@ -404,7 +404,7 @@ export const Counterparty = { (obj.prefix = message.prefix ? MerklePrefix.toJSON(message.prefix) : undefined); return obj; }, - fromPartial, I>>(object: I): Counterparty { + fromPartial(object: Partial): Counterparty { const message = createBaseCounterparty(); message.clientId = object.clientId ?? ""; message.connectionId = object.connectionId ?? ""; @@ -420,14 +420,14 @@ function createBaseClientPaths(): ClientPaths { }; } export const ClientPaths = { - encode(message: ClientPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ClientPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.paths) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientPaths { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientPaths(); while (reader.pos < end) { @@ -457,7 +457,7 @@ export const ClientPaths = { } return obj; }, - fromPartial, I>>(object: I): ClientPaths { + fromPartial(object: Partial): ClientPaths { const message = createBaseClientPaths(); message.paths = object.paths?.map((e) => e) || []; return message; @@ -470,7 +470,7 @@ function createBaseConnectionPaths(): ConnectionPaths { }; } export const ConnectionPaths = { - encode(message: ConnectionPaths, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConnectionPaths, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -479,8 +479,8 @@ export const ConnectionPaths = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConnectionPaths { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConnectionPaths { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConnectionPaths(); while (reader.pos < end) { @@ -515,7 +515,7 @@ export const ConnectionPaths = { } return obj; }, - fromPartial, I>>(object: I): ConnectionPaths { + fromPartial(object: Partial): ConnectionPaths { const message = createBaseConnectionPaths(); message.clientId = object.clientId ?? ""; message.paths = object.paths?.map((e) => e) || []; @@ -529,7 +529,7 @@ function createBaseVersion(): Version { }; } export const Version = { - encode(message: Version, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Version, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); } @@ -538,8 +538,8 @@ export const Version = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Version { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Version { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVersion(); while (reader.pos < end) { @@ -574,7 +574,7 @@ export const Version = { } return obj; }, - fromPartial, I>>(object: I): Version { + fromPartial(object: Partial): Version { const message = createBaseVersion(); message.identifier = object.identifier ?? ""; message.features = object.features?.map((e) => e) || []; @@ -583,25 +583,25 @@ export const Version = { }; function createBaseParams(): Params { return { - maxExpectedTimePerBlock: Long.UZERO, + maxExpectedTimePerBlock: BigInt(0), }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxExpectedTimePerBlock.isZero()) { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxExpectedTimePerBlock !== BigInt(0)) { writer.uint32(8).uint64(message.maxExpectedTimePerBlock); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxExpectedTimePerBlock = reader.uint64() as Long; + message.maxExpectedTimePerBlock = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -613,19 +613,19 @@ export const Params = { fromJSON(object: any): Params { const obj = createBaseParams(); if (isSet(object.maxExpectedTimePerBlock)) - obj.maxExpectedTimePerBlock = Long.fromValue(object.maxExpectedTimePerBlock); + obj.maxExpectedTimePerBlock = BigInt(object.maxExpectedTimePerBlock.toString()); return obj; }, toJSON(message: Params): unknown { const obj: any = {}; message.maxExpectedTimePerBlock !== undefined && - (obj.maxExpectedTimePerBlock = (message.maxExpectedTimePerBlock || Long.UZERO).toString()); + (obj.maxExpectedTimePerBlock = (message.maxExpectedTimePerBlock || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); if (object.maxExpectedTimePerBlock !== undefined && object.maxExpectedTimePerBlock !== null) { - message.maxExpectedTimePerBlock = Long.fromValue(object.maxExpectedTimePerBlock); + message.maxExpectedTimePerBlock = BigInt(object.maxExpectedTimePerBlock.toString()); } return message; }, diff --git a/src/ibc/core/connection/v1/genesis.ts b/src/ibc/core/connection/v1/genesis.ts index ab257af..be58bed 100644 --- a/src/ibc/core/connection/v1/genesis.ts +++ b/src/ibc/core/connection/v1/genesis.ts @@ -1,33 +1,33 @@ /* eslint-disable */ import { IdentifiedConnection, ConnectionPaths, Params } from "./connection"; -import { Long, isSet, DeepPartial, Exact } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.core.connection.v1"; /** GenesisState defines the ibc connection submodule's genesis state. */ export interface GenesisState { connections: IdentifiedConnection[]; clientConnectionPaths: ConnectionPaths[]; /** the sequence for the next generated connection identifier */ - nextConnectionSequence: Long; + nextConnectionSequence: bigint; params: Params; } function createBaseGenesisState(): GenesisState { return { connections: [], clientConnectionPaths: [], - nextConnectionSequence: Long.UZERO, + nextConnectionSequence: BigInt(0), params: Params.fromPartial({}), }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.connections) { IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); } for (const v of message.clientConnectionPaths) { ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); } - if (!message.nextConnectionSequence.isZero()) { + if (message.nextConnectionSequence !== BigInt(0)) { writer.uint32(24).uint64(message.nextConnectionSequence); } if (message.params !== undefined) { @@ -35,8 +35,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -49,7 +49,7 @@ export const GenesisState = { message.clientConnectionPaths.push(ConnectionPaths.decode(reader, reader.uint32())); break; case 3: - message.nextConnectionSequence = reader.uint64() as Long; + message.nextConnectionSequence = reader.uint64(); break; case 4: message.params = Params.decode(reader, reader.uint32()); @@ -68,7 +68,7 @@ export const GenesisState = { if (Array.isArray(object?.clientConnectionPaths)) obj.clientConnectionPaths = object.clientConnectionPaths.map((e: any) => ConnectionPaths.fromJSON(e)); if (isSet(object.nextConnectionSequence)) - obj.nextConnectionSequence = Long.fromValue(object.nextConnectionSequence); + obj.nextConnectionSequence = BigInt(object.nextConnectionSequence.toString()); if (isSet(object.params)) obj.params = Params.fromJSON(object.params); return obj; }, @@ -87,17 +87,17 @@ export const GenesisState = { obj.clientConnectionPaths = []; } message.nextConnectionSequence !== undefined && - (obj.nextConnectionSequence = (message.nextConnectionSequence || Long.UZERO).toString()); + (obj.nextConnectionSequence = (message.nextConnectionSequence || BigInt(0)).toString()); message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.connections = object.connections?.map((e) => IdentifiedConnection.fromPartial(e)) || []; message.clientConnectionPaths = object.clientConnectionPaths?.map((e) => ConnectionPaths.fromPartial(e)) || []; if (object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null) { - message.nextConnectionSequence = Long.fromValue(object.nextConnectionSequence); + message.nextConnectionSequence = BigInt(object.nextConnectionSequence.toString()); } if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); diff --git a/src/ibc/core/connection/v1/query.ts b/src/ibc/core/connection/v1/query.ts index 1411895..53aa919 100644 --- a/src/ibc/core/connection/v1/query.ts +++ b/src/ibc/core/connection/v1/query.ts @@ -3,8 +3,8 @@ import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1 import { ConnectionEnd, IdentifiedConnection } from "./connection"; import { Height, IdentifiedClientState, Params } from "../../client/v1/client"; import { Any } from "../../../../google/protobuf/any"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.core.connection.v1"; /** * QueryConnectionRequest is the request type for the Query/Connection RPC @@ -93,8 +93,8 @@ export interface QueryConnectionClientStateResponse { export interface QueryConnectionConsensusStateRequest { /** connection identifier */ connectionId: string; - revisionNumber: Long; - revisionHeight: Long; + revisionNumber: bigint; + revisionHeight: bigint; } /** * QueryConnectionConsensusStateResponse is the response type for the @@ -123,14 +123,14 @@ function createBaseQueryConnectionRequest(): QueryConnectionRequest { }; } export const QueryConnectionRequest = { - encode(message: QueryConnectionRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConnectionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionRequest(); while (reader.pos < end) { @@ -156,7 +156,7 @@ export const QueryConnectionRequest = { message.connectionId !== undefined && (obj.connectionId = message.connectionId); return obj; }, - fromPartial, I>>(object: I): QueryConnectionRequest { + fromPartial(object: Partial): QueryConnectionRequest { const message = createBaseQueryConnectionRequest(); message.connectionId = object.connectionId ?? ""; return message; @@ -170,7 +170,7 @@ function createBaseQueryConnectionResponse(): QueryConnectionResponse { }; } export const QueryConnectionResponse = { - encode(message: QueryConnectionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConnectionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connection !== undefined) { ConnectionEnd.encode(message.connection, writer.uint32(10).fork()).ldelim(); } @@ -182,8 +182,8 @@ export const QueryConnectionResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionResponse(); while (reader.pos < end) { @@ -222,7 +222,7 @@ export const QueryConnectionResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryConnectionResponse { + fromPartial(object: Partial): QueryConnectionResponse { const message = createBaseQueryConnectionResponse(); if (object.connection !== undefined && object.connection !== null) { message.connection = ConnectionEnd.fromPartial(object.connection); @@ -240,14 +240,14 @@ function createBaseQueryConnectionsRequest(): QueryConnectionsRequest { }; } export const QueryConnectionsRequest = { - encode(message: QueryConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionsRequest(); while (reader.pos < end) { @@ -274,7 +274,7 @@ export const QueryConnectionsRequest = { (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryConnectionsRequest { + fromPartial(object: Partial): QueryConnectionsRequest { const message = createBaseQueryConnectionsRequest(); if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromPartial(object.pagination); @@ -290,7 +290,7 @@ function createBaseQueryConnectionsResponse(): QueryConnectionsResponse { }; } export const QueryConnectionsResponse = { - encode(message: QueryConnectionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConnectionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.connections) { IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -302,8 +302,8 @@ export const QueryConnectionsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionsResponse(); while (reader.pos < end) { @@ -345,9 +345,7 @@ export const QueryConnectionsResponse = { message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionsResponse { + fromPartial(object: Partial): QueryConnectionsResponse { const message = createBaseQueryConnectionsResponse(); message.connections = object.connections?.map((e) => IdentifiedConnection.fromPartial(e)) || []; if (object.pagination !== undefined && object.pagination !== null) { @@ -365,14 +363,14 @@ function createBaseQueryClientConnectionsRequest(): QueryClientConnectionsReques }; } export const QueryClientConnectionsRequest = { - encode(message: QueryClientConnectionsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryClientConnectionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientConnectionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientConnectionsRequest(); while (reader.pos < end) { @@ -398,9 +396,7 @@ export const QueryClientConnectionsRequest = { message.clientId !== undefined && (obj.clientId = message.clientId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientConnectionsRequest { + fromPartial(object: Partial): QueryClientConnectionsRequest { const message = createBaseQueryClientConnectionsRequest(); message.clientId = object.clientId ?? ""; return message; @@ -414,7 +410,10 @@ function createBaseQueryClientConnectionsResponse(): QueryClientConnectionsRespo }; } export const QueryClientConnectionsResponse = { - encode(message: QueryClientConnectionsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryClientConnectionsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.connectionPaths) { writer.uint32(10).string(v!); } @@ -426,8 +425,8 @@ export const QueryClientConnectionsResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryClientConnectionsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryClientConnectionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryClientConnectionsResponse(); while (reader.pos < end) { @@ -470,9 +469,7 @@ export const QueryClientConnectionsResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryClientConnectionsResponse { + fromPartial(object: Partial): QueryClientConnectionsResponse { const message = createBaseQueryClientConnectionsResponse(); message.connectionPaths = object.connectionPaths?.map((e) => e) || []; message.proof = object.proof ?? new Uint8Array(); @@ -488,14 +485,17 @@ function createBaseQueryConnectionClientStateRequest(): QueryConnectionClientSta }; } export const QueryConnectionClientStateRequest = { - encode(message: QueryConnectionClientStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryConnectionClientStateRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionClientStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionClientStateRequest(); while (reader.pos < end) { @@ -521,9 +521,7 @@ export const QueryConnectionClientStateRequest = { message.connectionId !== undefined && (obj.connectionId = message.connectionId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionClientStateRequest { + fromPartial(object: Partial): QueryConnectionClientStateRequest { const message = createBaseQueryConnectionClientStateRequest(); message.connectionId = object.connectionId ?? ""; return message; @@ -537,7 +535,10 @@ function createBaseQueryConnectionClientStateResponse(): QueryConnectionClientSt }; } export const QueryConnectionClientStateResponse = { - encode(message: QueryConnectionClientStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryConnectionClientStateResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.identifiedClientState !== undefined) { IdentifiedClientState.encode(message.identifiedClientState, writer.uint32(10).fork()).ldelim(); } @@ -549,8 +550,8 @@ export const QueryConnectionClientStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionClientStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionClientStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionClientStateResponse(); while (reader.pos < end) { @@ -592,9 +593,7 @@ export const QueryConnectionClientStateResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionClientStateResponse { + fromPartial(object: Partial): QueryConnectionClientStateResponse { const message = createBaseQueryConnectionClientStateResponse(); if (object.identifiedClientState !== undefined && object.identifiedClientState !== null) { message.identifiedClientState = IdentifiedClientState.fromPartial(object.identifiedClientState); @@ -609,28 +608,28 @@ export const QueryConnectionClientStateResponse = { function createBaseQueryConnectionConsensusStateRequest(): QueryConnectionConsensusStateRequest { return { connectionId: "", - revisionNumber: Long.UZERO, - revisionHeight: Long.UZERO, + revisionNumber: BigInt(0), + revisionHeight: BigInt(0), }; } export const QueryConnectionConsensusStateRequest = { encode( message: QueryConnectionConsensusStateRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } - if (!message.revisionNumber.isZero()) { + if (message.revisionNumber !== BigInt(0)) { writer.uint32(16).uint64(message.revisionNumber); } - if (!message.revisionHeight.isZero()) { + if (message.revisionHeight !== BigInt(0)) { writer.uint32(24).uint64(message.revisionHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionConsensusStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionConsensusStateRequest(); while (reader.pos < end) { @@ -640,10 +639,10 @@ export const QueryConnectionConsensusStateRequest = { message.connectionId = reader.string(); break; case 2: - message.revisionNumber = reader.uint64() as Long; + message.revisionNumber = reader.uint64(); break; case 3: - message.revisionHeight = reader.uint64() as Long; + message.revisionHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -655,29 +654,27 @@ export const QueryConnectionConsensusStateRequest = { fromJSON(object: any): QueryConnectionConsensusStateRequest { const obj = createBaseQueryConnectionConsensusStateRequest(); if (isSet(object.connectionId)) obj.connectionId = String(object.connectionId); - if (isSet(object.revisionNumber)) obj.revisionNumber = Long.fromValue(object.revisionNumber); - if (isSet(object.revisionHeight)) obj.revisionHeight = Long.fromValue(object.revisionHeight); + if (isSet(object.revisionNumber)) obj.revisionNumber = BigInt(object.revisionNumber.toString()); + if (isSet(object.revisionHeight)) obj.revisionHeight = BigInt(object.revisionHeight.toString()); return obj; }, toJSON(message: QueryConnectionConsensusStateRequest): unknown { const obj: any = {}; message.connectionId !== undefined && (obj.connectionId = message.connectionId); message.revisionNumber !== undefined && - (obj.revisionNumber = (message.revisionNumber || Long.UZERO).toString()); + (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); message.revisionHeight !== undefined && - (obj.revisionHeight = (message.revisionHeight || Long.UZERO).toString()); + (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionConsensusStateRequest { + fromPartial(object: Partial): QueryConnectionConsensusStateRequest { const message = createBaseQueryConnectionConsensusStateRequest(); message.connectionId = object.connectionId ?? ""; if (object.revisionNumber !== undefined && object.revisionNumber !== null) { - message.revisionNumber = Long.fromValue(object.revisionNumber); + message.revisionNumber = BigInt(object.revisionNumber.toString()); } if (object.revisionHeight !== undefined && object.revisionHeight !== null) { - message.revisionHeight = Long.fromValue(object.revisionHeight); + message.revisionHeight = BigInt(object.revisionHeight.toString()); } return message; }, @@ -693,8 +690,8 @@ function createBaseQueryConnectionConsensusStateResponse(): QueryConnectionConse export const QueryConnectionConsensusStateResponse = { encode( message: QueryConnectionConsensusStateResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.consensusState !== undefined) { Any.encode(message.consensusState, writer.uint32(10).fork()).ldelim(); } @@ -709,8 +706,8 @@ export const QueryConnectionConsensusStateResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionConsensusStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionConsensusStateResponse(); while (reader.pos < end) { @@ -754,9 +751,7 @@ export const QueryConnectionConsensusStateResponse = { (obj.proofHeight = message.proofHeight ? Height.toJSON(message.proofHeight) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionConsensusStateResponse { + fromPartial(object: Partial): QueryConnectionConsensusStateResponse { const message = createBaseQueryConnectionConsensusStateResponse(); if (object.consensusState !== undefined && object.consensusState !== null) { message.consensusState = Any.fromPartial(object.consensusState); @@ -773,11 +768,11 @@ function createBaseQueryConnectionParamsRequest(): QueryConnectionParamsRequest return {}; } export const QueryConnectionParamsRequest = { - encode(_: QueryConnectionParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryConnectionParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionParamsRequest(); while (reader.pos < end) { @@ -798,9 +793,7 @@ export const QueryConnectionParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryConnectionParamsRequest { + fromPartial(_: Partial): QueryConnectionParamsRequest { const message = createBaseQueryConnectionParamsRequest(); return message; }, @@ -811,14 +804,14 @@ function createBaseQueryConnectionParamsResponse(): QueryConnectionParamsRespons }; } export const QueryConnectionParamsResponse = { - encode(message: QueryConnectionParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryConnectionParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryConnectionParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryConnectionParamsResponse(); while (reader.pos < end) { @@ -844,9 +837,7 @@ export const QueryConnectionParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryConnectionParamsResponse { + fromPartial(object: Partial): QueryConnectionParamsResponse { const message = createBaseQueryConnectionParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -896,7 +887,7 @@ export class QueryClientImpl implements Query { Connection(request: QueryConnectionRequest): Promise { const data = QueryConnectionRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connection", data); - return promise.then((data) => QueryConnectionResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConnectionResponse.decode(new BinaryReader(data))); } Connections( request: QueryConnectionsRequest = { @@ -905,30 +896,30 @@ export class QueryClientImpl implements Query { ): Promise { const data = QueryConnectionsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Query", "Connections", data); - return promise.then((data) => QueryConnectionsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConnectionsResponse.decode(new BinaryReader(data))); } ClientConnections(request: QueryClientConnectionsRequest): Promise { const data = QueryClientConnectionsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Query", "ClientConnections", data); - return promise.then((data) => QueryClientConnectionsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryClientConnectionsResponse.decode(new BinaryReader(data))); } ConnectionClientState( request: QueryConnectionClientStateRequest, ): Promise { const data = QueryConnectionClientStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionClientState", data); - return promise.then((data) => QueryConnectionClientStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConnectionClientStateResponse.decode(new BinaryReader(data))); } ConnectionConsensusState( request: QueryConnectionConsensusStateRequest, ): Promise { const data = QueryConnectionConsensusStateRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); - return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConnectionConsensusStateResponse.decode(new BinaryReader(data))); } ConnectionParams(request: QueryConnectionParamsRequest = {}): Promise { const data = QueryConnectionParamsRequest.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionParams", data); - return promise.then((data) => QueryConnectionParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryConnectionParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/core/connection/v1/tx.amino.ts b/src/ibc/core/connection/v1/tx.amino.ts new file mode 100644 index 0000000..ff83873 --- /dev/null +++ b/src/ibc/core/connection/v1/tx.amino.ts @@ -0,0 +1,379 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { AminoHeight, omitDefault } from "../../../../helpers"; +import { + MsgConnectionOpenInit, + MsgConnectionOpenTry, + MsgConnectionOpenAck, + MsgConnectionOpenConfirm, +} from "./tx"; +export interface MsgConnectionOpenInitAminoType extends AminoMsg { + type: "cosmos-sdk/MsgConnectionOpenInit"; + value: { + client_id: string; + counterparty: { + client_id: string; + connection_id: string; + prefix: { + key_prefix: Uint8Array; + }; + }; + version: { + identifier: string; + features: string[]; + }; + delay_period: string; + signer: string; + }; +} +export interface MsgConnectionOpenTryAminoType extends AminoMsg { + type: "cosmos-sdk/MsgConnectionOpenTry"; + value: { + client_id: string; + previous_connection_id: string; + client_state: { + type_url: string; + value: Uint8Array; + }; + counterparty: { + client_id: string; + connection_id: string; + prefix: { + key_prefix: Uint8Array; + }; + }; + delay_period: string; + counterparty_versions: { + identifier: string; + features: string[]; + }[]; + proof_height: AminoHeight; + proof_init: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: AminoHeight; + signer: string; + host_consensus_state_proof: Uint8Array; + }; +} +export interface MsgConnectionOpenAckAminoType extends AminoMsg { + type: "cosmos-sdk/MsgConnectionOpenAck"; + value: { + connection_id: string; + counterparty_connection_id: string; + version: { + identifier: string; + features: string[]; + }; + client_state: { + type_url: string; + value: Uint8Array; + }; + proof_height: AminoHeight; + proof_try: Uint8Array; + proof_client: Uint8Array; + proof_consensus: Uint8Array; + consensus_height: AminoHeight; + signer: string; + host_consensus_state_proof: Uint8Array; + }; +} +export interface MsgConnectionOpenConfirmAminoType extends AminoMsg { + type: "cosmos-sdk/MsgConnectionOpenConfirm"; + value: { + connection_id: string; + proof_ack: Uint8Array; + proof_height: AminoHeight; + signer: string; + }; +} +export const AminoConverter = { + "/ibc.core.connection.v1.MsgConnectionOpenInit": { + aminoType: "cosmos-sdk/MsgConnectionOpenInit", + toAmino: ({ + clientId, + counterparty, + version, + delayPeriod, + signer, + }: MsgConnectionOpenInit): MsgConnectionOpenInitAminoType["value"] => { + return { + client_id: clientId, + counterparty: { + client_id: counterparty.clientId, + connection_id: counterparty.connectionId, + prefix: { + key_prefix: counterparty.prefix.keyPrefix, + }, + }, + version: { + identifier: version.identifier, + features: version.features, + }, + delay_period: delayPeriod.toString(), + signer, + }; + }, + fromAmino: ({ + client_id, + counterparty, + version, + delay_period, + signer, + }: MsgConnectionOpenInitAminoType["value"]): MsgConnectionOpenInit => { + return { + clientId: client_id, + counterparty: { + clientId: counterparty.client_id, + connectionId: counterparty.connection_id, + prefix: { + keyPrefix: counterparty.prefix.key_prefix, + }, + }, + version: { + identifier: version.identifier, + features: version.features, + }, + delayPeriod: BigInt(delay_period), + signer, + }; + }, + }, + "/ibc.core.connection.v1.MsgConnectionOpenTry": { + aminoType: "cosmos-sdk/MsgConnectionOpenTry", + toAmino: ({ + clientId, + previousConnectionId, + clientState, + counterparty, + delayPeriod, + counterpartyVersions, + proofHeight, + proofInit, + proofClient, + proofConsensus, + consensusHeight, + signer, + hostConsensusStateProof, + }: MsgConnectionOpenTry): MsgConnectionOpenTryAminoType["value"] => { + return { + client_id: clientId, + previous_connection_id: previousConnectionId, + client_state: { + type_url: clientState.typeUrl, + value: clientState.value, + }, + counterparty: { + client_id: counterparty.clientId, + connection_id: counterparty.connectionId, + prefix: { + key_prefix: counterparty.prefix.keyPrefix, + }, + }, + delay_period: delayPeriod.toString(), + counterparty_versions: counterpartyVersions.map((el0) => ({ + identifier: el0.identifier, + features: el0.features, + })), + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + proof_init: proofInit, + proof_client: proofClient, + proof_consensus: proofConsensus, + consensus_height: consensusHeight + ? { + revision_height: omitDefault(consensusHeight.revisionHeight)?.toString(), + revision_number: omitDefault(consensusHeight.revisionNumber)?.toString(), + } + : {}, + signer, + host_consensus_state_proof: hostConsensusStateProof, + }; + }, + fromAmino: ({ + client_id, + previous_connection_id, + client_state, + counterparty, + delay_period, + counterparty_versions, + proof_height, + proof_init, + proof_client, + proof_consensus, + consensus_height, + signer, + host_consensus_state_proof, + }: MsgConnectionOpenTryAminoType["value"]): MsgConnectionOpenTry => { + return { + clientId: client_id, + previousConnectionId: previous_connection_id, + clientState: { + typeUrl: client_state.type_url, + value: client_state.value, + }, + counterparty: { + clientId: counterparty.client_id, + connectionId: counterparty.connection_id, + prefix: { + keyPrefix: counterparty.prefix.key_prefix, + }, + }, + delayPeriod: BigInt(delay_period), + counterpartyVersions: counterparty_versions.map((el0) => ({ + identifier: el0.identifier, + features: el0.features, + })), + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + proofInit: proof_init, + proofClient: proof_client, + proofConsensus: proof_consensus, + consensusHeight: consensus_height + ? { + revisionHeight: BigInt(consensus_height.revision_height || "0"), + revisionNumber: BigInt(consensus_height.revision_number || "0"), + } + : undefined, + signer, + hostConsensusStateProof: host_consensus_state_proof, + }; + }, + }, + "/ibc.core.connection.v1.MsgConnectionOpenAck": { + aminoType: "cosmos-sdk/MsgConnectionOpenAck", + toAmino: ({ + connectionId, + counterpartyConnectionId, + version, + clientState, + proofHeight, + proofTry, + proofClient, + proofConsensus, + consensusHeight, + signer, + hostConsensusStateProof, + }: MsgConnectionOpenAck): MsgConnectionOpenAckAminoType["value"] => { + return { + connection_id: connectionId, + counterparty_connection_id: counterpartyConnectionId, + version: { + identifier: version.identifier, + features: version.features, + }, + client_state: { + type_url: clientState.typeUrl, + value: clientState.value, + }, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + proof_try: proofTry, + proof_client: proofClient, + proof_consensus: proofConsensus, + consensus_height: consensusHeight + ? { + revision_height: omitDefault(consensusHeight.revisionHeight)?.toString(), + revision_number: omitDefault(consensusHeight.revisionNumber)?.toString(), + } + : {}, + signer, + host_consensus_state_proof: hostConsensusStateProof, + }; + }, + fromAmino: ({ + connection_id, + counterparty_connection_id, + version, + client_state, + proof_height, + proof_try, + proof_client, + proof_consensus, + consensus_height, + signer, + host_consensus_state_proof, + }: MsgConnectionOpenAckAminoType["value"]): MsgConnectionOpenAck => { + return { + connectionId: connection_id, + counterpartyConnectionId: counterparty_connection_id, + version: { + identifier: version.identifier, + features: version.features, + }, + clientState: { + typeUrl: client_state.type_url, + value: client_state.value, + }, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + proofTry: proof_try, + proofClient: proof_client, + proofConsensus: proof_consensus, + consensusHeight: consensus_height + ? { + revisionHeight: BigInt(consensus_height.revision_height || "0"), + revisionNumber: BigInt(consensus_height.revision_number || "0"), + } + : undefined, + signer, + hostConsensusStateProof: host_consensus_state_proof, + }; + }, + }, + "/ibc.core.connection.v1.MsgConnectionOpenConfirm": { + aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", + toAmino: ({ + connectionId, + proofAck, + proofHeight, + signer, + }: MsgConnectionOpenConfirm): MsgConnectionOpenConfirmAminoType["value"] => { + return { + connection_id: connectionId, + proof_ack: proofAck, + proof_height: proofHeight + ? { + revision_height: omitDefault(proofHeight.revisionHeight)?.toString(), + revision_number: omitDefault(proofHeight.revisionNumber)?.toString(), + } + : {}, + signer, + }; + }, + fromAmino: ({ + connection_id, + proof_ack, + proof_height, + signer, + }: MsgConnectionOpenConfirmAminoType["value"]): MsgConnectionOpenConfirm => { + return { + connectionId: connection_id, + proofAck: proof_ack, + proofHeight: proof_height + ? { + revisionHeight: BigInt(proof_height.revision_height || "0"), + revisionNumber: BigInt(proof_height.revision_number || "0"), + } + : undefined, + signer, + }; + }, + }, +}; diff --git a/src/ibc/core/connection/v1/tx.registry.ts b/src/ibc/core/connection/v1/tx.registry.ts new file mode 100644 index 0000000..cfee3db --- /dev/null +++ b/src/ibc/core/connection/v1/tx.registry.ts @@ -0,0 +1,152 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgConnectionOpenInit, + MsgConnectionOpenTry, + MsgConnectionOpenAck, + MsgConnectionOpenConfirm, +} from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], + ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], + ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], + ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.encode(value).finish(), + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.encode(value).finish(), + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.encode(value).finish(), + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value, + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value, + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value, + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value, + }; + }, + }, + toJSON: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.toJSON(value), + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.toJSON(value), + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.toJSON(value), + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.toJSON(value), + }; + }, + }, + fromJSON: { + connectionOpenInit(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.fromJSON(value), + }; + }, + connectionOpenTry(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.fromJSON(value), + }; + }, + connectionOpenAck(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.fromJSON(value), + }; + }, + connectionOpenConfirm(value: any) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.fromJSON(value), + }; + }, + }, + fromPartial: { + connectionOpenInit(value: MsgConnectionOpenInit) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenInit", + value: MsgConnectionOpenInit.fromPartial(value), + }; + }, + connectionOpenTry(value: MsgConnectionOpenTry) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry", + value: MsgConnectionOpenTry.fromPartial(value), + }; + }, + connectionOpenAck(value: MsgConnectionOpenAck) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck", + value: MsgConnectionOpenAck.fromPartial(value), + }; + }, + connectionOpenConfirm(value: MsgConnectionOpenConfirm) { + return { + typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", + value: MsgConnectionOpenConfirm.fromPartial(value), + }; + }, + }, +}; diff --git a/src/ibc/core/connection/v1/tx.ts b/src/ibc/core/connection/v1/tx.ts index b91d258..eca2f00 100644 --- a/src/ibc/core/connection/v1/tx.ts +++ b/src/ibc/core/connection/v1/tx.ts @@ -2,8 +2,8 @@ import { Counterparty, Version } from "./connection"; import { Any } from "../../../../google/protobuf/any"; import { Height } from "../../client/v1/client"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, Rpc } from "../../../../helpers"; export const protobufPackage = "ibc.core.connection.v1"; /** * MsgConnectionOpenInit defines the msg sent by an account on Chain A to @@ -13,7 +13,7 @@ export interface MsgConnectionOpenInit { clientId: string; counterparty: Counterparty; version: Version; - delayPeriod: Long; + delayPeriod: bigint; signer: string; } /** @@ -32,7 +32,7 @@ export interface MsgConnectionOpenTry { previousConnectionId: string; clientState: Any; counterparty: Counterparty; - delayPeriod: Long; + delayPeriod: bigint; counterpartyVersions: Version[]; proofHeight: Height; /** @@ -98,12 +98,12 @@ function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { clientId: "", counterparty: Counterparty.fromPartial({}), version: Version.fromPartial({}), - delayPeriod: Long.UZERO, + delayPeriod: BigInt(0), signer: "", }; } export const MsgConnectionOpenInit = { - encode(message: MsgConnectionOpenInit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgConnectionOpenInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -113,7 +113,7 @@ export const MsgConnectionOpenInit = { if (message.version !== undefined) { Version.encode(message.version, writer.uint32(26).fork()).ldelim(); } - if (!message.delayPeriod.isZero()) { + if (message.delayPeriod !== BigInt(0)) { writer.uint32(32).uint64(message.delayPeriod); } if (message.signer !== "") { @@ -121,8 +121,8 @@ export const MsgConnectionOpenInit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenInit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenInit(); while (reader.pos < end) { @@ -138,7 +138,7 @@ export const MsgConnectionOpenInit = { message.version = Version.decode(reader, reader.uint32()); break; case 4: - message.delayPeriod = reader.uint64() as Long; + message.delayPeriod = reader.uint64(); break; case 5: message.signer = reader.string(); @@ -155,7 +155,7 @@ export const MsgConnectionOpenInit = { if (isSet(object.clientId)) obj.clientId = String(object.clientId); if (isSet(object.counterparty)) obj.counterparty = Counterparty.fromJSON(object.counterparty); if (isSet(object.version)) obj.version = Version.fromJSON(object.version); - if (isSet(object.delayPeriod)) obj.delayPeriod = Long.fromValue(object.delayPeriod); + if (isSet(object.delayPeriod)) obj.delayPeriod = BigInt(object.delayPeriod.toString()); if (isSet(object.signer)) obj.signer = String(object.signer); return obj; }, @@ -166,11 +166,11 @@ export const MsgConnectionOpenInit = { (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); message.version !== undefined && (obj.version = message.version ? Version.toJSON(message.version) : undefined); - message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>(object: I): MsgConnectionOpenInit { + fromPartial(object: Partial): MsgConnectionOpenInit { const message = createBaseMsgConnectionOpenInit(); message.clientId = object.clientId ?? ""; if (object.counterparty !== undefined && object.counterparty !== null) { @@ -180,7 +180,7 @@ export const MsgConnectionOpenInit = { message.version = Version.fromPartial(object.version); } if (object.delayPeriod !== undefined && object.delayPeriod !== null) { - message.delayPeriod = Long.fromValue(object.delayPeriod); + message.delayPeriod = BigInt(object.delayPeriod.toString()); } message.signer = object.signer ?? ""; return message; @@ -190,11 +190,11 @@ function createBaseMsgConnectionOpenInitResponse(): MsgConnectionOpenInitRespons return {}; } export const MsgConnectionOpenInitResponse = { - encode(_: MsgConnectionOpenInitResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgConnectionOpenInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenInitResponse(); while (reader.pos < end) { @@ -215,9 +215,7 @@ export const MsgConnectionOpenInitResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgConnectionOpenInitResponse { + fromPartial(_: Partial): MsgConnectionOpenInitResponse { const message = createBaseMsgConnectionOpenInitResponse(); return message; }, @@ -228,7 +226,7 @@ function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { previousConnectionId: "", clientState: Any.fromPartial({}), counterparty: Counterparty.fromPartial({}), - delayPeriod: Long.UZERO, + delayPeriod: BigInt(0), counterpartyVersions: [], proofHeight: Height.fromPartial({}), proofInit: new Uint8Array(), @@ -240,7 +238,7 @@ function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { }; } export const MsgConnectionOpenTry = { - encode(message: MsgConnectionOpenTry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgConnectionOpenTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -253,7 +251,7 @@ export const MsgConnectionOpenTry = { if (message.counterparty !== undefined) { Counterparty.encode(message.counterparty, writer.uint32(34).fork()).ldelim(); } - if (!message.delayPeriod.isZero()) { + if (message.delayPeriod !== BigInt(0)) { writer.uint32(40).uint64(message.delayPeriod); } for (const v of message.counterpartyVersions) { @@ -282,8 +280,8 @@ export const MsgConnectionOpenTry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenTry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenTry(); while (reader.pos < end) { @@ -302,7 +300,7 @@ export const MsgConnectionOpenTry = { message.counterparty = Counterparty.decode(reader, reader.uint32()); break; case 5: - message.delayPeriod = reader.uint64() as Long; + message.delayPeriod = reader.uint64(); break; case 6: message.counterpartyVersions.push(Version.decode(reader, reader.uint32())); @@ -341,7 +339,7 @@ export const MsgConnectionOpenTry = { if (isSet(object.previousConnectionId)) obj.previousConnectionId = String(object.previousConnectionId); if (isSet(object.clientState)) obj.clientState = Any.fromJSON(object.clientState); if (isSet(object.counterparty)) obj.counterparty = Counterparty.fromJSON(object.counterparty); - if (isSet(object.delayPeriod)) obj.delayPeriod = Long.fromValue(object.delayPeriod); + if (isSet(object.delayPeriod)) obj.delayPeriod = BigInt(object.delayPeriod.toString()); if (Array.isArray(object?.counterpartyVersions)) obj.counterpartyVersions = object.counterpartyVersions.map((e: any) => Version.fromJSON(e)); if (isSet(object.proofHeight)) obj.proofHeight = Height.fromJSON(object.proofHeight); @@ -362,7 +360,7 @@ export const MsgConnectionOpenTry = { (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); - message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || Long.UZERO).toString()); + message.delayPeriod !== undefined && (obj.delayPeriod = (message.delayPeriod || BigInt(0)).toString()); if (message.counterpartyVersions) { obj.counterpartyVersions = message.counterpartyVersions.map((e) => (e ? Version.toJSON(e) : undefined)); } else { @@ -391,7 +389,7 @@ export const MsgConnectionOpenTry = { )); return obj; }, - fromPartial, I>>(object: I): MsgConnectionOpenTry { + fromPartial(object: Partial): MsgConnectionOpenTry { const message = createBaseMsgConnectionOpenTry(); message.clientId = object.clientId ?? ""; message.previousConnectionId = object.previousConnectionId ?? ""; @@ -402,7 +400,7 @@ export const MsgConnectionOpenTry = { message.counterparty = Counterparty.fromPartial(object.counterparty); } if (object.delayPeriod !== undefined && object.delayPeriod !== null) { - message.delayPeriod = Long.fromValue(object.delayPeriod); + message.delayPeriod = BigInt(object.delayPeriod.toString()); } message.counterpartyVersions = object.counterpartyVersions?.map((e) => Version.fromPartial(e)) || []; if (object.proofHeight !== undefined && object.proofHeight !== null) { @@ -423,11 +421,11 @@ function createBaseMsgConnectionOpenTryResponse(): MsgConnectionOpenTryResponse return {}; } export const MsgConnectionOpenTryResponse = { - encode(_: MsgConnectionOpenTryResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgConnectionOpenTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenTryResponse(); while (reader.pos < end) { @@ -448,9 +446,7 @@ export const MsgConnectionOpenTryResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgConnectionOpenTryResponse { + fromPartial(_: Partial): MsgConnectionOpenTryResponse { const message = createBaseMsgConnectionOpenTryResponse(); return message; }, @@ -471,7 +467,7 @@ function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { }; } export const MsgConnectionOpenAck = { - encode(message: MsgConnectionOpenAck, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgConnectionOpenAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } @@ -507,8 +503,8 @@ export const MsgConnectionOpenAck = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenAck { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenAck(); while (reader.pos < end) { @@ -601,7 +597,7 @@ export const MsgConnectionOpenAck = { )); return obj; }, - fromPartial, I>>(object: I): MsgConnectionOpenAck { + fromPartial(object: Partial): MsgConnectionOpenAck { const message = createBaseMsgConnectionOpenAck(); message.connectionId = object.connectionId ?? ""; message.counterpartyConnectionId = object.counterpartyConnectionId ?? ""; @@ -629,11 +625,11 @@ function createBaseMsgConnectionOpenAckResponse(): MsgConnectionOpenAckResponse return {}; } export const MsgConnectionOpenAckResponse = { - encode(_: MsgConnectionOpenAckResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgConnectionOpenAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenAckResponse(); while (reader.pos < end) { @@ -654,9 +650,7 @@ export const MsgConnectionOpenAckResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgConnectionOpenAckResponse { + fromPartial(_: Partial): MsgConnectionOpenAckResponse { const message = createBaseMsgConnectionOpenAckResponse(); return message; }, @@ -670,7 +664,7 @@ function createBaseMsgConnectionOpenConfirm(): MsgConnectionOpenConfirm { }; } export const MsgConnectionOpenConfirm = { - encode(message: MsgConnectionOpenConfirm, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgConnectionOpenConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.connectionId !== "") { writer.uint32(10).string(message.connectionId); } @@ -685,8 +679,8 @@ export const MsgConnectionOpenConfirm = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenConfirm { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenConfirm(); while (reader.pos < end) { @@ -729,9 +723,7 @@ export const MsgConnectionOpenConfirm = { message.signer !== undefined && (obj.signer = message.signer); return obj; }, - fromPartial, I>>( - object: I, - ): MsgConnectionOpenConfirm { + fromPartial(object: Partial): MsgConnectionOpenConfirm { const message = createBaseMsgConnectionOpenConfirm(); message.connectionId = object.connectionId ?? ""; message.proofAck = object.proofAck ?? new Uint8Array(); @@ -746,11 +738,11 @@ function createBaseMsgConnectionOpenConfirmResponse(): MsgConnectionOpenConfirmR return {}; } export const MsgConnectionOpenConfirmResponse = { - encode(_: MsgConnectionOpenConfirmResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgConnectionOpenConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgConnectionOpenConfirmResponse(); while (reader.pos < end) { @@ -771,9 +763,7 @@ export const MsgConnectionOpenConfirmResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgConnectionOpenConfirmResponse { + fromPartial(_: Partial): MsgConnectionOpenConfirmResponse { const message = createBaseMsgConnectionOpenConfirmResponse(); return message; }, @@ -804,21 +794,21 @@ export class MsgClientImpl implements Msg { ConnectionOpenInit(request: MsgConnectionOpenInit): Promise { const data = MsgConnectionOpenInit.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenInit", data); - return promise.then((data) => MsgConnectionOpenInitResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgConnectionOpenInitResponse.decode(new BinaryReader(data))); } ConnectionOpenTry(request: MsgConnectionOpenTry): Promise { const data = MsgConnectionOpenTry.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenTry", data); - return promise.then((data) => MsgConnectionOpenTryResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgConnectionOpenTryResponse.decode(new BinaryReader(data))); } ConnectionOpenAck(request: MsgConnectionOpenAck): Promise { const data = MsgConnectionOpenAck.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenAck", data); - return promise.then((data) => MsgConnectionOpenAckResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgConnectionOpenAckResponse.decode(new BinaryReader(data))); } ConnectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise { const data = MsgConnectionOpenConfirm.encode(request).finish(); const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); - return promise.then((data) => MsgConnectionOpenConfirmResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgConnectionOpenConfirmResponse.decode(new BinaryReader(data))); } } diff --git a/src/ibc/core/types/v1/genesis.ts b/src/ibc/core/types/v1/genesis.ts index 02d5c0f..2ac7873 100644 --- a/src/ibc/core/types/v1/genesis.ts +++ b/src/ibc/core/types/v1/genesis.ts @@ -1,9 +1,10 @@ +//@ts-nocheck /* eslint-disable */ import { GenesisState as GenesisState1 } from "../../client/v1/genesis"; import { GenesisState as GenesisState2 } from "../../connection/v1/genesis"; import { GenesisState as GenesisState3 } from "../../channel/v1/genesis"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.core.types.v1"; /** GenesisState defines the ibc module's genesis state. */ export interface GenesisState { @@ -22,7 +23,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientGenesis !== undefined) { GenesisState1.encode(message.clientGenesis, writer.uint32(10).fork()).ldelim(); } @@ -34,8 +35,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -79,7 +80,7 @@ export const GenesisState = { : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.clientGenesis !== undefined && object.clientGenesis !== null) { message.clientGenesis = GenesisState1.fromPartial(object.clientGenesis); diff --git a/src/ibc/lightclients/localhost/v2/localhost.ts b/src/ibc/lightclients/localhost/v2/localhost.ts index 1a98f5e..b3b3ff1 100644 --- a/src/ibc/lightclients/localhost/v2/localhost.ts +++ b/src/ibc/lightclients/localhost/v2/localhost.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Height } from "../../../core/client/v1/client"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; export const protobufPackage = "ibc.lightclients.localhost.v2"; /** ClientState defines the 09-localhost client state */ export interface ClientState { @@ -14,14 +14,14 @@ function createBaseClientState(): ClientState { }; } export const ClientState = { - encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.latestHeight !== undefined) { Height.encode(message.latestHeight, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientState(); while (reader.pos < end) { @@ -48,7 +48,7 @@ export const ClientState = { (obj.latestHeight = message.latestHeight ? Height.toJSON(message.latestHeight) : undefined); return obj; }, - fromPartial, I>>(object: I): ClientState { + fromPartial(object: Partial): ClientState { const message = createBaseClientState(); if (object.latestHeight !== undefined && object.latestHeight !== null) { message.latestHeight = Height.fromPartial(object.latestHeight); diff --git a/src/ibc/lightclients/solomachine/v3/solomachine.ts b/src/ibc/lightclients/solomachine/v3/solomachine.ts index febba63..37eb79c 100644 --- a/src/ibc/lightclients/solomachine/v3/solomachine.ts +++ b/src/ibc/lightclients/solomachine/v3/solomachine.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Any } from "../../../../google/protobuf/any"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; export const protobufPackage = "ibc.lightclients.solomachine.v3"; /** * ClientState defines a solo machine client that tracks the current consensus @@ -9,7 +9,7 @@ export const protobufPackage = "ibc.lightclients.solomachine.v3"; */ export interface ClientState { /** latest sequence of the client state */ - sequence: Long; + sequence: bigint; /** frozen sequence of the solo machine */ isFrozen: boolean; consensusState: ConsensusState; @@ -28,11 +28,11 @@ export interface ConsensusState { * misbehaviour. */ diversifier: string; - timestamp: Long; + timestamp: bigint; } /** Header defines a solo machine consensus header */ export interface Header { - timestamp: Long; + timestamp: bigint; signature: Uint8Array; newPublicKey: Any; newDiversifier: string; @@ -42,7 +42,7 @@ export interface Header { * of a sequence and two signatures over different messages at that sequence. */ export interface Misbehaviour { - sequence: Long; + sequence: bigint; signatureOne: SignatureAndData; signatureTwo: SignatureAndData; } @@ -54,7 +54,7 @@ export interface SignatureAndData { signature: Uint8Array; path: Uint8Array; data: Uint8Array; - timestamp: Long; + timestamp: bigint; } /** * TimestampedSignatureData contains the signature data and the timestamp of the @@ -62,14 +62,14 @@ export interface SignatureAndData { */ export interface TimestampedSignatureData { signatureData: Uint8Array; - timestamp: Long; + timestamp: bigint; } /** SignBytes defines the signed bytes used for signature verification. */ export interface SignBytes { /** the sequence number */ - sequence: Long; + sequence: bigint; /** the proof timestamp */ - timestamp: Long; + timestamp: bigint; /** the public key diversifier */ diversifier: string; /** the standardised path bytes */ @@ -86,14 +86,14 @@ export interface HeaderData { } function createBaseClientState(): ClientState { return { - sequence: Long.UZERO, + sequence: BigInt(0), isFrozen: false, consensusState: ConsensusState.fromPartial({}), }; } export const ClientState = { - encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } if (message.isFrozen === true) { @@ -104,15 +104,15 @@ export const ClientState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientState(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; case 2: message.isFrozen = reader.bool(); @@ -129,14 +129,14 @@ export const ClientState = { }, fromJSON(object: any): ClientState { const obj = createBaseClientState(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); if (isSet(object.isFrozen)) obj.isFrozen = Boolean(object.isFrozen); if (isSet(object.consensusState)) obj.consensusState = ConsensusState.fromJSON(object.consensusState); return obj; }, toJSON(message: ClientState): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); message.isFrozen !== undefined && (obj.isFrozen = message.isFrozen); message.consensusState !== undefined && (obj.consensusState = message.consensusState @@ -144,10 +144,10 @@ export const ClientState = { : undefined); return obj; }, - fromPartial, I>>(object: I): ClientState { + fromPartial(object: Partial): ClientState { const message = createBaseClientState(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } message.isFrozen = object.isFrozen ?? false; if (object.consensusState !== undefined && object.consensusState !== null) { @@ -160,24 +160,24 @@ function createBaseConsensusState(): ConsensusState { return { publicKey: Any.fromPartial({}), diversifier: "", - timestamp: Long.UZERO, + timestamp: BigInt(0), }; } export const ConsensusState = { - encode(message: ConsensusState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.publicKey !== undefined) { Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); } if (message.diversifier !== "") { writer.uint32(18).string(message.diversifier); } - if (!message.timestamp.isZero()) { + if (message.timestamp !== BigInt(0)) { writer.uint32(24).uint64(message.timestamp); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusState(); while (reader.pos < end) { @@ -190,7 +190,7 @@ export const ConsensusState = { message.diversifier = reader.string(); break; case 3: - message.timestamp = reader.uint64() as Long; + message.timestamp = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -203,7 +203,7 @@ export const ConsensusState = { const obj = createBaseConsensusState(); if (isSet(object.publicKey)) obj.publicKey = Any.fromJSON(object.publicKey); if (isSet(object.diversifier)) obj.diversifier = String(object.diversifier); - if (isSet(object.timestamp)) obj.timestamp = Long.fromValue(object.timestamp); + if (isSet(object.timestamp)) obj.timestamp = BigInt(object.timestamp.toString()); return obj; }, toJSON(message: ConsensusState): unknown { @@ -211,32 +211,32 @@ export const ConsensusState = { message.publicKey !== undefined && (obj.publicKey = message.publicKey ? Any.toJSON(message.publicKey) : undefined); message.diversifier !== undefined && (obj.diversifier = message.diversifier); - message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ConsensusState { + fromPartial(object: Partial): ConsensusState { const message = createBaseConsensusState(); if (object.publicKey !== undefined && object.publicKey !== null) { message.publicKey = Any.fromPartial(object.publicKey); } message.diversifier = object.diversifier ?? ""; if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = Long.fromValue(object.timestamp); + message.timestamp = BigInt(object.timestamp.toString()); } return message; }, }; function createBaseHeader(): Header { return { - timestamp: Long.UZERO, + timestamp: BigInt(0), signature: new Uint8Array(), newPublicKey: Any.fromPartial({}), newDiversifier: "", }; } export const Header = { - encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.timestamp.isZero()) { + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { writer.uint32(8).uint64(message.timestamp); } if (message.signature.length !== 0) { @@ -250,15 +250,15 @@ export const Header = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeader(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.timestamp = reader.uint64() as Long; + message.timestamp = reader.uint64(); break; case 2: message.signature = reader.bytes(); @@ -278,7 +278,7 @@ export const Header = { }, fromJSON(object: any): Header { const obj = createBaseHeader(); - if (isSet(object.timestamp)) obj.timestamp = Long.fromValue(object.timestamp); + if (isSet(object.timestamp)) obj.timestamp = BigInt(object.timestamp.toString()); if (isSet(object.signature)) obj.signature = bytesFromBase64(object.signature); if (isSet(object.newPublicKey)) obj.newPublicKey = Any.fromJSON(object.newPublicKey); if (isSet(object.newDiversifier)) obj.newDiversifier = String(object.newDiversifier); @@ -286,7 +286,7 @@ export const Header = { }, toJSON(message: Header): unknown { const obj: any = {}; - message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); message.signature !== undefined && (obj.signature = base64FromBytes( message.signature !== undefined ? message.signature : new Uint8Array(), @@ -296,10 +296,10 @@ export const Header = { message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); return obj; }, - fromPartial, I>>(object: I): Header { + fromPartial(object: Partial
): Header { const message = createBaseHeader(); if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = Long.fromValue(object.timestamp); + message.timestamp = BigInt(object.timestamp.toString()); } message.signature = object.signature ?? new Uint8Array(); if (object.newPublicKey !== undefined && object.newPublicKey !== null) { @@ -311,14 +311,14 @@ export const Header = { }; function createBaseMisbehaviour(): Misbehaviour { return { - sequence: Long.UZERO, + sequence: BigInt(0), signatureOne: SignatureAndData.fromPartial({}), signatureTwo: SignatureAndData.fromPartial({}), }; } export const Misbehaviour = { - encode(message: Misbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } if (message.signatureOne !== undefined) { @@ -329,15 +329,15 @@ export const Misbehaviour = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Misbehaviour { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMisbehaviour(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; case 2: message.signatureOne = SignatureAndData.decode(reader, reader.uint32()); @@ -354,24 +354,24 @@ export const Misbehaviour = { }, fromJSON(object: any): Misbehaviour { const obj = createBaseMisbehaviour(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); if (isSet(object.signatureOne)) obj.signatureOne = SignatureAndData.fromJSON(object.signatureOne); if (isSet(object.signatureTwo)) obj.signatureTwo = SignatureAndData.fromJSON(object.signatureTwo); return obj; }, toJSON(message: Misbehaviour): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); message.signatureOne !== undefined && (obj.signatureOne = message.signatureOne ? SignatureAndData.toJSON(message.signatureOne) : undefined); message.signatureTwo !== undefined && (obj.signatureTwo = message.signatureTwo ? SignatureAndData.toJSON(message.signatureTwo) : undefined); return obj; }, - fromPartial, I>>(object: I): Misbehaviour { + fromPartial(object: Partial): Misbehaviour { const message = createBaseMisbehaviour(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } if (object.signatureOne !== undefined && object.signatureOne !== null) { message.signatureOne = SignatureAndData.fromPartial(object.signatureOne); @@ -387,11 +387,11 @@ function createBaseSignatureAndData(): SignatureAndData { signature: new Uint8Array(), path: new Uint8Array(), data: new Uint8Array(), - timestamp: Long.UZERO, + timestamp: BigInt(0), }; } export const SignatureAndData = { - encode(message: SignatureAndData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignatureAndData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signature.length !== 0) { writer.uint32(10).bytes(message.signature); } @@ -401,13 +401,13 @@ export const SignatureAndData = { if (message.data.length !== 0) { writer.uint32(26).bytes(message.data); } - if (!message.timestamp.isZero()) { + if (message.timestamp !== BigInt(0)) { writer.uint32(32).uint64(message.timestamp); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignatureAndData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignatureAndData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignatureAndData(); while (reader.pos < end) { @@ -423,7 +423,7 @@ export const SignatureAndData = { message.data = reader.bytes(); break; case 4: - message.timestamp = reader.uint64() as Long; + message.timestamp = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -437,7 +437,7 @@ export const SignatureAndData = { if (isSet(object.signature)) obj.signature = bytesFromBase64(object.signature); if (isSet(object.path)) obj.path = bytesFromBase64(object.path); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); - if (isSet(object.timestamp)) obj.timestamp = Long.fromValue(object.timestamp); + if (isSet(object.timestamp)) obj.timestamp = BigInt(object.timestamp.toString()); return obj; }, toJSON(message: SignatureAndData): unknown { @@ -450,16 +450,16 @@ export const SignatureAndData = { (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): SignatureAndData { + fromPartial(object: Partial): SignatureAndData { const message = createBaseSignatureAndData(); message.signature = object.signature ?? new Uint8Array(); message.path = object.path ?? new Uint8Array(); message.data = object.data ?? new Uint8Array(); if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = Long.fromValue(object.timestamp); + message.timestamp = BigInt(object.timestamp.toString()); } return message; }, @@ -467,21 +467,21 @@ export const SignatureAndData = { function createBaseTimestampedSignatureData(): TimestampedSignatureData { return { signatureData: new Uint8Array(), - timestamp: Long.UZERO, + timestamp: BigInt(0), }; } export const TimestampedSignatureData = { - encode(message: TimestampedSignatureData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TimestampedSignatureData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signatureData.length !== 0) { writer.uint32(10).bytes(message.signatureData); } - if (!message.timestamp.isZero()) { + if (message.timestamp !== BigInt(0)) { writer.uint32(16).uint64(message.timestamp); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TimestampedSignatureData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TimestampedSignatureData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTimestampedSignatureData(); while (reader.pos < end) { @@ -491,7 +491,7 @@ export const TimestampedSignatureData = { message.signatureData = reader.bytes(); break; case 2: - message.timestamp = reader.uint64() as Long; + message.timestamp = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -503,7 +503,7 @@ export const TimestampedSignatureData = { fromJSON(object: any): TimestampedSignatureData { const obj = createBaseTimestampedSignatureData(); if (isSet(object.signatureData)) obj.signatureData = bytesFromBase64(object.signatureData); - if (isSet(object.timestamp)) obj.timestamp = Long.fromValue(object.timestamp); + if (isSet(object.timestamp)) obj.timestamp = BigInt(object.timestamp.toString()); return obj; }, toJSON(message: TimestampedSignatureData): unknown { @@ -512,35 +512,33 @@ export const TimestampedSignatureData = { (obj.signatureData = base64FromBytes( message.signatureData !== undefined ? message.signatureData : new Uint8Array(), )); - message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): TimestampedSignatureData { + fromPartial(object: Partial): TimestampedSignatureData { const message = createBaseTimestampedSignatureData(); message.signatureData = object.signatureData ?? new Uint8Array(); if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = Long.fromValue(object.timestamp); + message.timestamp = BigInt(object.timestamp.toString()); } return message; }, }; function createBaseSignBytes(): SignBytes { return { - sequence: Long.UZERO, - timestamp: Long.UZERO, + sequence: BigInt(0), + timestamp: BigInt(0), diversifier: "", path: new Uint8Array(), data: new Uint8Array(), }; } export const SignBytes = { - encode(message: SignBytes, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.sequence.isZero()) { + encode(message: SignBytes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { writer.uint32(8).uint64(message.sequence); } - if (!message.timestamp.isZero()) { + if (message.timestamp !== BigInt(0)) { writer.uint32(16).uint64(message.timestamp); } if (message.diversifier !== "") { @@ -554,18 +552,18 @@ export const SignBytes = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignBytes { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignBytes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignBytes(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sequence = reader.uint64() as Long; + message.sequence = reader.uint64(); break; case 2: - message.timestamp = reader.uint64() as Long; + message.timestamp = reader.uint64(); break; case 3: message.diversifier = reader.string(); @@ -585,8 +583,8 @@ export const SignBytes = { }, fromJSON(object: any): SignBytes { const obj = createBaseSignBytes(); - if (isSet(object.sequence)) obj.sequence = Long.fromValue(object.sequence); - if (isSet(object.timestamp)) obj.timestamp = Long.fromValue(object.timestamp); + if (isSet(object.sequence)) obj.sequence = BigInt(object.sequence.toString()); + if (isSet(object.timestamp)) obj.timestamp = BigInt(object.timestamp.toString()); if (isSet(object.diversifier)) obj.diversifier = String(object.diversifier); if (isSet(object.path)) obj.path = bytesFromBase64(object.path); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); @@ -594,8 +592,8 @@ export const SignBytes = { }, toJSON(message: SignBytes): unknown { const obj: any = {}; - message.sequence !== undefined && (obj.sequence = (message.sequence || Long.UZERO).toString()); - message.timestamp !== undefined && (obj.timestamp = (message.timestamp || Long.UZERO).toString()); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.timestamp !== undefined && (obj.timestamp = (message.timestamp || BigInt(0)).toString()); message.diversifier !== undefined && (obj.diversifier = message.diversifier); message.path !== undefined && (obj.path = base64FromBytes(message.path !== undefined ? message.path : new Uint8Array())); @@ -603,13 +601,13 @@ export const SignBytes = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): SignBytes { + fromPartial(object: Partial): SignBytes { const message = createBaseSignBytes(); if (object.sequence !== undefined && object.sequence !== null) { - message.sequence = Long.fromValue(object.sequence); + message.sequence = BigInt(object.sequence.toString()); } if (object.timestamp !== undefined && object.timestamp !== null) { - message.timestamp = Long.fromValue(object.timestamp); + message.timestamp = BigInt(object.timestamp.toString()); } message.diversifier = object.diversifier ?? ""; message.path = object.path ?? new Uint8Array(); @@ -624,7 +622,7 @@ function createBaseHeaderData(): HeaderData { }; } export const HeaderData = { - encode(message: HeaderData, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HeaderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.newPubKey !== undefined) { Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); } @@ -633,8 +631,8 @@ export const HeaderData = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HeaderData { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HeaderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeaderData(); while (reader.pos < end) { @@ -666,7 +664,7 @@ export const HeaderData = { message.newDiversifier !== undefined && (obj.newDiversifier = message.newDiversifier); return obj; }, - fromPartial, I>>(object: I): HeaderData { + fromPartial(object: Partial): HeaderData { const message = createBaseHeaderData(); if (object.newPubKey !== undefined && object.newPubKey !== null) { message.newPubKey = Any.fromPartial(object.newPubKey); diff --git a/src/ibc/lightclients/tendermint/v1/tendermint.ts b/src/ibc/lightclients/tendermint/v1/tendermint.ts index 6bb9a82..942147d 100644 --- a/src/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/src/ibc/lightclients/tendermint/v1/tendermint.ts @@ -6,17 +6,14 @@ import { Timestamp } from "../../../../google/protobuf/timestamp"; import { MerkleRoot } from "../../../core/commitment/v1/commitment"; import { SignedHeader } from "../../../../tendermint/types/types"; import { ValidatorSet } from "../../../../tendermint/types/validator"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; import { - Long, isSet, - DeepPartial, - Exact, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes, } from "../../../../helpers"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "ibc.lightclients.tendermint.v1"; /** * ClientState from Tendermint tracks the current validator set, latest height, @@ -104,8 +101,8 @@ export interface Header { * supports positive values. */ export interface Fraction { - numerator: Long; - denominator: Long; + numerator: bigint; + denominator: bigint; } function createBaseClientState(): ClientState { return { @@ -123,7 +120,7 @@ function createBaseClientState(): ClientState { }; } export const ClientState = { - encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } @@ -159,8 +156,8 @@ export const ClientState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseClientState(); while (reader.pos < end) { @@ -255,7 +252,7 @@ export const ClientState = { (obj.allowUpdateAfterMisbehaviour = message.allowUpdateAfterMisbehaviour); return obj; }, - fromPartial, I>>(object: I): ClientState { + fromPartial(object: Partial): ClientState { const message = createBaseClientState(); message.chainId = object.chainId ?? ""; if (object.trustLevel !== undefined && object.trustLevel !== null) { @@ -291,7 +288,7 @@ function createBaseConsensusState(): ConsensusState { }; } export const ConsensusState = { - encode(message: ConsensusState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.timestamp !== undefined) { Timestamp.encode(message.timestamp, writer.uint32(10).fork()).ldelim(); } @@ -303,8 +300,8 @@ export const ConsensusState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusState(); while (reader.pos < end) { @@ -343,7 +340,7 @@ export const ConsensusState = { )); return obj; }, - fromPartial, I>>(object: I): ConsensusState { + fromPartial(object: Partial): ConsensusState { const message = createBaseConsensusState(); if (object.timestamp !== undefined && object.timestamp !== null) { message.timestamp = Timestamp.fromPartial(object.timestamp); @@ -363,7 +360,7 @@ function createBaseMisbehaviour(): Misbehaviour { }; } export const Misbehaviour = { - encode(message: Misbehaviour, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } @@ -375,8 +372,8 @@ export const Misbehaviour = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Misbehaviour { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMisbehaviour(); while (reader.pos < end) { @@ -414,7 +411,7 @@ export const Misbehaviour = { (obj.header2 = message.header2 ? Header.toJSON(message.header2) : undefined); return obj; }, - fromPartial, I>>(object: I): Misbehaviour { + fromPartial(object: Partial): Misbehaviour { const message = createBaseMisbehaviour(); message.clientId = object.clientId ?? ""; if (object.header1 !== undefined && object.header1 !== null) { @@ -435,7 +432,7 @@ function createBaseHeader(): Header { }; } export const Header = { - encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signedHeader !== undefined) { SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); } @@ -450,8 +447,8 @@ export const Header = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeader(); while (reader.pos < end) { @@ -499,7 +496,7 @@ export const Header = { : undefined); return obj; }, - fromPartial, I>>(object: I): Header { + fromPartial(object: Partial
): Header { const message = createBaseHeader(); if (object.signedHeader !== undefined && object.signedHeader !== null) { message.signedHeader = SignedHeader.fromPartial(object.signedHeader); @@ -518,32 +515,32 @@ export const Header = { }; function createBaseFraction(): Fraction { return { - numerator: Long.UZERO, - denominator: Long.UZERO, + numerator: BigInt(0), + denominator: BigInt(0), }; } export const Fraction = { - encode(message: Fraction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.numerator.isZero()) { + encode(message: Fraction, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.numerator !== BigInt(0)) { writer.uint32(8).uint64(message.numerator); } - if (!message.denominator.isZero()) { + if (message.denominator !== BigInt(0)) { writer.uint32(16).uint64(message.denominator); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Fraction { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Fraction { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFraction(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.numerator = reader.uint64() as Long; + message.numerator = reader.uint64(); break; case 2: - message.denominator = reader.uint64() as Long; + message.denominator = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -554,23 +551,23 @@ export const Fraction = { }, fromJSON(object: any): Fraction { const obj = createBaseFraction(); - if (isSet(object.numerator)) obj.numerator = Long.fromValue(object.numerator); - if (isSet(object.denominator)) obj.denominator = Long.fromValue(object.denominator); + if (isSet(object.numerator)) obj.numerator = BigInt(object.numerator.toString()); + if (isSet(object.denominator)) obj.denominator = BigInt(object.denominator.toString()); return obj; }, toJSON(message: Fraction): unknown { const obj: any = {}; - message.numerator !== undefined && (obj.numerator = (message.numerator || Long.UZERO).toString()); - message.denominator !== undefined && (obj.denominator = (message.denominator || Long.UZERO).toString()); + message.numerator !== undefined && (obj.numerator = (message.numerator || BigInt(0)).toString()); + message.denominator !== undefined && (obj.denominator = (message.denominator || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Fraction { + fromPartial(object: Partial): Fraction { const message = createBaseFraction(); if (object.numerator !== undefined && object.numerator !== null) { - message.numerator = Long.fromValue(object.numerator); + message.numerator = BigInt(object.numerator.toString()); } if (object.denominator !== undefined && object.denominator !== null) { - message.denominator = Long.fromValue(object.denominator); + message.denominator = BigInt(object.denominator.toString()); } return message; }, diff --git a/src/persistence/epochs/v1beta1/genesis.ts b/src/persistence/epochs/v1beta1/genesis.ts index d357077..9f0e3c3 100644 --- a/src/persistence/epochs/v1beta1/genesis.ts +++ b/src/persistence/epochs/v1beta1/genesis.ts @@ -1,17 +1,17 @@ /* eslint-disable */ import { Timestamp } from "../../../google/protobuf/timestamp"; import { Duration } from "../../../google/protobuf/duration"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "persistence.epochs.v1beta1"; export interface EpochInfo { identifier: string; startTime: Timestamp; duration: Duration; - currentEpoch: Long; + currentEpoch: bigint; currentEpochStartTime: Timestamp; epochCountingStarted: boolean; - currentEpochStartHeight: Long; + currentEpochStartHeight: bigint; } /** GenesisState defines the epochs module's genesis state. */ export interface GenesisState { @@ -22,14 +22,14 @@ function createBaseEpochInfo(): EpochInfo { identifier: "", startTime: Timestamp.fromPartial({}), duration: Duration.fromPartial({}), - currentEpoch: Long.ZERO, + currentEpoch: BigInt(0), currentEpochStartTime: Timestamp.fromPartial({}), epochCountingStarted: false, - currentEpochStartHeight: Long.ZERO, + currentEpochStartHeight: BigInt(0), }; } export const EpochInfo = { - encode(message: EpochInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EpochInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); } @@ -39,7 +39,7 @@ export const EpochInfo = { if (message.duration !== undefined) { Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); } - if (!message.currentEpoch.isZero()) { + if (message.currentEpoch !== BigInt(0)) { writer.uint32(32).int64(message.currentEpoch); } if (message.currentEpochStartTime !== undefined) { @@ -48,13 +48,13 @@ export const EpochInfo = { if (message.epochCountingStarted === true) { writer.uint32(48).bool(message.epochCountingStarted); } - if (!message.currentEpochStartHeight.isZero()) { + if (message.currentEpochStartHeight !== BigInt(0)) { writer.uint32(64).int64(message.currentEpochStartHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EpochInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EpochInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEpochInfo(); while (reader.pos < end) { @@ -70,7 +70,7 @@ export const EpochInfo = { message.duration = Duration.decode(reader, reader.uint32()); break; case 4: - message.currentEpoch = reader.int64() as Long; + message.currentEpoch = reader.int64(); break; case 5: message.currentEpochStartTime = Timestamp.decode(reader, reader.uint32()); @@ -79,7 +79,7 @@ export const EpochInfo = { message.epochCountingStarted = reader.bool(); break; case 8: - message.currentEpochStartHeight = reader.int64() as Long; + message.currentEpochStartHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -93,12 +93,12 @@ export const EpochInfo = { if (isSet(object.identifier)) obj.identifier = String(object.identifier); if (isSet(object.startTime)) obj.startTime = fromJsonTimestamp(object.startTime); if (isSet(object.duration)) obj.duration = Duration.fromJSON(object.duration); - if (isSet(object.currentEpoch)) obj.currentEpoch = Long.fromValue(object.currentEpoch); + if (isSet(object.currentEpoch)) obj.currentEpoch = BigInt(object.currentEpoch.toString()); if (isSet(object.currentEpochStartTime)) obj.currentEpochStartTime = fromJsonTimestamp(object.currentEpochStartTime); if (isSet(object.epochCountingStarted)) obj.epochCountingStarted = Boolean(object.epochCountingStarted); if (isSet(object.currentEpochStartHeight)) - obj.currentEpochStartHeight = Long.fromValue(object.currentEpochStartHeight); + obj.currentEpochStartHeight = BigInt(object.currentEpochStartHeight.toString()); return obj; }, toJSON(message: EpochInfo): unknown { @@ -107,15 +107,15 @@ export const EpochInfo = { message.startTime !== undefined && (obj.startTime = fromTimestamp(message.startTime).toISOString()); message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); - message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || Long.ZERO).toString()); + message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || BigInt(0)).toString()); message.currentEpochStartTime !== undefined && (obj.currentEpochStartTime = fromTimestamp(message.currentEpochStartTime).toISOString()); message.epochCountingStarted !== undefined && (obj.epochCountingStarted = message.epochCountingStarted); message.currentEpochStartHeight !== undefined && - (obj.currentEpochStartHeight = (message.currentEpochStartHeight || Long.ZERO).toString()); + (obj.currentEpochStartHeight = (message.currentEpochStartHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EpochInfo { + fromPartial(object: Partial): EpochInfo { const message = createBaseEpochInfo(); message.identifier = object.identifier ?? ""; if (object.startTime !== undefined && object.startTime !== null) { @@ -125,14 +125,14 @@ export const EpochInfo = { message.duration = Duration.fromPartial(object.duration); } if (object.currentEpoch !== undefined && object.currentEpoch !== null) { - message.currentEpoch = Long.fromValue(object.currentEpoch); + message.currentEpoch = BigInt(object.currentEpoch.toString()); } if (object.currentEpochStartTime !== undefined && object.currentEpochStartTime !== null) { message.currentEpochStartTime = Timestamp.fromPartial(object.currentEpochStartTime); } message.epochCountingStarted = object.epochCountingStarted ?? false; if (object.currentEpochStartHeight !== undefined && object.currentEpochStartHeight !== null) { - message.currentEpochStartHeight = Long.fromValue(object.currentEpochStartHeight); + message.currentEpochStartHeight = BigInt(object.currentEpochStartHeight.toString()); } return message; }, @@ -143,14 +143,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.epochs) { EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -180,7 +180,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); message.epochs = object.epochs?.map((e) => EpochInfo.fromPartial(e)) || []; return message; diff --git a/src/persistence/epochs/v1beta1/query.ts b/src/persistence/epochs/v1beta1/query.ts index 7dd2b69..d9a5b95 100644 --- a/src/persistence/epochs/v1beta1/query.ts +++ b/src/persistence/epochs/v1beta1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { EpochInfo } from "./genesis"; -import { Long, DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "persistence.epochs.v1beta1"; export interface QueryEpochsInfoRequest {} export interface QueryEpochsInfoResponse { @@ -11,17 +11,17 @@ export interface QueryCurrentEpochRequest { identifier: string; } export interface QueryCurrentEpochResponse { - currentEpoch: Long; + currentEpoch: bigint; } function createBaseQueryEpochsInfoRequest(): QueryEpochsInfoRequest { return {}; } export const QueryEpochsInfoRequest = { - encode(_: QueryEpochsInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryEpochsInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEpochsInfoRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEpochsInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEpochsInfoRequest(); while (reader.pos < end) { @@ -42,7 +42,7 @@ export const QueryEpochsInfoRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryEpochsInfoRequest { + fromPartial(_: Partial): QueryEpochsInfoRequest { const message = createBaseQueryEpochsInfoRequest(); return message; }, @@ -53,14 +53,14 @@ function createBaseQueryEpochsInfoResponse(): QueryEpochsInfoResponse { }; } export const QueryEpochsInfoResponse = { - encode(message: QueryEpochsInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryEpochsInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.epochs) { EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryEpochsInfoResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryEpochsInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEpochsInfoResponse(); while (reader.pos < end) { @@ -90,7 +90,7 @@ export const QueryEpochsInfoResponse = { } return obj; }, - fromPartial, I>>(object: I): QueryEpochsInfoResponse { + fromPartial(object: Partial): QueryEpochsInfoResponse { const message = createBaseQueryEpochsInfoResponse(); message.epochs = object.epochs?.map((e) => EpochInfo.fromPartial(e)) || []; return message; @@ -102,14 +102,14 @@ function createBaseQueryCurrentEpochRequest(): QueryCurrentEpochRequest { }; } export const QueryCurrentEpochRequest = { - encode(message: QueryCurrentEpochRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCurrentEpochRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentEpochRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentEpochRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentEpochRequest(); while (reader.pos < end) { @@ -135,9 +135,7 @@ export const QueryCurrentEpochRequest = { message.identifier !== undefined && (obj.identifier = message.identifier); return obj; }, - fromPartial, I>>( - object: I, - ): QueryCurrentEpochRequest { + fromPartial(object: Partial): QueryCurrentEpochRequest { const message = createBaseQueryCurrentEpochRequest(); message.identifier = object.identifier ?? ""; return message; @@ -145,25 +143,25 @@ export const QueryCurrentEpochRequest = { }; function createBaseQueryCurrentEpochResponse(): QueryCurrentEpochResponse { return { - currentEpoch: Long.ZERO, + currentEpoch: BigInt(0), }; } export const QueryCurrentEpochResponse = { - encode(message: QueryCurrentEpochResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.currentEpoch.isZero()) { + encode(message: QueryCurrentEpochResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.currentEpoch !== BigInt(0)) { writer.uint32(8).int64(message.currentEpoch); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentEpochResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCurrentEpochResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentEpochResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.currentEpoch = reader.int64() as Long; + message.currentEpoch = reader.int64(); break; default: reader.skipType(tag & 7); @@ -174,20 +172,18 @@ export const QueryCurrentEpochResponse = { }, fromJSON(object: any): QueryCurrentEpochResponse { const obj = createBaseQueryCurrentEpochResponse(); - if (isSet(object.currentEpoch)) obj.currentEpoch = Long.fromValue(object.currentEpoch); + if (isSet(object.currentEpoch)) obj.currentEpoch = BigInt(object.currentEpoch.toString()); return obj; }, toJSON(message: QueryCurrentEpochResponse): unknown { const obj: any = {}; - message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || Long.ZERO).toString()); + message.currentEpoch !== undefined && (obj.currentEpoch = (message.currentEpoch || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryCurrentEpochResponse { + fromPartial(object: Partial): QueryCurrentEpochResponse { const message = createBaseQueryCurrentEpochResponse(); if (object.currentEpoch !== undefined && object.currentEpoch !== null) { - message.currentEpoch = Long.fromValue(object.currentEpoch); + message.currentEpoch = BigInt(object.currentEpoch.toString()); } return message; }, @@ -209,11 +205,11 @@ export class QueryClientImpl implements Query { EpochInfos(request: QueryEpochsInfoRequest = {}): Promise { const data = QueryEpochsInfoRequest.encode(request).finish(); const promise = this.rpc.request("persistence.epochs.v1beta1.Query", "EpochInfos", data); - return promise.then((data) => QueryEpochsInfoResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryEpochsInfoResponse.decode(new BinaryReader(data))); } CurrentEpoch(request: QueryCurrentEpochRequest): Promise { const data = QueryCurrentEpochRequest.encode(request).finish(); const promise = this.rpc.request("persistence.epochs.v1beta1.Query", "CurrentEpoch", data); - return promise.then((data) => QueryCurrentEpochResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCurrentEpochResponse.decode(new BinaryReader(data))); } } diff --git a/src/persistence/halving/v1beta1/genesis.ts b/src/persistence/halving/v1beta1/genesis.ts index d5fe191..1e06246 100644 --- a/src/persistence/halving/v1beta1/genesis.ts +++ b/src/persistence/halving/v1beta1/genesis.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./halving"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "persistence.halving.v1beta1"; /** GenesisState defines the halving module's genesis state. */ export interface GenesisState { @@ -14,14 +14,14 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -47,7 +47,7 @@ export const GenesisState = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); diff --git a/src/persistence/halving/v1beta1/halving.ts b/src/persistence/halving/v1beta1/halving.ts index cd30449..0e4362b 100644 --- a/src/persistence/halving/v1beta1/halving.ts +++ b/src/persistence/halving/v1beta1/halving.ts @@ -1,33 +1,33 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "persistence.halving.v1beta1"; /** Params holds parameters for the halving module. */ export interface Params { /** periodic height at which inflation decreases */ - blockHeight: Long; + blockHeight: bigint; } function createBaseParams(): Params { return { - blockHeight: Long.UZERO, + blockHeight: BigInt(0), }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockHeight.isZero()) { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { writer.uint32(8).uint64(message.blockHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockHeight = reader.uint64() as Long; + message.blockHeight = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -38,18 +38,18 @@ export const Params = { }, fromJSON(object: any): Params { const obj = createBaseParams(); - if (isSet(object.blockHeight)) obj.blockHeight = Long.fromValue(object.blockHeight); + if (isSet(object.blockHeight)) obj.blockHeight = BigInt(object.blockHeight.toString()); return obj; }, toJSON(message: Params): unknown { const obj: any = {}; - message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || Long.UZERO).toString()); + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); if (object.blockHeight !== undefined && object.blockHeight !== null) { - message.blockHeight = Long.fromValue(object.blockHeight); + message.blockHeight = BigInt(object.blockHeight.toString()); } return message; }, diff --git a/src/persistence/halving/v1beta1/query.ts b/src/persistence/halving/v1beta1/query.ts index 7d734ff..101c29d 100644 --- a/src/persistence/halving/v1beta1/query.ts +++ b/src/persistence/halving/v1beta1/query.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Params } from "./halving"; -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "persistence.halving.v1beta1"; /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -14,11 +14,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -39,7 +39,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -50,14 +50,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -83,7 +83,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -105,6 +105,6 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("persistence.halving.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/pstake/client.ts b/src/pstake/client.ts new file mode 100644 index 0000000..5e5b97b --- /dev/null +++ b/src/pstake/client.ts @@ -0,0 +1,43 @@ +/* eslint-disable */ +import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; +import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as pstakeLiquidstakeibcV1beta1MsgsRegistry from "./liquidstakeibc/v1beta1/msgs.registry"; +import * as pstakeLscosmosV1beta1MsgsRegistry from "./lscosmos/v1beta1/msgs.registry"; +import * as pstakeLiquidstakeibcV1beta1MsgsAmino from "./liquidstakeibc/v1beta1/msgs.amino"; +import * as pstakeLscosmosV1beta1MsgsAmino from "./lscosmos/v1beta1/msgs.amino"; +export const pstakeAminoConverters = { + ...pstakeLiquidstakeibcV1beta1MsgsAmino.AminoConverter, + ...pstakeLscosmosV1beta1MsgsAmino.AminoConverter, +}; +export const pstakeProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ + ...pstakeLiquidstakeibcV1beta1MsgsRegistry.registry, + ...pstakeLscosmosV1beta1MsgsRegistry.registry, +]; +export const getSigningPstakeClientOptions = (): { + registry: Registry; + aminoTypes: AminoTypes; +} => { + const registry = new Registry([...pstakeProtoRegistry]); + const aminoTypes = new AminoTypes({ + ...pstakeAminoConverters, + }); + return { + registry, + aminoTypes, + }; +}; +export const getSigningPstakeClient = async ({ + rpcEndpoint, + signer, +}: { + rpcEndpoint: string | HttpEndpoint; + signer: OfflineSigner; +}) => { + const { registry, aminoTypes } = getSigningPstakeClientOptions(); + const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { + registry: registry as any, + aminoTypes, + }); + return client; +}; diff --git a/src/pstake/liquidstakeibc/v1beta1/genesis.ts b/src/pstake/liquidstakeibc/v1beta1/genesis.ts index f5dc9d5..65e75c4 100644 --- a/src/pstake/liquidstakeibc/v1beta1/genesis.ts +++ b/src/pstake/liquidstakeibc/v1beta1/genesis.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Params } from "./params"; import { HostChain, Deposit, Unbonding, UserUnbonding, ValidatorUnbonding } from "./liquidstakeibc"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "pstake.liquidstakeibc.v1beta1"; /** GenesisState defines the liquidstakeibc module's genesis state. */ export interface GenesisState { @@ -29,7 +29,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -50,8 +50,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -128,7 +128,7 @@ export const GenesisState = { } return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); diff --git a/src/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts b/src/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts index 6dbbef3..5248b2f 100644 --- a/src/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts +++ b/src/pstake/liquidstakeibc/v1beta1/liquidstakeibc.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Long, isSet, DeepPartial, Exact, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "pstake.liquidstakeibc.v1beta1"; export enum ICAAccount_ChannelState { /** ICA_CHANNEL_CREATING - ICA channel is being created */ @@ -214,7 +214,7 @@ export interface HostChain { /** previous redemption rate */ lastCValue: string; /** undelegation epoch factor */ - unbondingFactor: Long; + unbondingFactor: bigint; /** whether the chain is ready to accept delegations or not */ active: boolean; /** factor limit for auto-compounding, daily periodic rate (APY / 365s) */ @@ -258,7 +258,7 @@ export interface Validator { /** the validator token exchange rate, total bonded tokens divided by total shares issued */ exchangeRate: string; /** the unbonding epoch number when the validator transitioned into the state */ - unbondingEpoch: Long; + unbondingEpoch: bigint; /** whether the validator can accept delegations or not, default true for non-lsm chains */ delegable: boolean; } @@ -267,7 +267,7 @@ export interface Deposit { chainId: string; amount: Coin; /** epoch number of the deposit */ - epoch: Long; + epoch: bigint; /** state */ state: Deposit_DepositState; /** sequence id of the ibc transaction */ @@ -298,7 +298,7 @@ export interface Unbonding { /** unbonding target chain */ chainId: string; /** epoch number of the unbonding record */ - epochNumber: Long; + epochNumber: bigint; /** time when the unbonding matures and can be collected */ matureTime: Timestamp; /** stk token amount that is burned with the unbonding */ @@ -314,7 +314,7 @@ export interface UserUnbonding { /** unbonding target chain */ chainId: string; /** epoch when the unbonding started */ - epochNumber: Long; + epochNumber: bigint; /** address which requested the unbonding */ address: string; /** stk token amount that is being unbonded */ @@ -326,7 +326,7 @@ export interface ValidatorUnbonding { /** unbonding target chain */ chainId: string; /** epoch when the unbonding started */ - epochNumber: Long; + epochNumber: bigint; /** time when the unbonding matures and can be collected */ matureTime: Timestamp; /** address of the validator that is being unbonded */ @@ -354,14 +354,14 @@ function createBaseHostChain(): HostChain { minimumDeposit: "", cValue: "", lastCValue: "", - unbondingFactor: Long.ZERO, + unbondingFactor: BigInt(0), active: false, autoCompoundFactor: "", flags: HostChainFlags.fromPartial({}), }; } export const HostChain = { - encode(message: HostChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } @@ -398,7 +398,7 @@ export const HostChain = { if (message.lastCValue !== "") { writer.uint32(98).string(message.lastCValue); } - if (!message.unbondingFactor.isZero()) { + if (message.unbondingFactor !== BigInt(0)) { writer.uint32(104).int64(message.unbondingFactor); } if (message.active === true) { @@ -412,8 +412,8 @@ export const HostChain = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostChain(); while (reader.pos < end) { @@ -456,7 +456,7 @@ export const HostChain = { message.lastCValue = reader.string(); break; case 13: - message.unbondingFactor = reader.int64() as Long; + message.unbondingFactor = reader.int64(); break; case 14: message.active = reader.bool(); @@ -490,7 +490,7 @@ export const HostChain = { if (isSet(object.minimumDeposit)) obj.minimumDeposit = String(object.minimumDeposit); if (isSet(object.cValue)) obj.cValue = String(object.cValue); if (isSet(object.lastCValue)) obj.lastCValue = String(object.lastCValue); - if (isSet(object.unbondingFactor)) obj.unbondingFactor = Long.fromValue(object.unbondingFactor); + if (isSet(object.unbondingFactor)) obj.unbondingFactor = BigInt(object.unbondingFactor.toString()); if (isSet(object.active)) obj.active = Boolean(object.active); if (isSet(object.autoCompoundFactor)) obj.autoCompoundFactor = String(object.autoCompoundFactor); if (isSet(object.flags)) obj.flags = HostChainFlags.fromJSON(object.flags); @@ -520,14 +520,14 @@ export const HostChain = { message.cValue !== undefined && (obj.cValue = message.cValue); message.lastCValue !== undefined && (obj.lastCValue = message.lastCValue); message.unbondingFactor !== undefined && - (obj.unbondingFactor = (message.unbondingFactor || Long.ZERO).toString()); + (obj.unbondingFactor = (message.unbondingFactor || BigInt(0)).toString()); message.active !== undefined && (obj.active = message.active); message.autoCompoundFactor !== undefined && (obj.autoCompoundFactor = message.autoCompoundFactor); message.flags !== undefined && (obj.flags = message.flags ? HostChainFlags.toJSON(message.flags) : undefined); return obj; }, - fromPartial, I>>(object: I): HostChain { + fromPartial(object: Partial): HostChain { const message = createBaseHostChain(); message.chainId = object.chainId ?? ""; message.connectionId = object.connectionId ?? ""; @@ -548,7 +548,7 @@ export const HostChain = { message.cValue = object.cValue ?? ""; message.lastCValue = object.lastCValue ?? ""; if (object.unbondingFactor !== undefined && object.unbondingFactor !== null) { - message.unbondingFactor = Long.fromValue(object.unbondingFactor); + message.unbondingFactor = BigInt(object.unbondingFactor.toString()); } message.active = object.active ?? false; message.autoCompoundFactor = object.autoCompoundFactor ?? ""; @@ -564,14 +564,14 @@ function createBaseHostChainFlags(): HostChainFlags { }; } export const HostChainFlags = { - encode(message: HostChainFlags, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostChainFlags, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.lsm === true) { writer.uint32(8).bool(message.lsm); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostChainFlags { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostChainFlags { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostChainFlags(); while (reader.pos < end) { @@ -597,7 +597,7 @@ export const HostChainFlags = { message.lsm !== undefined && (obj.lsm = message.lsm); return obj; }, - fromPartial, I>>(object: I): HostChainFlags { + fromPartial(object: Partial): HostChainFlags { const message = createBaseHostChainFlags(); message.lsm = object.lsm ?? false; return message; @@ -614,7 +614,7 @@ function createBaseHostChainLSParams(): HostChainLSParams { }; } export const HostChainLSParams = { - encode(message: HostChainLSParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostChainLSParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.depositFee !== "") { writer.uint32(10).string(message.depositFee); } @@ -635,8 +635,8 @@ export const HostChainLSParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostChainLSParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostChainLSParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostChainLSParams(); while (reader.pos < end) { @@ -687,7 +687,7 @@ export const HostChainLSParams = { message.lsmBondFactor !== undefined && (obj.lsmBondFactor = message.lsmBondFactor); return obj; }, - fromPartial, I>>(object: I): HostChainLSParams { + fromPartial(object: Partial): HostChainLSParams { const message = createBaseHostChainLSParams(); message.depositFee = object.depositFee ?? ""; message.restakeFee = object.restakeFee ?? ""; @@ -707,7 +707,7 @@ function createBaseICAAccount(): ICAAccount { }; } export const ICAAccount = { - encode(message: ICAAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ICAAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -722,8 +722,8 @@ export const ICAAccount = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ICAAccount { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ICAAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseICAAccount(); while (reader.pos < end) { @@ -766,7 +766,7 @@ export const ICAAccount = { (obj.channelState = iCAAccount_ChannelStateToJSON(message.channelState)); return obj; }, - fromPartial, I>>(object: I): ICAAccount { + fromPartial(object: Partial): ICAAccount { const message = createBaseICAAccount(); message.address = object.address ?? ""; if (object.balance !== undefined && object.balance !== null) { @@ -784,12 +784,12 @@ function createBaseValidator(): Validator { weight: "", delegatedAmount: "", exchangeRate: "", - unbondingEpoch: Long.ZERO, + unbondingEpoch: BigInt(0), delegable: false, }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.operatorAddress !== "") { writer.uint32(10).string(message.operatorAddress); } @@ -805,7 +805,7 @@ export const Validator = { if (message.exchangeRate !== "") { writer.uint32(42).string(message.exchangeRate); } - if (!message.unbondingEpoch.isZero()) { + if (message.unbondingEpoch !== BigInt(0)) { writer.uint32(48).int64(message.unbondingEpoch); } if (message.delegable === true) { @@ -813,8 +813,8 @@ export const Validator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -836,7 +836,7 @@ export const Validator = { message.exchangeRate = reader.string(); break; case 6: - message.unbondingEpoch = reader.int64() as Long; + message.unbondingEpoch = reader.int64(); break; case 7: message.delegable = reader.bool(); @@ -855,7 +855,7 @@ export const Validator = { if (isSet(object.weight)) obj.weight = String(object.weight); if (isSet(object.delegatedAmount)) obj.delegatedAmount = String(object.delegatedAmount); if (isSet(object.exchangeRate)) obj.exchangeRate = String(object.exchangeRate); - if (isSet(object.unbondingEpoch)) obj.unbondingEpoch = Long.fromValue(object.unbondingEpoch); + if (isSet(object.unbondingEpoch)) obj.unbondingEpoch = BigInt(object.unbondingEpoch.toString()); if (isSet(object.delegable)) obj.delegable = Boolean(object.delegable); return obj; }, @@ -867,11 +867,11 @@ export const Validator = { message.delegatedAmount !== undefined && (obj.delegatedAmount = message.delegatedAmount); message.exchangeRate !== undefined && (obj.exchangeRate = message.exchangeRate); message.unbondingEpoch !== undefined && - (obj.unbondingEpoch = (message.unbondingEpoch || Long.ZERO).toString()); + (obj.unbondingEpoch = (message.unbondingEpoch || BigInt(0)).toString()); message.delegable !== undefined && (obj.delegable = message.delegable); return obj; }, - fromPartial, I>>(object: I): Validator { + fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.operatorAddress = object.operatorAddress ?? ""; message.status = object.status ?? ""; @@ -879,7 +879,7 @@ export const Validator = { message.delegatedAmount = object.delegatedAmount ?? ""; message.exchangeRate = object.exchangeRate ?? ""; if (object.unbondingEpoch !== undefined && object.unbondingEpoch !== null) { - message.unbondingEpoch = Long.fromValue(object.unbondingEpoch); + message.unbondingEpoch = BigInt(object.unbondingEpoch.toString()); } message.delegable = object.delegable ?? false; return message; @@ -889,20 +889,20 @@ function createBaseDeposit(): Deposit { return { chainId: "", amount: Coin.fromPartial({}), - epoch: Long.ZERO, + epoch: BigInt(0), state: 0, ibcSequenceId: "", }; } export const Deposit = { - encode(message: Deposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } if (message.amount !== undefined) { Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); } - if (!message.epoch.isZero()) { + if (message.epoch !== BigInt(0)) { writer.uint32(24).int64(message.epoch); } if (message.state !== 0) { @@ -913,8 +913,8 @@ export const Deposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Deposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDeposit(); while (reader.pos < end) { @@ -927,7 +927,7 @@ export const Deposit = { message.amount = Coin.decode(reader, reader.uint32()); break; case 3: - message.epoch = reader.int64() as Long; + message.epoch = reader.int64(); break; case 4: message.state = reader.int32() as any; @@ -946,7 +946,7 @@ export const Deposit = { const obj = createBaseDeposit(); if (isSet(object.chainId)) obj.chainId = String(object.chainId); if (isSet(object.amount)) obj.amount = Coin.fromJSON(object.amount); - if (isSet(object.epoch)) obj.epoch = Long.fromValue(object.epoch); + if (isSet(object.epoch)) obj.epoch = BigInt(object.epoch.toString()); if (isSet(object.state)) obj.state = deposit_DepositStateFromJSON(object.state); if (isSet(object.ibcSequenceId)) obj.ibcSequenceId = String(object.ibcSequenceId); return obj; @@ -955,19 +955,19 @@ export const Deposit = { const obj: any = {}; message.chainId !== undefined && (obj.chainId = message.chainId); message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); - message.epoch !== undefined && (obj.epoch = (message.epoch || Long.ZERO).toString()); + message.epoch !== undefined && (obj.epoch = (message.epoch || BigInt(0)).toString()); message.state !== undefined && (obj.state = deposit_DepositStateToJSON(message.state)); message.ibcSequenceId !== undefined && (obj.ibcSequenceId = message.ibcSequenceId); return obj; }, - fromPartial, I>>(object: I): Deposit { + fromPartial(object: Partial): Deposit { const message = createBaseDeposit(); message.chainId = object.chainId ?? ""; if (object.amount !== undefined && object.amount !== null) { message.amount = Coin.fromPartial(object.amount); } if (object.epoch !== undefined && object.epoch !== null) { - message.epoch = Long.fromValue(object.epoch); + message.epoch = BigInt(object.epoch.toString()); } message.state = object.state ?? 0; message.ibcSequenceId = object.ibcSequenceId ?? ""; @@ -987,7 +987,7 @@ function createBaseLSMDeposit(): LSMDeposit { }; } export const LSMDeposit = { - encode(message: LSMDeposit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: LSMDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } @@ -1014,8 +1014,8 @@ export const LSMDeposit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LSMDeposit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LSMDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLSMDeposit(); while (reader.pos < end) { @@ -1076,7 +1076,7 @@ export const LSMDeposit = { message.ibcSequenceId !== undefined && (obj.ibcSequenceId = message.ibcSequenceId); return obj; }, - fromPartial, I>>(object: I): LSMDeposit { + fromPartial(object: Partial): LSMDeposit { const message = createBaseLSMDeposit(); message.chainId = object.chainId ?? ""; message.amount = object.amount ?? ""; @@ -1092,7 +1092,7 @@ export const LSMDeposit = { function createBaseUnbonding(): Unbonding { return { chainId: "", - epochNumber: Long.ZERO, + epochNumber: BigInt(0), matureTime: Timestamp.fromPartial({}), burnAmount: Coin.fromPartial({}), unbondAmount: Coin.fromPartial({}), @@ -1101,11 +1101,11 @@ function createBaseUnbonding(): Unbonding { }; } export const Unbonding = { - encode(message: Unbonding, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Unbonding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } - if (!message.epochNumber.isZero()) { + if (message.epochNumber !== BigInt(0)) { writer.uint32(16).int64(message.epochNumber); } if (message.matureTime !== undefined) { @@ -1125,8 +1125,8 @@ export const Unbonding = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Unbonding { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Unbonding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnbonding(); while (reader.pos < end) { @@ -1136,7 +1136,7 @@ export const Unbonding = { message.chainId = reader.string(); break; case 2: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 3: message.matureTime = Timestamp.decode(reader, reader.uint32()); @@ -1163,7 +1163,7 @@ export const Unbonding = { fromJSON(object: any): Unbonding { const obj = createBaseUnbonding(); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.matureTime)) obj.matureTime = fromJsonTimestamp(object.matureTime); if (isSet(object.burnAmount)) obj.burnAmount = Coin.fromJSON(object.burnAmount); if (isSet(object.unbondAmount)) obj.unbondAmount = Coin.fromJSON(object.unbondAmount); @@ -1174,7 +1174,7 @@ export const Unbonding = { toJSON(message: Unbonding): unknown { const obj: any = {}; message.chainId !== undefined && (obj.chainId = message.chainId); - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.matureTime !== undefined && (obj.matureTime = fromTimestamp(message.matureTime).toISOString()); message.burnAmount !== undefined && (obj.burnAmount = message.burnAmount ? Coin.toJSON(message.burnAmount) : undefined); @@ -1184,11 +1184,11 @@ export const Unbonding = { message.state !== undefined && (obj.state = unbonding_UnbondingStateToJSON(message.state)); return obj; }, - fromPartial, I>>(object: I): Unbonding { + fromPartial(object: Partial): Unbonding { const message = createBaseUnbonding(); message.chainId = object.chainId ?? ""; if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } if (object.matureTime !== undefined && object.matureTime !== null) { message.matureTime = Timestamp.fromPartial(object.matureTime); @@ -1207,18 +1207,18 @@ export const Unbonding = { function createBaseUserUnbonding(): UserUnbonding { return { chainId: "", - epochNumber: Long.ZERO, + epochNumber: BigInt(0), address: "", stkAmount: Coin.fromPartial({}), unbondAmount: Coin.fromPartial({}), }; } export const UserUnbonding = { - encode(message: UserUnbonding, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UserUnbonding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } - if (!message.epochNumber.isZero()) { + if (message.epochNumber !== BigInt(0)) { writer.uint32(16).int64(message.epochNumber); } if (message.address !== "") { @@ -1232,8 +1232,8 @@ export const UserUnbonding = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UserUnbonding { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UserUnbonding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUserUnbonding(); while (reader.pos < end) { @@ -1243,7 +1243,7 @@ export const UserUnbonding = { message.chainId = reader.string(); break; case 2: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 3: message.address = reader.string(); @@ -1264,7 +1264,7 @@ export const UserUnbonding = { fromJSON(object: any): UserUnbonding { const obj = createBaseUserUnbonding(); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.address)) obj.address = String(object.address); if (isSet(object.stkAmount)) obj.stkAmount = Coin.fromJSON(object.stkAmount); if (isSet(object.unbondAmount)) obj.unbondAmount = Coin.fromJSON(object.unbondAmount); @@ -1273,7 +1273,7 @@ export const UserUnbonding = { toJSON(message: UserUnbonding): unknown { const obj: any = {}; message.chainId !== undefined && (obj.chainId = message.chainId); - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.address !== undefined && (obj.address = message.address); message.stkAmount !== undefined && (obj.stkAmount = message.stkAmount ? Coin.toJSON(message.stkAmount) : undefined); @@ -1281,11 +1281,11 @@ export const UserUnbonding = { (obj.unbondAmount = message.unbondAmount ? Coin.toJSON(message.unbondAmount) : undefined); return obj; }, - fromPartial, I>>(object: I): UserUnbonding { + fromPartial(object: Partial): UserUnbonding { const message = createBaseUserUnbonding(); message.chainId = object.chainId ?? ""; if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } message.address = object.address ?? ""; if (object.stkAmount !== undefined && object.stkAmount !== null) { @@ -1300,7 +1300,7 @@ export const UserUnbonding = { function createBaseValidatorUnbonding(): ValidatorUnbonding { return { chainId: "", - epochNumber: Long.ZERO, + epochNumber: BigInt(0), matureTime: Timestamp.fromPartial({}), validatorAddress: "", amount: Coin.fromPartial({}), @@ -1308,11 +1308,11 @@ function createBaseValidatorUnbonding(): ValidatorUnbonding { }; } export const ValidatorUnbonding = { - encode(message: ValidatorUnbonding, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorUnbonding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } - if (!message.epochNumber.isZero()) { + if (message.epochNumber !== BigInt(0)) { writer.uint32(16).int64(message.epochNumber); } if (message.matureTime !== undefined) { @@ -1329,8 +1329,8 @@ export const ValidatorUnbonding = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUnbonding { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUnbonding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorUnbonding(); while (reader.pos < end) { @@ -1340,7 +1340,7 @@ export const ValidatorUnbonding = { message.chainId = reader.string(); break; case 2: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 3: message.matureTime = Timestamp.decode(reader, reader.uint32()); @@ -1364,7 +1364,7 @@ export const ValidatorUnbonding = { fromJSON(object: any): ValidatorUnbonding { const obj = createBaseValidatorUnbonding(); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.matureTime)) obj.matureTime = fromJsonTimestamp(object.matureTime); if (isSet(object.validatorAddress)) obj.validatorAddress = String(object.validatorAddress); if (isSet(object.amount)) obj.amount = Coin.fromJSON(object.amount); @@ -1374,18 +1374,18 @@ export const ValidatorUnbonding = { toJSON(message: ValidatorUnbonding): unknown { const obj: any = {}; message.chainId !== undefined && (obj.chainId = message.chainId); - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.matureTime !== undefined && (obj.matureTime = fromTimestamp(message.matureTime).toISOString()); message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); message.ibcSequenceId !== undefined && (obj.ibcSequenceId = message.ibcSequenceId); return obj; }, - fromPartial, I>>(object: I): ValidatorUnbonding { + fromPartial(object: Partial): ValidatorUnbonding { const message = createBaseValidatorUnbonding(); message.chainId = object.chainId ?? ""; if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } if (object.matureTime !== undefined && object.matureTime !== null) { message.matureTime = Timestamp.fromPartial(object.matureTime); @@ -1405,7 +1405,7 @@ function createBaseKVUpdate(): KVUpdate { }; } export const KVUpdate = { - encode(message: KVUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: KVUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -1414,8 +1414,8 @@ export const KVUpdate = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): KVUpdate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): KVUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseKVUpdate(); while (reader.pos < end) { @@ -1446,7 +1446,7 @@ export const KVUpdate = { message.value !== undefined && (obj.value = message.value); return obj; }, - fromPartial, I>>(object: I): KVUpdate { + fromPartial(object: Partial): KVUpdate { const message = createBaseKVUpdate(); message.key = object.key ?? ""; message.value = object.value ?? ""; diff --git a/src/pstake/liquidstakeibc/v1beta1/msgs.amino.ts b/src/pstake/liquidstakeibc/v1beta1/msgs.amino.ts new file mode 100644 index 0000000..1bda540 --- /dev/null +++ b/src/pstake/liquidstakeibc/v1beta1/msgs.amino.ts @@ -0,0 +1,293 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { + MsgRegisterHostChain, + MsgUpdateHostChain, + MsgLiquidStake, + MsgLiquidStakeLSM, + MsgLiquidUnstake, + MsgRedeem, + MsgUpdateParams, +} from "./msgs"; +export interface MsgRegisterHostChainAminoType extends AminoMsg { + type: "pstake/MsgRegisterHostChain"; + value: { + authority: string; + connection_id: string; + deposit_fee: string; + restake_fee: string; + unstake_fee: string; + redemption_fee: string; + channel_id: string; + port_id: string; + host_denom: string; + minimum_deposit: string; + unbonding_factor: string; + auto_compound_factor: string; + }; +} +export interface MsgUpdateHostChainAminoType extends AminoMsg { + type: "pstake/MsgUpdateHostChain"; + value: { + authority: string; + chain_id: string; + updates: { + key: string; + value: string; + }[]; + }; +} +export interface MsgLiquidStakeAminoType extends AminoMsg { + type: "pstake/MsgLiquidStake"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgLiquidStakeLSMAminoType extends AminoMsg { + type: "pstake/MsgLiquidStakeLSM"; + value: { + delegator_address: string; + delegations: { + denom: string; + amount: string; + }[]; + }; +} +export interface MsgLiquidUnstakeAminoType extends AminoMsg { + type: "pstake/MsgLiquidUnstake"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgRedeemAminoType extends AminoMsg { + type: "pstake/MsgRedeem"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgUpdateParamsAminoType extends AminoMsg { + type: "pstake/MsgUpdateParams"; + value: { + authority: string; + params: { + admin_address: string; + fee_address: string; + upper_c_value_limit: string; + lower_c_value_limit: string; + }; + }; +} +export const AminoConverter = { + "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain": { + aminoType: "pstake/MsgRegisterHostChain", + toAmino: ({ + authority, + connectionId, + depositFee, + restakeFee, + unstakeFee, + redemptionFee, + channelId, + portId, + hostDenom, + minimumDeposit, + unbondingFactor, + autoCompoundFactor, + }: MsgRegisterHostChain): MsgRegisterHostChainAminoType["value"] => { + return { + authority, + connection_id: connectionId, + deposit_fee: depositFee, + restake_fee: restakeFee, + unstake_fee: unstakeFee, + redemption_fee: redemptionFee, + channel_id: channelId, + port_id: portId, + host_denom: hostDenom, + minimum_deposit: minimumDeposit, + unbonding_factor: unbondingFactor.toString(), + auto_compound_factor: autoCompoundFactor.toString(), + }; + }, + fromAmino: ({ + authority, + connection_id, + deposit_fee, + restake_fee, + unstake_fee, + redemption_fee, + channel_id, + port_id, + host_denom, + minimum_deposit, + unbonding_factor, + auto_compound_factor, + }: MsgRegisterHostChainAminoType["value"]): MsgRegisterHostChain => { + return { + authority, + connectionId: connection_id, + depositFee: deposit_fee, + restakeFee: restake_fee, + unstakeFee: unstake_fee, + redemptionFee: redemption_fee, + channelId: channel_id, + portId: port_id, + hostDenom: host_denom, + minimumDeposit: minimum_deposit, + unbondingFactor: BigInt(unbonding_factor), + autoCompoundFactor: BigInt(auto_compound_factor), + }; + }, + }, + "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain": { + aminoType: "pstake/MsgUpdateHostChain", + toAmino: ({ authority, chainId, updates }: MsgUpdateHostChain): MsgUpdateHostChainAminoType["value"] => { + return { + authority, + chain_id: chainId, + updates: updates.map((el0) => ({ + key: el0.key, + value: el0.value, + })), + }; + }, + fromAmino: ({ + authority, + chain_id, + updates, + }: MsgUpdateHostChainAminoType["value"]): MsgUpdateHostChain => { + return { + authority, + chainId: chain_id, + updates: updates.map((el0) => ({ + key: el0.key, + value: el0.value, + })), + }; + }, + }, + "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake": { + aminoType: "pstake/MsgLiquidStake", + toAmino: ({ delegatorAddress, amount }: MsgLiquidStake): MsgLiquidStakeAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ delegator_address, amount }: MsgLiquidStakeAminoType["value"]): MsgLiquidStake => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM": { + aminoType: "pstake/MsgLiquidStakeLSM", + toAmino: ({ delegatorAddress, delegations }: MsgLiquidStakeLSM): MsgLiquidStakeLSMAminoType["value"] => { + return { + delegator_address: delegatorAddress, + delegations: delegations.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + fromAmino: ({ + delegator_address, + delegations, + }: MsgLiquidStakeLSMAminoType["value"]): MsgLiquidStakeLSM => { + return { + delegatorAddress: delegator_address, + delegations: delegations.map((el0) => ({ + denom: el0.denom, + amount: el0.amount, + })), + }; + }, + }, + "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake": { + aminoType: "pstake/MsgLiquidUnstake", + toAmino: ({ delegatorAddress, amount }: MsgLiquidUnstake): MsgLiquidUnstakeAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ delegator_address, amount }: MsgLiquidUnstakeAminoType["value"]): MsgLiquidUnstake => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/pstake.liquidstakeibc.v1beta1.MsgRedeem": { + aminoType: "pstake/MsgRedeem", + toAmino: ({ delegatorAddress, amount }: MsgRedeem): MsgRedeemAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ delegator_address, amount }: MsgRedeemAminoType["value"]): MsgRedeem => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams": { + aminoType: "pstake/MsgUpdateParams", + toAmino: ({ authority, params }: MsgUpdateParams): MsgUpdateParamsAminoType["value"] => { + return { + authority, + params: { + admin_address: params.adminAddress, + fee_address: params.feeAddress, + upper_c_value_limit: params.upperCValueLimit, + lower_c_value_limit: params.lowerCValueLimit, + }, + }; + }, + fromAmino: ({ authority, params }: MsgUpdateParamsAminoType["value"]): MsgUpdateParams => { + return { + authority, + params: { + adminAddress: params.admin_address, + feeAddress: params.fee_address, + upperCValueLimit: params.upper_c_value_limit, + lowerCValueLimit: params.lower_c_value_limit, + }, + }; + }, + }, +}; diff --git a/src/pstake/liquidstakeibc/v1beta1/msgs.registry.ts b/src/pstake/liquidstakeibc/v1beta1/msgs.registry.ts new file mode 100644 index 0000000..70abb28 --- /dev/null +++ b/src/pstake/liquidstakeibc/v1beta1/msgs.registry.ts @@ -0,0 +1,248 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgRegisterHostChain, + MsgUpdateHostChain, + MsgLiquidStake, + MsgLiquidStakeLSM, + MsgLiquidUnstake, + MsgRedeem, + MsgUpdateParams, +} from "./msgs"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", MsgRegisterHostChain], + ["/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", MsgUpdateHostChain], + ["/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", MsgLiquidStake], + ["/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", MsgLiquidStakeLSM], + ["/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", MsgLiquidUnstake], + ["/pstake.liquidstakeibc.v1beta1.MsgRedeem", MsgRedeem], + ["/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", MsgUpdateParams], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.encode(value).finish(), + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.encode(value).finish(), + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(value).finish(), + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.encode(value).finish(), + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(value).finish(), + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.encode(value).finish(), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value, + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value, + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value, + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value, + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value, + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value, + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value, + }; + }, + }, + toJSON: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.toJSON(value), + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.toJSON(value), + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.toJSON(value), + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.toJSON(value), + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.toJSON(value), + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.toJSON(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value), + }; + }, + }, + fromJSON: { + registerHostChain(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.fromJSON(value), + }; + }, + updateHostChain(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.fromJSON(value), + }; + }, + liquidStake(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromJSON(value), + }; + }, + liquidStakeLSM(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.fromJSON(value), + }; + }, + liquidUnstake(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromJSON(value), + }; + }, + redeem(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.fromJSON(value), + }; + }, + updateParams(value: any) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value), + }; + }, + }, + fromPartial: { + registerHostChain(value: MsgRegisterHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRegisterHostChain", + value: MsgRegisterHostChain.fromPartial(value), + }; + }, + updateHostChain(value: MsgUpdateHostChain) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateHostChain", + value: MsgUpdateHostChain.fromPartial(value), + }; + }, + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromPartial(value), + }; + }, + liquidStakeLSM(value: MsgLiquidStakeLSM) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidStakeLSM", + value: MsgLiquidStakeLSM.fromPartial(value), + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromPartial(value), + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgRedeem", + value: MsgRedeem.fromPartial(value), + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/pstake.liquidstakeibc.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value), + }; + }, + }, +}; diff --git a/src/pstake/liquidstakeibc/v1beta1/msgs.ts b/src/pstake/liquidstakeibc/v1beta1/msgs.ts index 2f792ca..19487ad 100644 --- a/src/pstake/liquidstakeibc/v1beta1/msgs.ts +++ b/src/pstake/liquidstakeibc/v1beta1/msgs.ts @@ -2,8 +2,8 @@ import { KVUpdate } from "./liquidstakeibc"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Params } from "./params"; -import { Long, isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "pstake.liquidstakeibc.v1beta1"; export interface MsgRegisterHostChain { /** authority is the address of the governance account */ @@ -17,8 +17,8 @@ export interface MsgRegisterHostChain { portId: string; hostDenom: string; minimumDeposit: string; - unbondingFactor: Long; - autoCompoundFactor: Long; + unbondingFactor: bigint; + autoCompoundFactor: bigint; } export interface MsgRegisterHostChainResponse {} export interface MsgUpdateHostChain { @@ -65,12 +65,12 @@ function createBaseMsgRegisterHostChain(): MsgRegisterHostChain { portId: "", hostDenom: "", minimumDeposit: "", - unbondingFactor: Long.ZERO, - autoCompoundFactor: Long.ZERO, + unbondingFactor: BigInt(0), + autoCompoundFactor: BigInt(0), }; } export const MsgRegisterHostChain = { - encode(message: MsgRegisterHostChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRegisterHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -101,16 +101,16 @@ export const MsgRegisterHostChain = { if (message.minimumDeposit !== "") { writer.uint32(82).string(message.minimumDeposit); } - if (!message.unbondingFactor.isZero()) { + if (message.unbondingFactor !== BigInt(0)) { writer.uint32(88).int64(message.unbondingFactor); } - if (!message.autoCompoundFactor.isZero()) { + if (message.autoCompoundFactor !== BigInt(0)) { writer.uint32(96).int64(message.autoCompoundFactor); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterHostChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterHostChain(); while (reader.pos < end) { @@ -147,10 +147,10 @@ export const MsgRegisterHostChain = { message.minimumDeposit = reader.string(); break; case 11: - message.unbondingFactor = reader.int64() as Long; + message.unbondingFactor = reader.int64(); break; case 12: - message.autoCompoundFactor = reader.int64() as Long; + message.autoCompoundFactor = reader.int64(); break; default: reader.skipType(tag & 7); @@ -171,8 +171,9 @@ export const MsgRegisterHostChain = { if (isSet(object.portId)) obj.portId = String(object.portId); if (isSet(object.hostDenom)) obj.hostDenom = String(object.hostDenom); if (isSet(object.minimumDeposit)) obj.minimumDeposit = String(object.minimumDeposit); - if (isSet(object.unbondingFactor)) obj.unbondingFactor = Long.fromValue(object.unbondingFactor); - if (isSet(object.autoCompoundFactor)) obj.autoCompoundFactor = Long.fromValue(object.autoCompoundFactor); + if (isSet(object.unbondingFactor)) obj.unbondingFactor = BigInt(object.unbondingFactor.toString()); + if (isSet(object.autoCompoundFactor)) + obj.autoCompoundFactor = BigInt(object.autoCompoundFactor.toString()); return obj; }, toJSON(message: MsgRegisterHostChain): unknown { @@ -188,12 +189,12 @@ export const MsgRegisterHostChain = { message.hostDenom !== undefined && (obj.hostDenom = message.hostDenom); message.minimumDeposit !== undefined && (obj.minimumDeposit = message.minimumDeposit); message.unbondingFactor !== undefined && - (obj.unbondingFactor = (message.unbondingFactor || Long.ZERO).toString()); + (obj.unbondingFactor = (message.unbondingFactor || BigInt(0)).toString()); message.autoCompoundFactor !== undefined && - (obj.autoCompoundFactor = (message.autoCompoundFactor || Long.ZERO).toString()); + (obj.autoCompoundFactor = (message.autoCompoundFactor || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): MsgRegisterHostChain { + fromPartial(object: Partial): MsgRegisterHostChain { const message = createBaseMsgRegisterHostChain(); message.authority = object.authority ?? ""; message.connectionId = object.connectionId ?? ""; @@ -206,10 +207,10 @@ export const MsgRegisterHostChain = { message.hostDenom = object.hostDenom ?? ""; message.minimumDeposit = object.minimumDeposit ?? ""; if (object.unbondingFactor !== undefined && object.unbondingFactor !== null) { - message.unbondingFactor = Long.fromValue(object.unbondingFactor); + message.unbondingFactor = BigInt(object.unbondingFactor.toString()); } if (object.autoCompoundFactor !== undefined && object.autoCompoundFactor !== null) { - message.autoCompoundFactor = Long.fromValue(object.autoCompoundFactor); + message.autoCompoundFactor = BigInt(object.autoCompoundFactor.toString()); } return message; }, @@ -218,11 +219,11 @@ function createBaseMsgRegisterHostChainResponse(): MsgRegisterHostChainResponse return {}; } export const MsgRegisterHostChainResponse = { - encode(_: MsgRegisterHostChainResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRegisterHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRegisterHostChainResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRegisterHostChainResponse(); while (reader.pos < end) { @@ -243,9 +244,7 @@ export const MsgRegisterHostChainResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgRegisterHostChainResponse { + fromPartial(_: Partial): MsgRegisterHostChainResponse { const message = createBaseMsgRegisterHostChainResponse(); return message; }, @@ -258,7 +257,7 @@ function createBaseMsgUpdateHostChain(): MsgUpdateHostChain { }; } export const MsgUpdateHostChain = { - encode(message: MsgUpdateHostChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateHostChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -270,8 +269,8 @@ export const MsgUpdateHostChain = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateHostChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateHostChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateHostChain(); while (reader.pos < end) { @@ -311,7 +310,7 @@ export const MsgUpdateHostChain = { } return obj; }, - fromPartial, I>>(object: I): MsgUpdateHostChain { + fromPartial(object: Partial): MsgUpdateHostChain { const message = createBaseMsgUpdateHostChain(); message.authority = object.authority ?? ""; message.chainId = object.chainId ?? ""; @@ -323,11 +322,11 @@ function createBaseMsgUpdateHostChainResponse(): MsgUpdateHostChainResponse { return {}; } export const MsgUpdateHostChainResponse = { - encode(_: MsgUpdateHostChainResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateHostChainResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateHostChainResponse(); while (reader.pos < end) { @@ -348,7 +347,7 @@ export const MsgUpdateHostChainResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateHostChainResponse { + fromPartial(_: Partial): MsgUpdateHostChainResponse { const message = createBaseMsgUpdateHostChainResponse(); return message; }, @@ -360,7 +359,7 @@ function createBaseMsgLiquidStake(): MsgLiquidStake { }; } export const MsgLiquidStake = { - encode(message: MsgLiquidStake, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgLiquidStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -369,8 +368,8 @@ export const MsgLiquidStake = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidStake { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidStake(); while (reader.pos < end) { @@ -401,7 +400,7 @@ export const MsgLiquidStake = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgLiquidStake { + fromPartial(object: Partial): MsgLiquidStake { const message = createBaseMsgLiquidStake(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -414,11 +413,11 @@ function createBaseMsgLiquidStakeResponse(): MsgLiquidStakeResponse { return {}; } export const MsgLiquidStakeResponse = { - encode(_: MsgLiquidStakeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgLiquidStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidStakeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidStakeResponse(); while (reader.pos < end) { @@ -439,7 +438,7 @@ export const MsgLiquidStakeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgLiquidStakeResponse { + fromPartial(_: Partial): MsgLiquidStakeResponse { const message = createBaseMsgLiquidStakeResponse(); return message; }, @@ -451,7 +450,7 @@ function createBaseMsgLiquidStakeLSM(): MsgLiquidStakeLSM { }; } export const MsgLiquidStakeLSM = { - encode(message: MsgLiquidStakeLSM, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgLiquidStakeLSM, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -460,8 +459,8 @@ export const MsgLiquidStakeLSM = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidStakeLSM { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidStakeLSM { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidStakeLSM(); while (reader.pos < end) { @@ -497,7 +496,7 @@ export const MsgLiquidStakeLSM = { } return obj; }, - fromPartial, I>>(object: I): MsgLiquidStakeLSM { + fromPartial(object: Partial): MsgLiquidStakeLSM { const message = createBaseMsgLiquidStakeLSM(); message.delegatorAddress = object.delegatorAddress ?? ""; message.delegations = object.delegations?.map((e) => Coin.fromPartial(e)) || []; @@ -508,11 +507,11 @@ function createBaseMsgLiquidStakeLSMResponse(): MsgLiquidStakeLSMResponse { return {}; } export const MsgLiquidStakeLSMResponse = { - encode(_: MsgLiquidStakeLSMResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgLiquidStakeLSMResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidStakeLSMResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidStakeLSMResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidStakeLSMResponse(); while (reader.pos < end) { @@ -533,7 +532,7 @@ export const MsgLiquidStakeLSMResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgLiquidStakeLSMResponse { + fromPartial(_: Partial): MsgLiquidStakeLSMResponse { const message = createBaseMsgLiquidStakeLSMResponse(); return message; }, @@ -545,7 +544,7 @@ function createBaseMsgLiquidUnstake(): MsgLiquidUnstake { }; } export const MsgLiquidUnstake = { - encode(message: MsgLiquidUnstake, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgLiquidUnstake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -554,8 +553,8 @@ export const MsgLiquidUnstake = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidUnstake { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidUnstake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidUnstake(); while (reader.pos < end) { @@ -586,7 +585,7 @@ export const MsgLiquidUnstake = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgLiquidUnstake { + fromPartial(object: Partial): MsgLiquidUnstake { const message = createBaseMsgLiquidUnstake(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -599,11 +598,11 @@ function createBaseMsgLiquidUnstakeResponse(): MsgLiquidUnstakeResponse { return {}; } export const MsgLiquidUnstakeResponse = { - encode(_: MsgLiquidUnstakeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgLiquidUnstakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidUnstakeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidUnstakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidUnstakeResponse(); while (reader.pos < end) { @@ -624,7 +623,7 @@ export const MsgLiquidUnstakeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgLiquidUnstakeResponse { + fromPartial(_: Partial): MsgLiquidUnstakeResponse { const message = createBaseMsgLiquidUnstakeResponse(); return message; }, @@ -636,7 +635,7 @@ function createBaseMsgRedeem(): MsgRedeem { }; } export const MsgRedeem = { - encode(message: MsgRedeem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRedeem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -645,8 +644,8 @@ export const MsgRedeem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRedeem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRedeem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRedeem(); while (reader.pos < end) { @@ -677,7 +676,7 @@ export const MsgRedeem = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgRedeem { + fromPartial(object: Partial): MsgRedeem { const message = createBaseMsgRedeem(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -690,11 +689,11 @@ function createBaseMsgRedeemResponse(): MsgRedeemResponse { return {}; } export const MsgRedeemResponse = { - encode(_: MsgRedeemResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRedeemResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRedeemResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRedeemResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRedeemResponse(); while (reader.pos < end) { @@ -715,7 +714,7 @@ export const MsgRedeemResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgRedeemResponse { + fromPartial(_: Partial): MsgRedeemResponse { const message = createBaseMsgRedeemResponse(); return message; }, @@ -727,7 +726,7 @@ function createBaseMsgUpdateParams(): MsgUpdateParams { }; } export const MsgUpdateParams = { - encode(message: MsgUpdateParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.authority !== "") { writer.uint32(10).string(message.authority); } @@ -736,8 +735,8 @@ export const MsgUpdateParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParams(); while (reader.pos < end) { @@ -768,7 +767,7 @@ export const MsgUpdateParams = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgUpdateParams { + fromPartial(object: Partial): MsgUpdateParams { const message = createBaseMsgUpdateParams(); message.authority = object.authority ?? ""; if (object.params !== undefined && object.params !== null) { @@ -781,11 +780,11 @@ function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { return {}; } export const MsgUpdateParamsResponse = { - encode(_: MsgUpdateParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgUpdateParamsResponse(); while (reader.pos < end) { @@ -806,7 +805,7 @@ export const MsgUpdateParamsResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgUpdateParamsResponse { + fromPartial(_: Partial): MsgUpdateParamsResponse { const message = createBaseMsgUpdateParamsResponse(); return message; }, @@ -836,36 +835,36 @@ export class MsgClientImpl implements Msg { RegisterHostChain(request: MsgRegisterHostChain): Promise { const data = MsgRegisterHostChain.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "RegisterHostChain", data); - return promise.then((data) => MsgRegisterHostChainResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRegisterHostChainResponse.decode(new BinaryReader(data))); } UpdateHostChain(request: MsgUpdateHostChain): Promise { const data = MsgUpdateHostChain.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "UpdateHostChain", data); - return promise.then((data) => MsgUpdateHostChainResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateHostChainResponse.decode(new BinaryReader(data))); } LiquidStake(request: MsgLiquidStake): Promise { const data = MsgLiquidStake.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "LiquidStake", data); - return promise.then((data) => MsgLiquidStakeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgLiquidStakeResponse.decode(new BinaryReader(data))); } LiquidStakeLSM(request: MsgLiquidStakeLSM): Promise { const data = MsgLiquidStakeLSM.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "LiquidStakeLSM", data); - return promise.then((data) => MsgLiquidStakeLSMResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgLiquidStakeLSMResponse.decode(new BinaryReader(data))); } LiquidUnstake(request: MsgLiquidUnstake): Promise { const data = MsgLiquidUnstake.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "LiquidUnstake", data); - return promise.then((data) => MsgLiquidUnstakeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgLiquidUnstakeResponse.decode(new BinaryReader(data))); } Redeem(request: MsgRedeem): Promise { const data = MsgRedeem.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "Redeem", data); - return promise.then((data) => MsgRedeemResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRedeemResponse.decode(new BinaryReader(data))); } UpdateParams(request: MsgUpdateParams): Promise { const data = MsgUpdateParams.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Msg", "UpdateParams", data); - return promise.then((data) => MsgUpdateParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgUpdateParamsResponse.decode(new BinaryReader(data))); } } diff --git a/src/pstake/liquidstakeibc/v1beta1/params.ts b/src/pstake/liquidstakeibc/v1beta1/params.ts index 9a010f2..1f0ed08 100644 --- a/src/pstake/liquidstakeibc/v1beta1/params.ts +++ b/src/pstake/liquidstakeibc/v1beta1/params.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "pstake.liquidstakeibc.v1beta1"; /** Params defines the parameters for the module. */ export interface Params { @@ -18,7 +18,7 @@ function createBaseParams(): Params { }; } export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.adminAddress !== "") { writer.uint32(10).string(message.adminAddress); } @@ -33,8 +33,8 @@ export const Params = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -75,7 +75,7 @@ export const Params = { message.lowerCValueLimit !== undefined && (obj.lowerCValueLimit = message.lowerCValueLimit); return obj; }, - fromPartial, I>>(object: I): Params { + fromPartial(object: Partial): Params { const message = createBaseParams(); message.adminAddress = object.adminAddress ?? ""; message.feeAddress = object.feeAddress ?? ""; diff --git a/src/pstake/liquidstakeibc/v1beta1/query.ts b/src/pstake/liquidstakeibc/v1beta1/query.ts index 807cc20..8b4aec3 100644 --- a/src/pstake/liquidstakeibc/v1beta1/query.ts +++ b/src/pstake/liquidstakeibc/v1beta1/query.ts @@ -9,8 +9,8 @@ import { ValidatorUnbonding, } from "./liquidstakeibc"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Long, DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "pstake.liquidstakeibc.v1beta1"; export interface QueryParamsRequest {} export interface QueryParamsResponse { @@ -46,7 +46,7 @@ export interface QueryUnbondingsResponse { } export interface QueryUnbondingRequest { chainId: string; - epoch: Long; + epoch: bigint; } export interface QueryUnbondingResponse { unbonding: Unbonding; @@ -79,11 +79,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -104,7 +104,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -115,14 +115,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -148,7 +148,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -162,14 +162,14 @@ function createBaseQueryHostChainRequest(): QueryHostChainRequest { }; } export const QueryHostChainRequest = { - encode(message: QueryHostChainRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryHostChainRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostChainRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostChainRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostChainRequest(); while (reader.pos < end) { @@ -195,7 +195,7 @@ export const QueryHostChainRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>(object: I): QueryHostChainRequest { + fromPartial(object: Partial): QueryHostChainRequest { const message = createBaseQueryHostChainRequest(); message.chainId = object.chainId ?? ""; return message; @@ -207,14 +207,14 @@ function createBaseQueryHostChainResponse(): QueryHostChainResponse { }; } export const QueryHostChainResponse = { - encode(message: QueryHostChainResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryHostChainResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hostChain !== undefined) { HostChain.encode(message.hostChain, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostChainResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostChainResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostChainResponse(); while (reader.pos < end) { @@ -241,7 +241,7 @@ export const QueryHostChainResponse = { (obj.hostChain = message.hostChain ? HostChain.toJSON(message.hostChain) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryHostChainResponse { + fromPartial(object: Partial): QueryHostChainResponse { const message = createBaseQueryHostChainResponse(); if (object.hostChain !== undefined && object.hostChain !== null) { message.hostChain = HostChain.fromPartial(object.hostChain); @@ -253,11 +253,11 @@ function createBaseQueryHostChainsRequest(): QueryHostChainsRequest { return {}; } export const QueryHostChainsRequest = { - encode(_: QueryHostChainsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryHostChainsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostChainsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostChainsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostChainsRequest(); while (reader.pos < end) { @@ -278,7 +278,7 @@ export const QueryHostChainsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryHostChainsRequest { + fromPartial(_: Partial): QueryHostChainsRequest { const message = createBaseQueryHostChainsRequest(); return message; }, @@ -289,14 +289,14 @@ function createBaseQueryHostChainsResponse(): QueryHostChainsResponse { }; } export const QueryHostChainsResponse = { - encode(message: QueryHostChainsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryHostChainsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.hostChains) { HostChain.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostChainsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostChainsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostChainsResponse(); while (reader.pos < end) { @@ -327,7 +327,7 @@ export const QueryHostChainsResponse = { } return obj; }, - fromPartial, I>>(object: I): QueryHostChainsResponse { + fromPartial(object: Partial): QueryHostChainsResponse { const message = createBaseQueryHostChainsResponse(); message.hostChains = object.hostChains?.map((e) => HostChain.fromPartial(e)) || []; return message; @@ -339,14 +339,14 @@ function createBaseQueryDepositsRequest(): QueryDepositsRequest { }; } export const QueryDepositsRequest = { - encode(message: QueryDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsRequest(); while (reader.pos < end) { @@ -372,7 +372,7 @@ export const QueryDepositsRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>(object: I): QueryDepositsRequest { + fromPartial(object: Partial): QueryDepositsRequest { const message = createBaseQueryDepositsRequest(); message.chainId = object.chainId ?? ""; return message; @@ -384,14 +384,14 @@ function createBaseQueryDepositsResponse(): QueryDepositsResponse { }; } export const QueryDepositsResponse = { - encode(message: QueryDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositsResponse(); while (reader.pos < end) { @@ -421,7 +421,7 @@ export const QueryDepositsResponse = { } return obj; }, - fromPartial, I>>(object: I): QueryDepositsResponse { + fromPartial(object: Partial): QueryDepositsResponse { const message = createBaseQueryDepositsResponse(); message.deposits = object.deposits?.map((e) => Deposit.fromPartial(e)) || []; return message; @@ -433,14 +433,14 @@ function createBaseQueryLSMDepositsRequest(): QueryLSMDepositsRequest { }; } export const QueryLSMDepositsRequest = { - encode(message: QueryLSMDepositsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryLSMDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryLSMDepositsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryLSMDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryLSMDepositsRequest(); while (reader.pos < end) { @@ -466,7 +466,7 @@ export const QueryLSMDepositsRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>(object: I): QueryLSMDepositsRequest { + fromPartial(object: Partial): QueryLSMDepositsRequest { const message = createBaseQueryLSMDepositsRequest(); message.chainId = object.chainId ?? ""; return message; @@ -478,14 +478,14 @@ function createBaseQueryLSMDepositsResponse(): QueryLSMDepositsResponse { }; } export const QueryLSMDepositsResponse = { - encode(message: QueryLSMDepositsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryLSMDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.deposits) { LSMDeposit.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryLSMDepositsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryLSMDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryLSMDepositsResponse(); while (reader.pos < end) { @@ -516,9 +516,7 @@ export const QueryLSMDepositsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryLSMDepositsResponse { + fromPartial(object: Partial): QueryLSMDepositsResponse { const message = createBaseQueryLSMDepositsResponse(); message.deposits = object.deposits?.map((e) => LSMDeposit.fromPartial(e)) || []; return message; @@ -530,14 +528,14 @@ function createBaseQueryUnbondingsRequest(): QueryUnbondingsRequest { }; } export const QueryUnbondingsRequest = { - encode(message: QueryUnbondingsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingsRequest(); while (reader.pos < end) { @@ -563,7 +561,7 @@ export const QueryUnbondingsRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>(object: I): QueryUnbondingsRequest { + fromPartial(object: Partial): QueryUnbondingsRequest { const message = createBaseQueryUnbondingsRequest(); message.chainId = object.chainId ?? ""; return message; @@ -575,14 +573,14 @@ function createBaseQueryUnbondingsResponse(): QueryUnbondingsResponse { }; } export const QueryUnbondingsResponse = { - encode(message: QueryUnbondingsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unbondings) { Unbonding.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingsResponse(); while (reader.pos < end) { @@ -613,7 +611,7 @@ export const QueryUnbondingsResponse = { } return obj; }, - fromPartial, I>>(object: I): QueryUnbondingsResponse { + fromPartial(object: Partial): QueryUnbondingsResponse { const message = createBaseQueryUnbondingsResponse(); message.unbondings = object.unbondings?.map((e) => Unbonding.fromPartial(e)) || []; return message; @@ -622,21 +620,21 @@ export const QueryUnbondingsResponse = { function createBaseQueryUnbondingRequest(): QueryUnbondingRequest { return { chainId: "", - epoch: Long.ZERO, + epoch: BigInt(0), }; } export const QueryUnbondingRequest = { - encode(message: QueryUnbondingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnbondingRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } - if (!message.epoch.isZero()) { + if (message.epoch !== BigInt(0)) { writer.uint32(16).int64(message.epoch); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingRequest(); while (reader.pos < end) { @@ -646,7 +644,7 @@ export const QueryUnbondingRequest = { message.chainId = reader.string(); break; case 2: - message.epoch = reader.int64() as Long; + message.epoch = reader.int64(); break; default: reader.skipType(tag & 7); @@ -658,20 +656,20 @@ export const QueryUnbondingRequest = { fromJSON(object: any): QueryUnbondingRequest { const obj = createBaseQueryUnbondingRequest(); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.epoch)) obj.epoch = Long.fromValue(object.epoch); + if (isSet(object.epoch)) obj.epoch = BigInt(object.epoch.toString()); return obj; }, toJSON(message: QueryUnbondingRequest): unknown { const obj: any = {}; message.chainId !== undefined && (obj.chainId = message.chainId); - message.epoch !== undefined && (obj.epoch = (message.epoch || Long.ZERO).toString()); + message.epoch !== undefined && (obj.epoch = (message.epoch || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): QueryUnbondingRequest { + fromPartial(object: Partial): QueryUnbondingRequest { const message = createBaseQueryUnbondingRequest(); message.chainId = object.chainId ?? ""; if (object.epoch !== undefined && object.epoch !== null) { - message.epoch = Long.fromValue(object.epoch); + message.epoch = BigInt(object.epoch.toString()); } return message; }, @@ -682,14 +680,14 @@ function createBaseQueryUnbondingResponse(): QueryUnbondingResponse { }; } export const QueryUnbondingResponse = { - encode(message: QueryUnbondingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnbondingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.unbonding !== undefined) { Unbonding.encode(message.unbonding, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingResponse(); while (reader.pos < end) { @@ -716,7 +714,7 @@ export const QueryUnbondingResponse = { (obj.unbonding = message.unbonding ? Unbonding.toJSON(message.unbonding) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryUnbondingResponse { + fromPartial(object: Partial): QueryUnbondingResponse { const message = createBaseQueryUnbondingResponse(); if (object.unbonding !== undefined && object.unbonding !== null) { message.unbonding = Unbonding.fromPartial(object.unbonding); @@ -730,14 +728,14 @@ function createBaseQueryUserUnbondingsRequest(): QueryUserUnbondingsRequest { }; } export const QueryUserUnbondingsRequest = { - encode(message: QueryUserUnbondingsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUserUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUserUnbondingsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUserUnbondingsRequest(); while (reader.pos < end) { @@ -763,9 +761,7 @@ export const QueryUserUnbondingsRequest = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUserUnbondingsRequest { + fromPartial(object: Partial): QueryUserUnbondingsRequest { const message = createBaseQueryUserUnbondingsRequest(); message.address = object.address ?? ""; return message; @@ -777,14 +773,14 @@ function createBaseQueryUserUnbondingsResponse(): QueryUserUnbondingsResponse { }; } export const QueryUserUnbondingsResponse = { - encode(message: QueryUserUnbondingsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUserUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.userUnbondings) { UserUnbonding.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUserUnbondingsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUserUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUserUnbondingsResponse(); while (reader.pos < end) { @@ -815,9 +811,7 @@ export const QueryUserUnbondingsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryUserUnbondingsResponse { + fromPartial(object: Partial): QueryUserUnbondingsResponse { const message = createBaseQueryUserUnbondingsResponse(); message.userUnbondings = object.userUnbondings?.map((e) => UserUnbonding.fromPartial(e)) || []; return message; @@ -829,14 +823,17 @@ function createBaseQueryValidatorUnbondingRequest(): QueryValidatorUnbondingRequ }; } export const QueryValidatorUnbondingRequest = { - encode(message: QueryValidatorUnbondingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorUnbondingRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorUnbondingRequest(); while (reader.pos < end) { @@ -862,9 +859,7 @@ export const QueryValidatorUnbondingRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorUnbondingRequest { + fromPartial(object: Partial): QueryValidatorUnbondingRequest { const message = createBaseQueryValidatorUnbondingRequest(); message.chainId = object.chainId ?? ""; return message; @@ -876,14 +871,17 @@ function createBaseQueryValidatorUnbondingResponse(): QueryValidatorUnbondingRes }; } export const QueryValidatorUnbondingResponse = { - encode(message: QueryValidatorUnbondingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryValidatorUnbondingResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.validatorUnbondings) { ValidatorUnbonding.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryValidatorUnbondingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorUnbondingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryValidatorUnbondingResponse(); while (reader.pos < end) { @@ -916,9 +914,7 @@ export const QueryValidatorUnbondingResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryValidatorUnbondingResponse { + fromPartial(object: Partial): QueryValidatorUnbondingResponse { const message = createBaseQueryValidatorUnbondingResponse(); message.validatorUnbondings = object.validatorUnbondings?.map((e) => ValidatorUnbonding.fromPartial(e)) || []; @@ -931,14 +927,17 @@ function createBaseQueryDepositAccountBalanceRequest(): QueryDepositAccountBalan }; } export const QueryDepositAccountBalanceRequest = { - encode(message: QueryDepositAccountBalanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositAccountBalanceRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositAccountBalanceRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositAccountBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositAccountBalanceRequest(); while (reader.pos < end) { @@ -964,9 +963,7 @@ export const QueryDepositAccountBalanceRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDepositAccountBalanceRequest { + fromPartial(object: Partial): QueryDepositAccountBalanceRequest { const message = createBaseQueryDepositAccountBalanceRequest(); message.chainId = object.chainId ?? ""; return message; @@ -978,14 +975,17 @@ function createBaseQueryDepositAccountBalanceResponse(): QueryDepositAccountBala }; } export const QueryDepositAccountBalanceResponse = { - encode(message: QueryDepositAccountBalanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositAccountBalanceResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositAccountBalanceResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositAccountBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositAccountBalanceResponse(); while (reader.pos < end) { @@ -1012,9 +1012,7 @@ export const QueryDepositAccountBalanceResponse = { (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDepositAccountBalanceResponse { + fromPartial(object: Partial): QueryDepositAccountBalanceResponse { const message = createBaseQueryDepositAccountBalanceResponse(); if (object.balance !== undefined && object.balance !== null) { message.balance = Coin.fromPartial(object.balance); @@ -1028,14 +1026,14 @@ function createBaseQueryExchangeRateRequest(): QueryExchangeRateRequest { }; } export const QueryExchangeRateRequest = { - encode(message: QueryExchangeRateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryExchangeRateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainId !== "") { writer.uint32(10).string(message.chainId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryExchangeRateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeRateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryExchangeRateRequest(); while (reader.pos < end) { @@ -1061,9 +1059,7 @@ export const QueryExchangeRateRequest = { message.chainId !== undefined && (obj.chainId = message.chainId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryExchangeRateRequest { + fromPartial(object: Partial): QueryExchangeRateRequest { const message = createBaseQueryExchangeRateRequest(); message.chainId = object.chainId ?? ""; return message; @@ -1075,14 +1071,14 @@ function createBaseQueryExchangeRateResponse(): QueryExchangeRateResponse { }; } export const QueryExchangeRateResponse = { - encode(message: QueryExchangeRateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryExchangeRateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rate !== "") { writer.uint32(10).string(message.rate); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryExchangeRateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryExchangeRateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryExchangeRateResponse(); while (reader.pos < end) { @@ -1108,9 +1104,7 @@ export const QueryExchangeRateResponse = { message.rate !== undefined && (obj.rate = message.rate); return obj; }, - fromPartial, I>>( - object: I, - ): QueryExchangeRateResponse { + fromPartial(object: Partial): QueryExchangeRateResponse { const message = createBaseQueryExchangeRateResponse(); message.rate = object.rate ?? ""; return message; @@ -1162,58 +1156,58 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } HostChain(request: QueryHostChainRequest): Promise { const data = QueryHostChainRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "HostChain", data); - return promise.then((data) => QueryHostChainResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryHostChainResponse.decode(new BinaryReader(data))); } HostChains(request: QueryHostChainsRequest = {}): Promise { const data = QueryHostChainsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "HostChains", data); - return promise.then((data) => QueryHostChainsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryHostChainsResponse.decode(new BinaryReader(data))); } Deposits(request: QueryDepositsRequest): Promise { const data = QueryDepositsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Deposits", data); - return promise.then((data) => QueryDepositsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositsResponse.decode(new BinaryReader(data))); } LSMDeposits(request: QueryLSMDepositsRequest): Promise { const data = QueryLSMDepositsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "LSMDeposits", data); - return promise.then((data) => QueryLSMDepositsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryLSMDepositsResponse.decode(new BinaryReader(data))); } Unbondings(request: QueryUnbondingsRequest): Promise { const data = QueryUnbondingsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Unbondings", data); - return promise.then((data) => QueryUnbondingsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnbondingsResponse.decode(new BinaryReader(data))); } Unbonding(request: QueryUnbondingRequest): Promise { const data = QueryUnbondingRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "Unbonding", data); - return promise.then((data) => QueryUnbondingResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnbondingResponse.decode(new BinaryReader(data))); } UserUnbondings(request: QueryUserUnbondingsRequest): Promise { const data = QueryUserUnbondingsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "UserUnbondings", data); - return promise.then((data) => QueryUserUnbondingsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUserUnbondingsResponse.decode(new BinaryReader(data))); } ValidatorUnbondings(request: QueryValidatorUnbondingRequest): Promise { const data = QueryValidatorUnbondingRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "ValidatorUnbondings", data); - return promise.then((data) => QueryValidatorUnbondingResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryValidatorUnbondingResponse.decode(new BinaryReader(data))); } DepositAccountBalance( request: QueryDepositAccountBalanceRequest, ): Promise { const data = QueryDepositAccountBalanceRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "DepositAccountBalance", data); - return promise.then((data) => QueryDepositAccountBalanceResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositAccountBalanceResponse.decode(new BinaryReader(data))); } ExchangeRate(request: QueryExchangeRateRequest): Promise { const data = QueryExchangeRateRequest.encode(request).finish(); const promise = this.rpc.request("pstake.liquidstakeibc.v1beta1.Query", "ExchangeRate", data); - return promise.then((data) => QueryExchangeRateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryExchangeRateResponse.decode(new BinaryReader(data))); } } diff --git a/src/pstake/lscosmos/v1beta1/genesis.ts b/src/pstake/lscosmos/v1beta1/genesis.ts index 4dab9a0..eb98bde 100644 --- a/src/pstake/lscosmos/v1beta1/genesis.ts +++ b/src/pstake/lscosmos/v1beta1/genesis.ts @@ -10,8 +10,8 @@ import { DelegatorUnbondingEpochEntry, HostAccounts, } from "./lscosmos"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "pstake.lscosmos.v1beta1"; /** GenesisState defines the lscosmos module's genesis state. */ export interface GenesisState { @@ -42,7 +42,7 @@ function createBaseGenesisState(): GenesisState { }; } export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } @@ -75,8 +75,8 @@ export const GenesisState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseGenesisState(); while (reader.pos < end) { @@ -186,7 +186,7 @@ export const GenesisState = { (obj.hostAccounts = message.hostAccounts ? HostAccounts.toJSON(message.hostAccounts) : undefined); return obj; }, - fromPartial, I>>(object: I): GenesisState { + fromPartial(object: Partial): GenesisState { const message = createBaseGenesisState(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); diff --git a/src/pstake/lscosmos/v1beta1/governance_proposal.ts b/src/pstake/lscosmos/v1beta1/governance_proposal.ts index 098b771..f974fe1 100644 --- a/src/pstake/lscosmos/v1beta1/governance_proposal.ts +++ b/src/pstake/lscosmos/v1beta1/governance_proposal.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { AllowListedValidators } from "./lscosmos"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; export const protobufPackage = "pstake.lscosmos.v1beta1"; /** @deprecated */ export interface MinDepositAndFeeChangeProposal { @@ -37,7 +37,10 @@ function createBaseMinDepositAndFeeChangeProposal(): MinDepositAndFeeChangePropo }; } export const MinDepositAndFeeChangeProposal = { - encode(message: MinDepositAndFeeChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: MinDepositAndFeeChangeProposal, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -61,8 +64,8 @@ export const MinDepositAndFeeChangeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MinDepositAndFeeChangeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MinDepositAndFeeChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMinDepositAndFeeChangeProposal(); while (reader.pos < end) { @@ -118,9 +121,7 @@ export const MinDepositAndFeeChangeProposal = { message.pstakeRedemptionFee !== undefined && (obj.pstakeRedemptionFee = message.pstakeRedemptionFee); return obj; }, - fromPartial, I>>( - object: I, - ): MinDepositAndFeeChangeProposal { + fromPartial(object: Partial): MinDepositAndFeeChangeProposal { const message = createBaseMinDepositAndFeeChangeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -140,7 +141,10 @@ function createBasePstakeFeeAddressChangeProposal(): PstakeFeeAddressChangePropo }; } export const PstakeFeeAddressChangeProposal = { - encode(message: PstakeFeeAddressChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: PstakeFeeAddressChangeProposal, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -152,8 +156,8 @@ export const PstakeFeeAddressChangeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PstakeFeeAddressChangeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PstakeFeeAddressChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePstakeFeeAddressChangeProposal(); while (reader.pos < end) { @@ -189,9 +193,7 @@ export const PstakeFeeAddressChangeProposal = { message.pstakeFeeAddress !== undefined && (obj.pstakeFeeAddress = message.pstakeFeeAddress); return obj; }, - fromPartial, I>>( - object: I, - ): PstakeFeeAddressChangeProposal { + fromPartial(object: Partial): PstakeFeeAddressChangeProposal { const message = createBasePstakeFeeAddressChangeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; @@ -209,8 +211,8 @@ function createBaseAllowListedValidatorSetChangeProposal(): AllowListedValidator export const AllowListedValidatorSetChangeProposal = { encode( message: AllowListedValidatorSetChangeProposal, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.title !== "") { writer.uint32(10).string(message.title); } @@ -222,8 +224,8 @@ export const AllowListedValidatorSetChangeProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowListedValidatorSetChangeProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowListedValidatorSetChangeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowListedValidatorSetChangeProposal(); while (reader.pos < end) { @@ -263,9 +265,7 @@ export const AllowListedValidatorSetChangeProposal = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): AllowListedValidatorSetChangeProposal { + fromPartial(object: Partial): AllowListedValidatorSetChangeProposal { const message = createBaseAllowListedValidatorSetChangeProposal(); message.title = object.title ?? ""; message.description = object.description ?? ""; diff --git a/src/pstake/lscosmos/v1beta1/lscosmos.ts b/src/pstake/lscosmos/v1beta1/lscosmos.ts index 8650576..958e76a 100644 --- a/src/pstake/lscosmos/v1beta1/lscosmos.ts +++ b/src/pstake/lscosmos/v1beta1/lscosmos.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Long, DeepPartial, Exact, isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; export const protobufPackage = "pstake.lscosmos.v1beta1"; export interface AllowListedValidators { allowListedValidators: AllowListedValidator[]; @@ -57,7 +57,7 @@ export interface HostAccountDelegation { amount: Coin; } export interface HostAccountUndelegation { - epochNumber: Long; + epochNumber: bigint; totalUndelegationAmount: Coin; completionTime: Timestamp; undelegationEntries: UndelegationEntry[]; @@ -77,11 +77,11 @@ export interface IBCAmountTransientStore { undelegatonCompleteIBCTransfer: TransientUndelegationTransfer[]; } export interface TransientUndelegationTransfer { - epochNumber: Long; + epochNumber: bigint; amountUnbonded: Coin; } export interface UnbondingEpochCValue { - epochNumber: Long; + epochNumber: bigint; /** c_value = stk_burn.Amount/amount_unbonded.Amount */ sTKBurn: Coin; amountUnbonded: Coin; @@ -90,7 +90,7 @@ export interface UnbondingEpochCValue { } export interface DelegatorUnbondingEpochEntry { delegatorAddress: string; - epochNumber: Long; + epochNumber: bigint; amount: Coin; } export interface HostAccounts { @@ -103,14 +103,14 @@ function createBaseAllowListedValidators(): AllowListedValidators { }; } export const AllowListedValidators = { - encode(message: AllowListedValidators, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AllowListedValidators, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.allowListedValidators) { AllowListedValidator.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowListedValidators { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowListedValidators { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowListedValidators(); while (reader.pos < end) { @@ -145,7 +145,7 @@ export const AllowListedValidators = { } return obj; }, - fromPartial, I>>(object: I): AllowListedValidators { + fromPartial(object: Partial): AllowListedValidators { const message = createBaseAllowListedValidators(); message.allowListedValidators = object.allowListedValidators?.map((e) => AllowListedValidator.fromPartial(e)) || []; @@ -159,7 +159,7 @@ function createBaseAllowListedValidator(): AllowListedValidator { }; } export const AllowListedValidator = { - encode(message: AllowListedValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: AllowListedValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -168,8 +168,8 @@ export const AllowListedValidator = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): AllowListedValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): AllowListedValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllowListedValidator(); while (reader.pos < end) { @@ -200,7 +200,7 @@ export const AllowListedValidator = { message.targetWeight !== undefined && (obj.targetWeight = message.targetWeight); return obj; }, - fromPartial, I>>(object: I): AllowListedValidator { + fromPartial(object: Partial): AllowListedValidator { const message = createBaseAllowListedValidator(); message.validatorAddress = object.validatorAddress ?? ""; message.targetWeight = object.targetWeight ?? ""; @@ -217,7 +217,7 @@ function createBasePstakeParams(): PstakeParams { }; } export const PstakeParams = { - encode(message: PstakeParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PstakeParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pstakeDepositFee !== "") { writer.uint32(10).string(message.pstakeDepositFee); } @@ -235,8 +235,8 @@ export const PstakeParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PstakeParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PstakeParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePstakeParams(); while (reader.pos < end) { @@ -282,7 +282,7 @@ export const PstakeParams = { message.pstakeFeeAddress !== undefined && (obj.pstakeFeeAddress = message.pstakeFeeAddress); return obj; }, - fromPartial, I>>(object: I): PstakeParams { + fromPartial(object: Partial): PstakeParams { const message = createBasePstakeParams(); message.pstakeDepositFee = object.pstakeDepositFee ?? ""; message.pstakeRestakeFee = object.pstakeRestakeFee ?? ""; @@ -305,7 +305,7 @@ function createBaseHostChainParams(): HostChainParams { }; } export const HostChainParams = { - encode(message: HostChainParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostChainParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chainID !== "") { writer.uint32(10).string(message.chainID); } @@ -332,8 +332,8 @@ export const HostChainParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostChainParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostChainParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostChainParams(); while (reader.pos < end) { @@ -395,7 +395,7 @@ export const HostChainParams = { (obj.pstakeParams = message.pstakeParams ? PstakeParams.toJSON(message.pstakeParams) : undefined); return obj; }, - fromPartial, I>>(object: I): HostChainParams { + fromPartial(object: Partial): HostChainParams { const message = createBaseHostChainParams(); message.chainID = object.chainID ?? ""; message.connectionID = object.connectionID ?? ""; @@ -419,7 +419,7 @@ function createBaseDelegationState(): DelegationState { }; } export const DelegationState = { - encode(message: DelegationState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelegationState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.hostDelegationAccountBalance) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -434,8 +434,8 @@ export const DelegationState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegationState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegationState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegationState(); while (reader.pos < end) { @@ -505,7 +505,7 @@ export const DelegationState = { } return obj; }, - fromPartial, I>>(object: I): DelegationState { + fromPartial(object: Partial): DelegationState { const message = createBaseDelegationState(); message.hostDelegationAccountBalance = object.hostDelegationAccountBalance?.map((e) => Coin.fromPartial(e)) || []; @@ -524,7 +524,7 @@ function createBaseHostAccountDelegation(): HostAccountDelegation { }; } export const HostAccountDelegation = { - encode(message: HostAccountDelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostAccountDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -533,8 +533,8 @@ export const HostAccountDelegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostAccountDelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostAccountDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostAccountDelegation(); while (reader.pos < end) { @@ -565,7 +565,7 @@ export const HostAccountDelegation = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): HostAccountDelegation { + fromPartial(object: Partial): HostAccountDelegation { const message = createBaseHostAccountDelegation(); message.validatorAddress = object.validatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -576,15 +576,15 @@ export const HostAccountDelegation = { }; function createBaseHostAccountUndelegation(): HostAccountUndelegation { return { - epochNumber: Long.ZERO, + epochNumber: BigInt(0), totalUndelegationAmount: Coin.fromPartial({}), completionTime: Timestamp.fromPartial({}), undelegationEntries: [], }; } export const HostAccountUndelegation = { - encode(message: HostAccountUndelegation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.epochNumber.isZero()) { + encode(message: HostAccountUndelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { writer.uint32(8).int64(message.epochNumber); } if (message.totalUndelegationAmount !== undefined) { @@ -598,15 +598,15 @@ export const HostAccountUndelegation = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostAccountUndelegation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostAccountUndelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostAccountUndelegation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 2: message.totalUndelegationAmount = Coin.decode(reader, reader.uint32()); @@ -626,7 +626,7 @@ export const HostAccountUndelegation = { }, fromJSON(object: any): HostAccountUndelegation { const obj = createBaseHostAccountUndelegation(); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.totalUndelegationAmount)) obj.totalUndelegationAmount = Coin.fromJSON(object.totalUndelegationAmount); if (isSet(object.completionTime)) obj.completionTime = fromJsonTimestamp(object.completionTime); @@ -636,7 +636,7 @@ export const HostAccountUndelegation = { }, toJSON(message: HostAccountUndelegation): unknown { const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.totalUndelegationAmount !== undefined && (obj.totalUndelegationAmount = message.totalUndelegationAmount ? Coin.toJSON(message.totalUndelegationAmount) @@ -652,10 +652,10 @@ export const HostAccountUndelegation = { } return obj; }, - fromPartial, I>>(object: I): HostAccountUndelegation { + fromPartial(object: Partial): HostAccountUndelegation { const message = createBaseHostAccountUndelegation(); if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } if (object.totalUndelegationAmount !== undefined && object.totalUndelegationAmount !== null) { message.totalUndelegationAmount = Coin.fromPartial(object.totalUndelegationAmount); @@ -675,7 +675,7 @@ function createBaseUndelegationEntry(): UndelegationEntry { }; } export const UndelegationEntry = { - encode(message: UndelegationEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: UndelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validatorAddress !== "") { writer.uint32(10).string(message.validatorAddress); } @@ -684,8 +684,8 @@ export const UndelegationEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UndelegationEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UndelegationEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUndelegationEntry(); while (reader.pos < end) { @@ -716,7 +716,7 @@ export const UndelegationEntry = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): UndelegationEntry { + fromPartial(object: Partial): UndelegationEntry { const message = createBaseUndelegationEntry(); message.validatorAddress = object.validatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -731,14 +731,14 @@ function createBaseHostChainRewardAddress(): HostChainRewardAddress { }; } export const HostChainRewardAddress = { - encode(message: HostChainRewardAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostChainRewardAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostChainRewardAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostChainRewardAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostChainRewardAddress(); while (reader.pos < end) { @@ -764,7 +764,7 @@ export const HostChainRewardAddress = { message.address !== undefined && (obj.address = message.address); return obj; }, - fromPartial, I>>(object: I): HostChainRewardAddress { + fromPartial(object: Partial): HostChainRewardAddress { const message = createBaseHostChainRewardAddress(); message.address = object.address ?? ""; return message; @@ -778,7 +778,7 @@ function createBaseIBCAmountTransientStore(): IBCAmountTransientStore { }; } export const IBCAmountTransientStore = { - encode(message: IBCAmountTransientStore, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: IBCAmountTransientStore, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.iBCTransfer) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -790,8 +790,8 @@ export const IBCAmountTransientStore = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): IBCAmountTransientStore { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): IBCAmountTransientStore { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIBCAmountTransientStore(); while (reader.pos < end) { @@ -844,7 +844,7 @@ export const IBCAmountTransientStore = { } return obj; }, - fromPartial, I>>(object: I): IBCAmountTransientStore { + fromPartial(object: Partial): IBCAmountTransientStore { const message = createBaseIBCAmountTransientStore(); message.iBCTransfer = object.iBCTransfer?.map((e) => Coin.fromPartial(e)) || []; if (object.iCADelegate !== undefined && object.iCADelegate !== null) { @@ -857,13 +857,13 @@ export const IBCAmountTransientStore = { }; function createBaseTransientUndelegationTransfer(): TransientUndelegationTransfer { return { - epochNumber: Long.ZERO, + epochNumber: BigInt(0), amountUnbonded: Coin.fromPartial({}), }; } export const TransientUndelegationTransfer = { - encode(message: TransientUndelegationTransfer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.epochNumber.isZero()) { + encode(message: TransientUndelegationTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { writer.uint32(8).int64(message.epochNumber); } if (message.amountUnbonded !== undefined) { @@ -871,15 +871,15 @@ export const TransientUndelegationTransfer = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TransientUndelegationTransfer { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TransientUndelegationTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTransientUndelegationTransfer(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 2: message.amountUnbonded = Coin.decode(reader, reader.uint32()); @@ -893,23 +893,21 @@ export const TransientUndelegationTransfer = { }, fromJSON(object: any): TransientUndelegationTransfer { const obj = createBaseTransientUndelegationTransfer(); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.amountUnbonded)) obj.amountUnbonded = Coin.fromJSON(object.amountUnbonded); return obj; }, toJSON(message: TransientUndelegationTransfer): unknown { const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.amountUnbonded !== undefined && (obj.amountUnbonded = message.amountUnbonded ? Coin.toJSON(message.amountUnbonded) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): TransientUndelegationTransfer { + fromPartial(object: Partial): TransientUndelegationTransfer { const message = createBaseTransientUndelegationTransfer(); if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } if (object.amountUnbonded !== undefined && object.amountUnbonded !== null) { message.amountUnbonded = Coin.fromPartial(object.amountUnbonded); @@ -919,7 +917,7 @@ export const TransientUndelegationTransfer = { }; function createBaseUnbondingEpochCValue(): UnbondingEpochCValue { return { - epochNumber: Long.ZERO, + epochNumber: BigInt(0), sTKBurn: Coin.fromPartial({}), amountUnbonded: Coin.fromPartial({}), isMatured: false, @@ -927,8 +925,8 @@ function createBaseUnbondingEpochCValue(): UnbondingEpochCValue { }; } export const UnbondingEpochCValue = { - encode(message: UnbondingEpochCValue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.epochNumber.isZero()) { + encode(message: UnbondingEpochCValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { writer.uint32(8).int64(message.epochNumber); } if (message.sTKBurn !== undefined) { @@ -945,15 +943,15 @@ export const UnbondingEpochCValue = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UnbondingEpochCValue { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): UnbondingEpochCValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseUnbondingEpochCValue(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 2: message.sTKBurn = Coin.decode(reader, reader.uint32()); @@ -976,7 +974,7 @@ export const UnbondingEpochCValue = { }, fromJSON(object: any): UnbondingEpochCValue { const obj = createBaseUnbondingEpochCValue(); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.sTKBurn)) obj.sTKBurn = Coin.fromJSON(object.sTKBurn); if (isSet(object.amountUnbonded)) obj.amountUnbonded = Coin.fromJSON(object.amountUnbonded); if (isSet(object.isMatured)) obj.isMatured = Boolean(object.isMatured); @@ -985,7 +983,7 @@ export const UnbondingEpochCValue = { }, toJSON(message: UnbondingEpochCValue): unknown { const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.sTKBurn !== undefined && (obj.sTKBurn = message.sTKBurn ? Coin.toJSON(message.sTKBurn) : undefined); message.amountUnbonded !== undefined && @@ -994,10 +992,10 @@ export const UnbondingEpochCValue = { message.isFailed !== undefined && (obj.isFailed = message.isFailed); return obj; }, - fromPartial, I>>(object: I): UnbondingEpochCValue { + fromPartial(object: Partial): UnbondingEpochCValue { const message = createBaseUnbondingEpochCValue(); if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } if (object.sTKBurn !== undefined && object.sTKBurn !== null) { message.sTKBurn = Coin.fromPartial(object.sTKBurn); @@ -1013,16 +1011,16 @@ export const UnbondingEpochCValue = { function createBaseDelegatorUnbondingEpochEntry(): DelegatorUnbondingEpochEntry { return { delegatorAddress: "", - epochNumber: Long.ZERO, + epochNumber: BigInt(0), amount: Coin.fromPartial({}), }; } export const DelegatorUnbondingEpochEntry = { - encode(message: DelegatorUnbondingEpochEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DelegatorUnbondingEpochEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } - if (!message.epochNumber.isZero()) { + if (message.epochNumber !== BigInt(0)) { writer.uint32(16).int64(message.epochNumber); } if (message.amount !== undefined) { @@ -1030,8 +1028,8 @@ export const DelegatorUnbondingEpochEntry = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DelegatorUnbondingEpochEntry { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DelegatorUnbondingEpochEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDelegatorUnbondingEpochEntry(); while (reader.pos < end) { @@ -1041,7 +1039,7 @@ export const DelegatorUnbondingEpochEntry = { message.delegatorAddress = reader.string(); break; case 2: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; case 3: message.amount = Coin.decode(reader, reader.uint32()); @@ -1056,24 +1054,22 @@ export const DelegatorUnbondingEpochEntry = { fromJSON(object: any): DelegatorUnbondingEpochEntry { const obj = createBaseDelegatorUnbondingEpochEntry(); if (isSet(object.delegatorAddress)) obj.delegatorAddress = String(object.delegatorAddress); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); if (isSet(object.amount)) obj.amount = Coin.fromJSON(object.amount); return obj; }, toJSON(message: DelegatorUnbondingEpochEntry): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): DelegatorUnbondingEpochEntry { + fromPartial(object: Partial): DelegatorUnbondingEpochEntry { const message = createBaseDelegatorUnbondingEpochEntry(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } if (object.amount !== undefined && object.amount !== null) { message.amount = Coin.fromPartial(object.amount); @@ -1088,7 +1084,7 @@ function createBaseHostAccounts(): HostAccounts { }; } export const HostAccounts = { - encode(message: HostAccounts, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: HostAccounts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAccountOwnerID !== "") { writer.uint32(10).string(message.delegatorAccountOwnerID); } @@ -1097,8 +1093,8 @@ export const HostAccounts = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HostAccounts { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HostAccounts { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHostAccounts(); while (reader.pos < end) { @@ -1132,7 +1128,7 @@ export const HostAccounts = { (obj.rewardsAccountOwnerID = message.rewardsAccountOwnerID); return obj; }, - fromPartial, I>>(object: I): HostAccounts { + fromPartial(object: Partial): HostAccounts { const message = createBaseHostAccounts(); message.delegatorAccountOwnerID = object.delegatorAccountOwnerID ?? ""; message.rewardsAccountOwnerID = object.rewardsAccountOwnerID ?? ""; diff --git a/src/pstake/lscosmos/v1beta1/msgs.amino.ts b/src/pstake/lscosmos/v1beta1/msgs.amino.ts new file mode 100644 index 0000000..dcf04ca --- /dev/null +++ b/src/pstake/lscosmos/v1beta1/msgs.amino.ts @@ -0,0 +1,316 @@ +/* eslint-disable */ +import { AminoMsg } from "@cosmjs/amino"; +import { + MsgLiquidStake, + MsgLiquidUnstake, + MsgRedeem, + MsgClaim, + MsgRecreateICA, + MsgJumpStart, + MsgChangeModuleState, + MsgReportSlashing, +} from "./msgs"; +export interface MsgLiquidStakeAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgLiquidStake"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgLiquidUnstakeAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgRedeemAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgRedeem"; + value: { + delegator_address: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface MsgClaimAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgClaim"; + value: { + delegator_address: string; + }; +} +export interface MsgRecreateICAAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgRecreateICA"; + value: { + from_address: string; + }; +} +export interface MsgJumpStartAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgJumpStart"; + value: { + pstake_address: string; + chain_i_d: string; + connection_i_d: string; + transfer_channel: string; + transfer_port: string; + base_denom: string; + mint_denom: string; + min_deposit: string; + allow_listed_validators: { + allow_listed_validators: { + validator_address: string; + target_weight: string; + }[]; + }; + pstake_params: { + pstake_deposit_fee: string; + pstake_restake_fee: string; + pstake_unstake_fee: string; + pstake_redemption_fee: string; + pstake_fee_address: string; + }; + host_accounts: { + delegator_account_owner_i_d: string; + rewards_account_owner_i_d: string; + }; + }; +} +export interface MsgChangeModuleStateAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgChangeModuleState"; + value: { + pstake_address: string; + module_state: boolean; + }; +} +export interface MsgReportSlashingAminoType extends AminoMsg { + type: "/pstake.lscosmos.v1beta1.MsgReportSlashing"; + value: { + pstake_address: string; + validator_address: string; + }; +} +export const AminoConverter = { + "/pstake.lscosmos.v1beta1.MsgLiquidStake": { + aminoType: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + toAmino: ({ delegatorAddress, amount }: MsgLiquidStake): MsgLiquidStakeAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ delegator_address, amount }: MsgLiquidStakeAminoType["value"]): MsgLiquidStake => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgLiquidUnstake": { + aminoType: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + toAmino: ({ delegatorAddress, amount }: MsgLiquidUnstake): MsgLiquidUnstakeAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ delegator_address, amount }: MsgLiquidUnstakeAminoType["value"]): MsgLiquidUnstake => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgRedeem": { + aminoType: "/pstake.lscosmos.v1beta1.MsgRedeem", + toAmino: ({ delegatorAddress, amount }: MsgRedeem): MsgRedeemAminoType["value"] => { + return { + delegator_address: delegatorAddress, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + fromAmino: ({ delegator_address, amount }: MsgRedeemAminoType["value"]): MsgRedeem => { + return { + delegatorAddress: delegator_address, + amount: { + denom: amount.denom, + amount: amount.amount, + }, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgClaim": { + aminoType: "/pstake.lscosmos.v1beta1.MsgClaim", + toAmino: ({ delegatorAddress }: MsgClaim): MsgClaimAminoType["value"] => { + return { + delegator_address: delegatorAddress, + }; + }, + fromAmino: ({ delegator_address }: MsgClaimAminoType["value"]): MsgClaim => { + return { + delegatorAddress: delegator_address, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgRecreateICA": { + aminoType: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + toAmino: ({ fromAddress }: MsgRecreateICA): MsgRecreateICAAminoType["value"] => { + return { + from_address: fromAddress, + }; + }, + fromAmino: ({ from_address }: MsgRecreateICAAminoType["value"]): MsgRecreateICA => { + return { + fromAddress: from_address, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgJumpStart": { + aminoType: "/pstake.lscosmos.v1beta1.MsgJumpStart", + toAmino: ({ + pstakeAddress, + chainID, + connectionID, + transferChannel, + transferPort, + baseDenom, + mintDenom, + minDeposit, + allowListedValidators, + pstakeParams, + hostAccounts, + }: MsgJumpStart): MsgJumpStartAminoType["value"] => { + return { + pstake_address: pstakeAddress, + chain_i_d: chainID, + connection_i_d: connectionID, + transfer_channel: transferChannel, + transfer_port: transferPort, + base_denom: baseDenom, + mint_denom: mintDenom, + min_deposit: minDeposit, + allow_listed_validators: { + allow_listed_validators: allowListedValidators.allowListedValidators.map((el0) => ({ + validator_address: el0.validatorAddress, + target_weight: el0.targetWeight, + })), + }, + pstake_params: { + pstake_deposit_fee: pstakeParams.pstakeDepositFee, + pstake_restake_fee: pstakeParams.pstakeRestakeFee, + pstake_unstake_fee: pstakeParams.pstakeUnstakeFee, + pstake_redemption_fee: pstakeParams.pstakeRedemptionFee, + pstake_fee_address: pstakeParams.pstakeFeeAddress, + }, + host_accounts: { + delegator_account_owner_i_d: hostAccounts.delegatorAccountOwnerID, + rewards_account_owner_i_d: hostAccounts.rewardsAccountOwnerID, + }, + }; + }, + fromAmino: ({ + pstake_address, + chain_i_d, + connection_i_d, + transfer_channel, + transfer_port, + base_denom, + mint_denom, + min_deposit, + allow_listed_validators, + pstake_params, + host_accounts, + }: MsgJumpStartAminoType["value"]): MsgJumpStart => { + return { + pstakeAddress: pstake_address, + chainID: chain_i_d, + connectionID: connection_i_d, + transferChannel: transfer_channel, + transferPort: transfer_port, + baseDenom: base_denom, + mintDenom: mint_denom, + minDeposit: min_deposit, + allowListedValidators: { + allowListedValidators: allow_listed_validators.allow_listed_validators.map((el1) => ({ + validatorAddress: el1.validator_address, + targetWeight: el1.target_weight, + })), + }, + pstakeParams: { + pstakeDepositFee: pstake_params.pstake_deposit_fee, + pstakeRestakeFee: pstake_params.pstake_restake_fee, + pstakeUnstakeFee: pstake_params.pstake_unstake_fee, + pstakeRedemptionFee: pstake_params.pstake_redemption_fee, + pstakeFeeAddress: pstake_params.pstake_fee_address, + }, + hostAccounts: { + delegatorAccountOwnerID: host_accounts.delegator_account_owner_i_d, + rewardsAccountOwnerID: host_accounts.rewards_account_owner_i_d, + }, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgChangeModuleState": { + aminoType: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + toAmino: ({ + pstakeAddress, + moduleState, + }: MsgChangeModuleState): MsgChangeModuleStateAminoType["value"] => { + return { + pstake_address: pstakeAddress, + module_state: moduleState, + }; + }, + fromAmino: ({ + pstake_address, + module_state, + }: MsgChangeModuleStateAminoType["value"]): MsgChangeModuleState => { + return { + pstakeAddress: pstake_address, + moduleState: module_state, + }; + }, + }, + "/pstake.lscosmos.v1beta1.MsgReportSlashing": { + aminoType: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + toAmino: ({ + pstakeAddress, + validatorAddress, + }: MsgReportSlashing): MsgReportSlashingAminoType["value"] => { + return { + pstake_address: pstakeAddress, + validator_address: validatorAddress, + }; + }, + fromAmino: ({ + pstake_address, + validator_address, + }: MsgReportSlashingAminoType["value"]): MsgReportSlashing => { + return { + pstakeAddress: pstake_address, + validatorAddress: validator_address, + }; + }, + }, +}; diff --git a/src/pstake/lscosmos/v1beta1/msgs.registry.ts b/src/pstake/lscosmos/v1beta1/msgs.registry.ts new file mode 100644 index 0000000..464b261 --- /dev/null +++ b/src/pstake/lscosmos/v1beta1/msgs.registry.ts @@ -0,0 +1,280 @@ +//@ts-nocheck +/* eslint-disable */ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { + MsgLiquidStake, + MsgLiquidUnstake, + MsgRedeem, + MsgClaim, + MsgRecreateICA, + MsgJumpStart, + MsgChangeModuleState, + MsgReportSlashing, +} from "./msgs"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [ + ["/pstake.lscosmos.v1beta1.MsgLiquidStake", MsgLiquidStake], + ["/pstake.lscosmos.v1beta1.MsgLiquidUnstake", MsgLiquidUnstake], + ["/pstake.lscosmos.v1beta1.MsgRedeem", MsgRedeem], + ["/pstake.lscosmos.v1beta1.MsgClaim", MsgClaim], + ["/pstake.lscosmos.v1beta1.MsgRecreateICA", MsgRecreateICA], + ["/pstake.lscosmos.v1beta1.MsgJumpStart", MsgJumpStart], + ["/pstake.lscosmos.v1beta1.MsgChangeModuleState", MsgChangeModuleState], + ["/pstake.lscosmos.v1beta1.MsgReportSlashing", MsgReportSlashing], +]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.encode(value).finish(), + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.encode(value).finish(), + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.encode(value).finish(), + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.encode(value).finish(), + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.encode(value).finish(), + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.encode(value).finish(), + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.encode(value).finish(), + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.encode(value).finish(), + }; + }, + }, + withTypeUrl: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value, + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value, + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value, + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value, + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value, + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value, + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value, + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value, + }; + }, + }, + toJSON: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.toJSON(value), + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.toJSON(value), + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.toJSON(value), + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.toJSON(value), + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.toJSON(value), + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.toJSON(value), + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.toJSON(value), + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.toJSON(value), + }; + }, + }, + fromJSON: { + liquidStake(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromJSON(value), + }; + }, + liquidUnstake(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromJSON(value), + }; + }, + redeem(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.fromJSON(value), + }; + }, + claim(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.fromJSON(value), + }; + }, + recreateICA(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.fromJSON(value), + }; + }, + jumpStart(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.fromJSON(value), + }; + }, + changeModuleState(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.fromJSON(value), + }; + }, + reportSlashing(value: any) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.fromJSON(value), + }; + }, + }, + fromPartial: { + liquidStake(value: MsgLiquidStake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidStake", + value: MsgLiquidStake.fromPartial(value), + }; + }, + liquidUnstake(value: MsgLiquidUnstake) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgLiquidUnstake", + value: MsgLiquidUnstake.fromPartial(value), + }; + }, + redeem(value: MsgRedeem) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRedeem", + value: MsgRedeem.fromPartial(value), + }; + }, + claim(value: MsgClaim) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgClaim", + value: MsgClaim.fromPartial(value), + }; + }, + recreateICA(value: MsgRecreateICA) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgRecreateICA", + value: MsgRecreateICA.fromPartial(value), + }; + }, + jumpStart(value: MsgJumpStart) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgJumpStart", + value: MsgJumpStart.fromPartial(value), + }; + }, + changeModuleState(value: MsgChangeModuleState) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgChangeModuleState", + value: MsgChangeModuleState.fromPartial(value), + }; + }, + reportSlashing(value: MsgReportSlashing) { + return { + typeUrl: "/pstake.lscosmos.v1beta1.MsgReportSlashing", + value: MsgReportSlashing.fromPartial(value), + }; + }, + }, +}; diff --git a/src/pstake/lscosmos/v1beta1/msgs.ts b/src/pstake/lscosmos/v1beta1/msgs.ts index 6effa84..610c516 100644 --- a/src/pstake/lscosmos/v1beta1/msgs.ts +++ b/src/pstake/lscosmos/v1beta1/msgs.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { AllowListedValidators, PstakeParams, HostAccounts } from "./lscosmos"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact, Rpc } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "pstake.lscosmos.v1beta1"; export interface MsgLiquidStake { delegatorAddress: string; @@ -58,7 +58,7 @@ function createBaseMsgLiquidStake(): MsgLiquidStake { }; } export const MsgLiquidStake = { - encode(message: MsgLiquidStake, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgLiquidStake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -67,8 +67,8 @@ export const MsgLiquidStake = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidStake { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidStake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidStake(); while (reader.pos < end) { @@ -99,7 +99,7 @@ export const MsgLiquidStake = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgLiquidStake { + fromPartial(object: Partial): MsgLiquidStake { const message = createBaseMsgLiquidStake(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -112,11 +112,11 @@ function createBaseMsgLiquidStakeResponse(): MsgLiquidStakeResponse { return {}; } export const MsgLiquidStakeResponse = { - encode(_: MsgLiquidStakeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgLiquidStakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidStakeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidStakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidStakeResponse(); while (reader.pos < end) { @@ -137,7 +137,7 @@ export const MsgLiquidStakeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgLiquidStakeResponse { + fromPartial(_: Partial): MsgLiquidStakeResponse { const message = createBaseMsgLiquidStakeResponse(); return message; }, @@ -149,7 +149,7 @@ function createBaseMsgLiquidUnstake(): MsgLiquidUnstake { }; } export const MsgLiquidUnstake = { - encode(message: MsgLiquidUnstake, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgLiquidUnstake, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -158,8 +158,8 @@ export const MsgLiquidUnstake = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidUnstake { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidUnstake { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidUnstake(); while (reader.pos < end) { @@ -190,7 +190,7 @@ export const MsgLiquidUnstake = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgLiquidUnstake { + fromPartial(object: Partial): MsgLiquidUnstake { const message = createBaseMsgLiquidUnstake(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -203,11 +203,11 @@ function createBaseMsgLiquidUnstakeResponse(): MsgLiquidUnstakeResponse { return {}; } export const MsgLiquidUnstakeResponse = { - encode(_: MsgLiquidUnstakeResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgLiquidUnstakeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgLiquidUnstakeResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgLiquidUnstakeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgLiquidUnstakeResponse(); while (reader.pos < end) { @@ -228,7 +228,7 @@ export const MsgLiquidUnstakeResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgLiquidUnstakeResponse { + fromPartial(_: Partial): MsgLiquidUnstakeResponse { const message = createBaseMsgLiquidUnstakeResponse(); return message; }, @@ -240,7 +240,7 @@ function createBaseMsgRedeem(): MsgRedeem { }; } export const MsgRedeem = { - encode(message: MsgRedeem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRedeem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } @@ -249,8 +249,8 @@ export const MsgRedeem = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRedeem { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRedeem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRedeem(); while (reader.pos < end) { @@ -281,7 +281,7 @@ export const MsgRedeem = { message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgRedeem { + fromPartial(object: Partial): MsgRedeem { const message = createBaseMsgRedeem(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.amount !== undefined && object.amount !== null) { @@ -294,11 +294,11 @@ function createBaseMsgRedeemResponse(): MsgRedeemResponse { return {}; } export const MsgRedeemResponse = { - encode(_: MsgRedeemResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRedeemResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRedeemResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRedeemResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRedeemResponse(); while (reader.pos < end) { @@ -319,7 +319,7 @@ export const MsgRedeemResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgRedeemResponse { + fromPartial(_: Partial): MsgRedeemResponse { const message = createBaseMsgRedeemResponse(); return message; }, @@ -330,14 +330,14 @@ function createBaseMsgClaim(): MsgClaim { }; } export const MsgClaim = { - encode(message: MsgClaim, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgClaim, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgClaim { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgClaim { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgClaim(); while (reader.pos < end) { @@ -363,7 +363,7 @@ export const MsgClaim = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>(object: I): MsgClaim { + fromPartial(object: Partial): MsgClaim { const message = createBaseMsgClaim(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -373,11 +373,11 @@ function createBaseMsgClaimResponse(): MsgClaimResponse { return {}; } export const MsgClaimResponse = { - encode(_: MsgClaimResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgClaimResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgClaimResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgClaimResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgClaimResponse(); while (reader.pos < end) { @@ -398,7 +398,7 @@ export const MsgClaimResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgClaimResponse { + fromPartial(_: Partial): MsgClaimResponse { const message = createBaseMsgClaimResponse(); return message; }, @@ -409,14 +409,14 @@ function createBaseMsgRecreateICA(): MsgRecreateICA { }; } export const MsgRecreateICA = { - encode(message: MsgRecreateICA, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgRecreateICA, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.fromAddress !== "") { writer.uint32(10).string(message.fromAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecreateICA { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecreateICA { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRecreateICA(); while (reader.pos < end) { @@ -442,7 +442,7 @@ export const MsgRecreateICA = { message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); return obj; }, - fromPartial, I>>(object: I): MsgRecreateICA { + fromPartial(object: Partial): MsgRecreateICA { const message = createBaseMsgRecreateICA(); message.fromAddress = object.fromAddress ?? ""; return message; @@ -452,11 +452,11 @@ function createBaseMsgRecreateICAResponse(): MsgRecreateICAResponse { return {}; } export const MsgRecreateICAResponse = { - encode(_: MsgRecreateICAResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgRecreateICAResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgRecreateICAResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecreateICAResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgRecreateICAResponse(); while (reader.pos < end) { @@ -477,7 +477,7 @@ export const MsgRecreateICAResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgRecreateICAResponse { + fromPartial(_: Partial): MsgRecreateICAResponse { const message = createBaseMsgRecreateICAResponse(); return message; }, @@ -498,7 +498,7 @@ function createBaseMsgJumpStart(): MsgJumpStart { }; } export const MsgJumpStart = { - encode(message: MsgJumpStart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgJumpStart, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pstakeAddress !== "") { writer.uint32(10).string(message.pstakeAddress); } @@ -534,8 +534,8 @@ export const MsgJumpStart = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgJumpStart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgJumpStart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgJumpStart(); while (reader.pos < end) { @@ -617,7 +617,7 @@ export const MsgJumpStart = { (obj.hostAccounts = message.hostAccounts ? HostAccounts.toJSON(message.hostAccounts) : undefined); return obj; }, - fromPartial, I>>(object: I): MsgJumpStart { + fromPartial(object: Partial): MsgJumpStart { const message = createBaseMsgJumpStart(); message.pstakeAddress = object.pstakeAddress ?? ""; message.chainID = object.chainID ?? ""; @@ -643,11 +643,11 @@ function createBaseMsgJumpStartResponse(): MsgJumpStartResponse { return {}; } export const MsgJumpStartResponse = { - encode(_: MsgJumpStartResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgJumpStartResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgJumpStartResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgJumpStartResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgJumpStartResponse(); while (reader.pos < end) { @@ -668,7 +668,7 @@ export const MsgJumpStartResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgJumpStartResponse { + fromPartial(_: Partial): MsgJumpStartResponse { const message = createBaseMsgJumpStartResponse(); return message; }, @@ -680,7 +680,7 @@ function createBaseMsgChangeModuleState(): MsgChangeModuleState { }; } export const MsgChangeModuleState = { - encode(message: MsgChangeModuleState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgChangeModuleState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pstakeAddress !== "") { writer.uint32(10).string(message.pstakeAddress); } @@ -689,8 +689,8 @@ export const MsgChangeModuleState = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChangeModuleState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChangeModuleState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChangeModuleState(); while (reader.pos < end) { @@ -721,7 +721,7 @@ export const MsgChangeModuleState = { message.moduleState !== undefined && (obj.moduleState = message.moduleState); return obj; }, - fromPartial, I>>(object: I): MsgChangeModuleState { + fromPartial(object: Partial): MsgChangeModuleState { const message = createBaseMsgChangeModuleState(); message.pstakeAddress = object.pstakeAddress ?? ""; message.moduleState = object.moduleState ?? false; @@ -732,11 +732,11 @@ function createBaseMsgChangeModuleStateResponse(): MsgChangeModuleStateResponse return {}; } export const MsgChangeModuleStateResponse = { - encode(_: MsgChangeModuleStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgChangeModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgChangeModuleStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgChangeModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgChangeModuleStateResponse(); while (reader.pos < end) { @@ -757,9 +757,7 @@ export const MsgChangeModuleStateResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): MsgChangeModuleStateResponse { + fromPartial(_: Partial): MsgChangeModuleStateResponse { const message = createBaseMsgChangeModuleStateResponse(); return message; }, @@ -771,7 +769,7 @@ function createBaseMsgReportSlashing(): MsgReportSlashing { }; } export const MsgReportSlashing = { - encode(message: MsgReportSlashing, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: MsgReportSlashing, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pstakeAddress !== "") { writer.uint32(10).string(message.pstakeAddress); } @@ -780,8 +778,8 @@ export const MsgReportSlashing = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgReportSlashing { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgReportSlashing { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgReportSlashing(); while (reader.pos < end) { @@ -812,7 +810,7 @@ export const MsgReportSlashing = { message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); return obj; }, - fromPartial, I>>(object: I): MsgReportSlashing { + fromPartial(object: Partial): MsgReportSlashing { const message = createBaseMsgReportSlashing(); message.pstakeAddress = object.pstakeAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; @@ -823,11 +821,11 @@ function createBaseMsgReportSlashingResponse(): MsgReportSlashingResponse { return {}; } export const MsgReportSlashingResponse = { - encode(_: MsgReportSlashingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: MsgReportSlashingResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): MsgReportSlashingResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): MsgReportSlashingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMsgReportSlashingResponse(); while (reader.pos < end) { @@ -848,7 +846,7 @@ export const MsgReportSlashingResponse = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): MsgReportSlashingResponse { + fromPartial(_: Partial): MsgReportSlashingResponse { const message = createBaseMsgReportSlashingResponse(); return message; }, @@ -880,41 +878,41 @@ export class MsgClientImpl implements Msg { LiquidStake(request: MsgLiquidStake): Promise { const data = MsgLiquidStake.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "LiquidStake", data); - return promise.then((data) => MsgLiquidStakeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgLiquidStakeResponse.decode(new BinaryReader(data))); } LiquidUnstake(request: MsgLiquidUnstake): Promise { const data = MsgLiquidUnstake.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "LiquidUnstake", data); - return promise.then((data) => MsgLiquidUnstakeResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgLiquidUnstakeResponse.decode(new BinaryReader(data))); } Redeem(request: MsgRedeem): Promise { const data = MsgRedeem.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "Redeem", data); - return promise.then((data) => MsgRedeemResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRedeemResponse.decode(new BinaryReader(data))); } Claim(request: MsgClaim): Promise { const data = MsgClaim.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "Claim", data); - return promise.then((data) => MsgClaimResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgClaimResponse.decode(new BinaryReader(data))); } RecreateICA(request: MsgRecreateICA): Promise { const data = MsgRecreateICA.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "RecreateICA", data); - return promise.then((data) => MsgRecreateICAResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgRecreateICAResponse.decode(new BinaryReader(data))); } JumpStart(request: MsgJumpStart): Promise { const data = MsgJumpStart.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "JumpStart", data); - return promise.then((data) => MsgJumpStartResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgJumpStartResponse.decode(new BinaryReader(data))); } ChangeModuleState(request: MsgChangeModuleState): Promise { const data = MsgChangeModuleState.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "ChangeModuleState", data); - return promise.then((data) => MsgChangeModuleStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgChangeModuleStateResponse.decode(new BinaryReader(data))); } ReportSlashing(request: MsgReportSlashing): Promise { const data = MsgReportSlashing.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Msg", "ReportSlashing", data); - return promise.then((data) => MsgReportSlashingResponse.decode(new _m0.Reader(data))); + return promise.then((data) => MsgReportSlashingResponse.decode(new BinaryReader(data))); } } diff --git a/src/pstake/lscosmos/v1beta1/params.ts b/src/pstake/lscosmos/v1beta1/params.ts index a67f6c6..5d8e668 100644 --- a/src/pstake/lscosmos/v1beta1/params.ts +++ b/src/pstake/lscosmos/v1beta1/params.ts @@ -1,6 +1,5 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { DeepPartial, Exact } from "../../../helpers"; +import { BinaryReader, BinaryWriter } from "../../../binary"; export const protobufPackage = "pstake.lscosmos.v1beta1"; /** Params defines the parameters for the module. */ export interface Params {} @@ -8,11 +7,11 @@ function createBaseParams(): Params { return {}; } export const Params = { - encode(_: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParams(); while (reader.pos < end) { @@ -33,7 +32,7 @@ export const Params = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): Params { + fromPartial(_: Partial): Params { const message = createBaseParams(); return message; }, diff --git a/src/pstake/lscosmos/v1beta1/query.ts b/src/pstake/lscosmos/v1beta1/query.ts index 577382e..886bd2b 100644 --- a/src/pstake/lscosmos/v1beta1/query.ts +++ b/src/pstake/lscosmos/v1beta1/query.ts @@ -12,8 +12,8 @@ import { HostAccounts, } from "./lscosmos"; import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Long, DeepPartial, Exact, isSet, Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, Rpc } from "../../../helpers"; export const protobufPackage = "pstake.lscosmos.v1beta1"; /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequest {} @@ -138,7 +138,7 @@ export interface QueryUnbondingEpochCValueRequest { * QueryUnbondingEpochCValueRequest is a request for the * Query/UnbondingEpochCValue methods. */ - epochNumber: Long; + epochNumber: bigint; } /** * QueryUnbondingEpochCValueResponse is a response for the @@ -156,7 +156,7 @@ export interface QueryHostAccountUndelegationRequest { * QueryHostAccountUndelegationRequest is a request for the * Query/HostAccountUndelegation methods. */ - epochNumber: Long; + epochNumber: bigint; } /** * QueryHostAccountUndelegationResponse is a response for the @@ -171,7 +171,7 @@ export interface QueryHostAccountUndelegationResponse { */ export interface QueryDelegatorUnbondingEpochEntryRequest { delegatorAddress: string; - epochNumber: Long; + epochNumber: bigint; } /** * QueryDelegatorUnbondingEpochEntryResponse is a response for the @@ -216,11 +216,11 @@ function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; } export const QueryParamsRequest = { - encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsRequest(); while (reader.pos < end) { @@ -241,7 +241,7 @@ export const QueryParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryParamsRequest { + fromPartial(_: Partial): QueryParamsRequest { const message = createBaseQueryParamsRequest(); return message; }, @@ -252,14 +252,14 @@ function createBaseQueryParamsResponse(): QueryParamsResponse { }; } export const QueryParamsResponse = { - encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryParamsResponse(); while (reader.pos < end) { @@ -285,7 +285,7 @@ export const QueryParamsResponse = { message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryParamsResponse { + fromPartial(object: Partial): QueryParamsResponse { const message = createBaseQueryParamsResponse(); if (object.params !== undefined && object.params !== null) { message.params = Params.fromPartial(object.params); @@ -297,11 +297,11 @@ function createBaseQueryAllStateRequest(): QueryAllStateRequest { return {}; } export const QueryAllStateRequest = { - encode(_: QueryAllStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryAllStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllStateRequest(); while (reader.pos < end) { @@ -322,7 +322,7 @@ export const QueryAllStateRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryAllStateRequest { + fromPartial(_: Partial): QueryAllStateRequest { const message = createBaseQueryAllStateRequest(); return message; }, @@ -333,14 +333,14 @@ function createBaseQueryAllStateResponse(): QueryAllStateResponse { }; } export const QueryAllStateResponse = { - encode(message: QueryAllStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryAllStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.genesis !== undefined) { GenesisState.encode(message.genesis, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllStateResponse(); while (reader.pos < end) { @@ -367,7 +367,7 @@ export const QueryAllStateResponse = { (obj.genesis = message.genesis ? GenesisState.toJSON(message.genesis) : undefined); return obj; }, - fromPartial, I>>(object: I): QueryAllStateResponse { + fromPartial(object: Partial): QueryAllStateResponse { const message = createBaseQueryAllStateResponse(); if (object.genesis !== undefined && object.genesis !== null) { message.genesis = GenesisState.fromPartial(object.genesis); @@ -379,11 +379,11 @@ function createBaseQueryHostChainParamsRequest(): QueryHostChainParamsRequest { return {}; } export const QueryHostChainParamsRequest = { - encode(_: QueryHostChainParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryHostChainParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostChainParamsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostChainParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostChainParamsRequest(); while (reader.pos < end) { @@ -404,9 +404,7 @@ export const QueryHostChainParamsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryHostChainParamsRequest { + fromPartial(_: Partial): QueryHostChainParamsRequest { const message = createBaseQueryHostChainParamsRequest(); return message; }, @@ -417,14 +415,14 @@ function createBaseQueryHostChainParamsResponse(): QueryHostChainParamsResponse }; } export const QueryHostChainParamsResponse = { - encode(message: QueryHostChainParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryHostChainParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hostChainParams !== undefined) { HostChainParams.encode(message.hostChainParams, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostChainParamsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostChainParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostChainParamsResponse(); while (reader.pos < end) { @@ -453,9 +451,7 @@ export const QueryHostChainParamsResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryHostChainParamsResponse { + fromPartial(object: Partial): QueryHostChainParamsResponse { const message = createBaseQueryHostChainParamsResponse(); if (object.hostChainParams !== undefined && object.hostChainParams !== null) { message.hostChainParams = HostChainParams.fromPartial(object.hostChainParams); @@ -467,11 +463,11 @@ function createBaseQueryDelegationStateRequest(): QueryDelegationStateRequest { return {}; } export const QueryDelegationStateRequest = { - encode(_: QueryDelegationStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryDelegationStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationStateRequest(); while (reader.pos < end) { @@ -492,9 +488,7 @@ export const QueryDelegationStateRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryDelegationStateRequest { + fromPartial(_: Partial): QueryDelegationStateRequest { const message = createBaseQueryDelegationStateRequest(); return message; }, @@ -505,14 +499,14 @@ function createBaseQueryDelegationStateResponse(): QueryDelegationStateResponse }; } export const QueryDelegationStateResponse = { - encode(message: QueryDelegationStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryDelegationStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegationState !== undefined) { DelegationState.encode(message.delegationState, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegationStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegationStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegationStateResponse(); while (reader.pos < end) { @@ -541,9 +535,7 @@ export const QueryDelegationStateResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDelegationStateResponse { + fromPartial(object: Partial): QueryDelegationStateResponse { const message = createBaseQueryDelegationStateResponse(); if (object.delegationState !== undefined && object.delegationState !== null) { message.delegationState = DelegationState.fromPartial(object.delegationState); @@ -555,11 +547,11 @@ function createBaseQueryAllowListedValidatorsRequest(): QueryAllowListedValidato return {}; } export const QueryAllowListedValidatorsRequest = { - encode(_: QueryAllowListedValidatorsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryAllowListedValidatorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowListedValidatorsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowListedValidatorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowListedValidatorsRequest(); while (reader.pos < end) { @@ -580,9 +572,7 @@ export const QueryAllowListedValidatorsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryAllowListedValidatorsRequest { + fromPartial(_: Partial): QueryAllowListedValidatorsRequest { const message = createBaseQueryAllowListedValidatorsRequest(); return message; }, @@ -593,14 +583,17 @@ function createBaseQueryAllowListedValidatorsResponse(): QueryAllowListedValidat }; } export const QueryAllowListedValidatorsResponse = { - encode(message: QueryAllowListedValidatorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryAllowListedValidatorsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.allowListedValidators !== undefined) { AllowListedValidators.encode(message.allowListedValidators, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllowListedValidatorsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllowListedValidatorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllowListedValidatorsResponse(); while (reader.pos < end) { @@ -630,9 +623,7 @@ export const QueryAllowListedValidatorsResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllowListedValidatorsResponse { + fromPartial(object: Partial): QueryAllowListedValidatorsResponse { const message = createBaseQueryAllowListedValidatorsResponse(); if (object.allowListedValidators !== undefined && object.allowListedValidators !== null) { message.allowListedValidators = AllowListedValidators.fromPartial(object.allowListedValidators); @@ -644,11 +635,11 @@ function createBaseQueryCValueRequest(): QueryCValueRequest { return {}; } export const QueryCValueRequest = { - encode(_: QueryCValueRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryCValueRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCValueRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCValueRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCValueRequest(); while (reader.pos < end) { @@ -669,7 +660,7 @@ export const QueryCValueRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryCValueRequest { + fromPartial(_: Partial): QueryCValueRequest { const message = createBaseQueryCValueRequest(); return message; }, @@ -680,14 +671,14 @@ function createBaseQueryCValueResponse(): QueryCValueResponse { }; } export const QueryCValueResponse = { - encode(message: QueryCValueResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryCValueResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.cValue !== "") { writer.uint32(10).string(message.cValue); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryCValueResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryCValueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCValueResponse(); while (reader.pos < end) { @@ -713,7 +704,7 @@ export const QueryCValueResponse = { message.cValue !== undefined && (obj.cValue = message.cValue); return obj; }, - fromPartial, I>>(object: I): QueryCValueResponse { + fromPartial(object: Partial): QueryCValueResponse { const message = createBaseQueryCValueResponse(); message.cValue = object.cValue ?? ""; return message; @@ -723,11 +714,11 @@ function createBaseQueryModuleStateRequest(): QueryModuleStateRequest { return {}; } export const QueryModuleStateRequest = { - encode(_: QueryModuleStateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryModuleStateRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleStateRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleStateRequest(); while (reader.pos < end) { @@ -748,7 +739,7 @@ export const QueryModuleStateRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryModuleStateRequest { + fromPartial(_: Partial): QueryModuleStateRequest { const message = createBaseQueryModuleStateRequest(); return message; }, @@ -759,14 +750,14 @@ function createBaseQueryModuleStateResponse(): QueryModuleStateResponse { }; } export const QueryModuleStateResponse = { - encode(message: QueryModuleStateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryModuleStateResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.moduleState === true) { writer.uint32(8).bool(message.moduleState); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryModuleStateResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleStateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryModuleStateResponse(); while (reader.pos < end) { @@ -792,9 +783,7 @@ export const QueryModuleStateResponse = { message.moduleState !== undefined && (obj.moduleState = message.moduleState); return obj; }, - fromPartial, I>>( - object: I, - ): QueryModuleStateResponse { + fromPartial(object: Partial): QueryModuleStateResponse { const message = createBaseQueryModuleStateResponse(); message.moduleState = object.moduleState ?? false; return message; @@ -804,11 +793,11 @@ function createBaseQueryIBCTransientStoreRequest(): QueryIBCTransientStoreReques return {}; } export const QueryIBCTransientStoreRequest = { - encode(_: QueryIBCTransientStoreRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryIBCTransientStoreRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIBCTransientStoreRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIBCTransientStoreRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIBCTransientStoreRequest(); while (reader.pos < end) { @@ -829,9 +818,7 @@ export const QueryIBCTransientStoreRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryIBCTransientStoreRequest { + fromPartial(_: Partial): QueryIBCTransientStoreRequest { const message = createBaseQueryIBCTransientStoreRequest(); return message; }, @@ -842,14 +829,17 @@ function createBaseQueryIBCTransientStoreResponse(): QueryIBCTransientStoreRespo }; } export const QueryIBCTransientStoreResponse = { - encode(message: QueryIBCTransientStoreResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryIBCTransientStoreResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.iBCTransientStore !== undefined) { IBCAmountTransientStore.encode(message.iBCTransientStore, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryIBCTransientStoreResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryIBCTransientStoreResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryIBCTransientStoreResponse(); while (reader.pos < end) { @@ -879,9 +869,7 @@ export const QueryIBCTransientStoreResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryIBCTransientStoreResponse { + fromPartial(object: Partial): QueryIBCTransientStoreResponse { const message = createBaseQueryIBCTransientStoreResponse(); if (object.iBCTransientStore !== undefined && object.iBCTransientStore !== null) { message.iBCTransientStore = IBCAmountTransientStore.fromPartial(object.iBCTransientStore); @@ -895,14 +883,14 @@ function createBaseQueryUnclaimedRequest(): QueryUnclaimedRequest { }; } export const QueryUnclaimedRequest = { - encode(message: QueryUnclaimedRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnclaimedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnclaimedRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnclaimedRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnclaimedRequest(); while (reader.pos < end) { @@ -928,7 +916,7 @@ export const QueryUnclaimedRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>(object: I): QueryUnclaimedRequest { + fromPartial(object: Partial): QueryUnclaimedRequest { const message = createBaseQueryUnclaimedRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -940,14 +928,14 @@ function createBaseQueryUnclaimedResponse(): QueryUnclaimedResponse { }; } export const QueryUnclaimedResponse = { - encode(message: QueryUnclaimedResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryUnclaimedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.unclaimed) { UnbondingEpochCValue.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnclaimedResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnclaimedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnclaimedResponse(); while (reader.pos < end) { @@ -978,7 +966,7 @@ export const QueryUnclaimedResponse = { } return obj; }, - fromPartial, I>>(object: I): QueryUnclaimedResponse { + fromPartial(object: Partial): QueryUnclaimedResponse { const message = createBaseQueryUnclaimedResponse(); message.unclaimed = object.unclaimed?.map((e) => UnbondingEpochCValue.fromPartial(e)) || []; return message; @@ -990,14 +978,14 @@ function createBaseQueryFailedUnbondingsRequest(): QueryFailedUnbondingsRequest }; } export const QueryFailedUnbondingsRequest = { - encode(message: QueryFailedUnbondingsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryFailedUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFailedUnbondingsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryFailedUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryFailedUnbondingsRequest(); while (reader.pos < end) { @@ -1023,9 +1011,7 @@ export const QueryFailedUnbondingsRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryFailedUnbondingsRequest { + fromPartial(object: Partial): QueryFailedUnbondingsRequest { const message = createBaseQueryFailedUnbondingsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -1037,14 +1023,14 @@ function createBaseQueryFailedUnbondingsResponse(): QueryFailedUnbondingsRespons }; } export const QueryFailedUnbondingsResponse = { - encode(message: QueryFailedUnbondingsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryFailedUnbondingsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.failedUnbondings) { UnbondingEpochCValue.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryFailedUnbondingsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryFailedUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryFailedUnbondingsResponse(); while (reader.pos < end) { @@ -1077,9 +1063,7 @@ export const QueryFailedUnbondingsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryFailedUnbondingsResponse { + fromPartial(object: Partial): QueryFailedUnbondingsResponse { const message = createBaseQueryFailedUnbondingsResponse(); message.failedUnbondings = object.failedUnbondings?.map((e) => UnbondingEpochCValue.fromPartial(e)) || []; return message; @@ -1091,14 +1075,14 @@ function createBaseQueryPendingUnbondingsRequest(): QueryPendingUnbondingsReques }; } export const QueryPendingUnbondingsRequest = { - encode(message: QueryPendingUnbondingsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryPendingUnbondingsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPendingUnbondingsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingUnbondingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPendingUnbondingsRequest(); while (reader.pos < end) { @@ -1124,9 +1108,7 @@ export const QueryPendingUnbondingsRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, - ): QueryPendingUnbondingsRequest { + fromPartial(object: Partial): QueryPendingUnbondingsRequest { const message = createBaseQueryPendingUnbondingsRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; return message; @@ -1138,14 +1120,17 @@ function createBaseQueryPendingUnbondingsResponse(): QueryPendingUnbondingsRespo }; } export const QueryPendingUnbondingsResponse = { - encode(message: QueryPendingUnbondingsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryPendingUnbondingsResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.pendingUnbondings) { UnbondingEpochCValue.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPendingUnbondingsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryPendingUnbondingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryPendingUnbondingsResponse(); while (reader.pos < end) { @@ -1178,9 +1163,7 @@ export const QueryPendingUnbondingsResponse = { } return obj; }, - fromPartial, I>>( - object: I, - ): QueryPendingUnbondingsResponse { + fromPartial(object: Partial): QueryPendingUnbondingsResponse { const message = createBaseQueryPendingUnbondingsResponse(); message.pendingUnbondings = object.pendingUnbondings?.map((e) => UnbondingEpochCValue.fromPartial(e)) || []; @@ -1189,25 +1172,28 @@ export const QueryPendingUnbondingsResponse = { }; function createBaseQueryUnbondingEpochCValueRequest(): QueryUnbondingEpochCValueRequest { return { - epochNumber: Long.ZERO, + epochNumber: BigInt(0), }; } export const QueryUnbondingEpochCValueRequest = { - encode(message: QueryUnbondingEpochCValueRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.epochNumber.isZero()) { + encode( + message: QueryUnbondingEpochCValueRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { writer.uint32(8).int64(message.epochNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingEpochCValueRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingEpochCValueRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingEpochCValueRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1218,20 +1204,18 @@ export const QueryUnbondingEpochCValueRequest = { }, fromJSON(object: any): QueryUnbondingEpochCValueRequest { const obj = createBaseQueryUnbondingEpochCValueRequest(); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); return obj; }, toJSON(message: QueryUnbondingEpochCValueRequest): unknown { const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnbondingEpochCValueRequest { + fromPartial(object: Partial): QueryUnbondingEpochCValueRequest { const message = createBaseQueryUnbondingEpochCValueRequest(); if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } return message; }, @@ -1242,14 +1226,17 @@ function createBaseQueryUnbondingEpochCValueResponse(): QueryUnbondingEpochCValu }; } export const QueryUnbondingEpochCValueResponse = { - encode(message: QueryUnbondingEpochCValueResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryUnbondingEpochCValueResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.unbondingEpochCValue !== undefined) { UnbondingEpochCValue.encode(message.unbondingEpochCValue, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnbondingEpochCValueResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryUnbondingEpochCValueResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryUnbondingEpochCValueResponse(); while (reader.pos < end) { @@ -1279,9 +1266,7 @@ export const QueryUnbondingEpochCValueResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryUnbondingEpochCValueResponse { + fromPartial(object: Partial): QueryUnbondingEpochCValueResponse { const message = createBaseQueryUnbondingEpochCValueResponse(); if (object.unbondingEpochCValue !== undefined && object.unbondingEpochCValue !== null) { message.unbondingEpochCValue = UnbondingEpochCValue.fromPartial(object.unbondingEpochCValue); @@ -1291,25 +1276,28 @@ export const QueryUnbondingEpochCValueResponse = { }; function createBaseQueryHostAccountUndelegationRequest(): QueryHostAccountUndelegationRequest { return { - epochNumber: Long.ZERO, + epochNumber: BigInt(0), }; } export const QueryHostAccountUndelegationRequest = { - encode(message: QueryHostAccountUndelegationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.epochNumber.isZero()) { + encode( + message: QueryHostAccountUndelegationRequest, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { + if (message.epochNumber !== BigInt(0)) { writer.uint32(8).int64(message.epochNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostAccountUndelegationRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostAccountUndelegationRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostAccountUndelegationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1320,20 +1308,18 @@ export const QueryHostAccountUndelegationRequest = { }, fromJSON(object: any): QueryHostAccountUndelegationRequest { const obj = createBaseQueryHostAccountUndelegationRequest(); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); return obj; }, toJSON(message: QueryHostAccountUndelegationRequest): unknown { const obj: any = {}; - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, - ): QueryHostAccountUndelegationRequest { + fromPartial(object: Partial): QueryHostAccountUndelegationRequest { const message = createBaseQueryHostAccountUndelegationRequest(); if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } return message; }, @@ -1346,15 +1332,15 @@ function createBaseQueryHostAccountUndelegationResponse(): QueryHostAccountUndel export const QueryHostAccountUndelegationResponse = { encode( message: QueryHostAccountUndelegationResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.hostAccountUndelegation !== undefined) { HostAccountUndelegation.encode(message.hostAccountUndelegation, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostAccountUndelegationResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostAccountUndelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostAccountUndelegationResponse(); while (reader.pos < end) { @@ -1384,9 +1370,7 @@ export const QueryHostAccountUndelegationResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryHostAccountUndelegationResponse { + fromPartial(object: Partial): QueryHostAccountUndelegationResponse { const message = createBaseQueryHostAccountUndelegationResponse(); if (object.hostAccountUndelegation !== undefined && object.hostAccountUndelegation !== null) { message.hostAccountUndelegation = HostAccountUndelegation.fromPartial(object.hostAccountUndelegation); @@ -1397,24 +1381,24 @@ export const QueryHostAccountUndelegationResponse = { function createBaseQueryDelegatorUnbondingEpochEntryRequest(): QueryDelegatorUnbondingEpochEntryRequest { return { delegatorAddress: "", - epochNumber: Long.ZERO, + epochNumber: BigInt(0), }; } export const QueryDelegatorUnbondingEpochEntryRequest = { encode( message: QueryDelegatorUnbondingEpochEntryRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } - if (!message.epochNumber.isZero()) { + if (message.epochNumber !== BigInt(0)) { writer.uint32(16).int64(message.epochNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingEpochEntryRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingEpochEntryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorUnbondingEpochEntryRequest(); while (reader.pos < end) { @@ -1424,7 +1408,7 @@ export const QueryDelegatorUnbondingEpochEntryRequest = { message.delegatorAddress = reader.string(); break; case 2: - message.epochNumber = reader.int64() as Long; + message.epochNumber = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1436,22 +1420,22 @@ export const QueryDelegatorUnbondingEpochEntryRequest = { fromJSON(object: any): QueryDelegatorUnbondingEpochEntryRequest { const obj = createBaseQueryDelegatorUnbondingEpochEntryRequest(); if (isSet(object.delegatorAddress)) obj.delegatorAddress = String(object.delegatorAddress); - if (isSet(object.epochNumber)) obj.epochNumber = Long.fromValue(object.epochNumber); + if (isSet(object.epochNumber)) obj.epochNumber = BigInt(object.epochNumber.toString()); return obj; }, toJSON(message: QueryDelegatorUnbondingEpochEntryRequest): unknown { const obj: any = {}; message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); - message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || Long.ZERO).toString()); + message.epochNumber !== undefined && (obj.epochNumber = (message.epochNumber || BigInt(0)).toString()); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryDelegatorUnbondingEpochEntryRequest { const message = createBaseQueryDelegatorUnbondingEpochEntryRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; if (object.epochNumber !== undefined && object.epochNumber !== null) { - message.epochNumber = Long.fromValue(object.epochNumber); + message.epochNumber = BigInt(object.epochNumber.toString()); } return message; }, @@ -1464,8 +1448,8 @@ function createBaseQueryDelegatorUnbondingEpochEntryResponse(): QueryDelegatorUn export const QueryDelegatorUnbondingEpochEntryResponse = { encode( message: QueryDelegatorUnbondingEpochEntryResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorUnbodingEpochEntry !== undefined) { DelegatorUnbondingEpochEntry.encode( message.delegatorUnbodingEpochEntry, @@ -1474,8 +1458,8 @@ export const QueryDelegatorUnbondingEpochEntryResponse = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDelegatorUnbondingEpochEntryResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDelegatorUnbondingEpochEntryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDelegatorUnbondingEpochEntryResponse(); while (reader.pos < end) { @@ -1507,8 +1491,8 @@ export const QueryDelegatorUnbondingEpochEntryResponse = { : undefined); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryDelegatorUnbondingEpochEntryResponse { const message = createBaseQueryDelegatorUnbondingEpochEntryResponse(); if (object.delegatorUnbodingEpochEntry !== undefined && object.delegatorUnbodingEpochEntry !== null) { @@ -1523,11 +1507,11 @@ function createBaseQueryHostAccountsRequest(): QueryHostAccountsRequest { return {}; } export const QueryHostAccountsRequest = { - encode(_: QueryHostAccountsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryHostAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostAccountsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostAccountsRequest(); while (reader.pos < end) { @@ -1548,7 +1532,7 @@ export const QueryHostAccountsRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): QueryHostAccountsRequest { + fromPartial(_: Partial): QueryHostAccountsRequest { const message = createBaseQueryHostAccountsRequest(); return message; }, @@ -1559,14 +1543,14 @@ function createBaseQueryHostAccountsResponse(): QueryHostAccountsResponse { }; } export const QueryHostAccountsResponse = { - encode(message: QueryHostAccountsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: QueryHostAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hostAccounts !== undefined) { HostAccounts.encode(message.hostAccounts, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryHostAccountsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryHostAccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryHostAccountsResponse(); while (reader.pos < end) { @@ -1593,9 +1577,7 @@ export const QueryHostAccountsResponse = { (obj.hostAccounts = message.hostAccounts ? HostAccounts.toJSON(message.hostAccounts) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryHostAccountsResponse { + fromPartial(object: Partial): QueryHostAccountsResponse { const message = createBaseQueryHostAccountsResponse(); if (object.hostAccounts !== undefined && object.hostAccounts !== null) { message.hostAccounts = HostAccounts.fromPartial(object.hostAccounts); @@ -1607,11 +1589,11 @@ function createBaseQueryDepositModuleAccountRequest(): QueryDepositModuleAccount return {}; } export const QueryDepositModuleAccountRequest = { - encode(_: QueryDepositModuleAccountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: QueryDepositModuleAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositModuleAccountRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositModuleAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositModuleAccountRequest(); while (reader.pos < end) { @@ -1632,9 +1614,7 @@ export const QueryDepositModuleAccountRequest = { const obj: any = {}; return obj; }, - fromPartial, I>>( - _: I, - ): QueryDepositModuleAccountRequest { + fromPartial(_: Partial): QueryDepositModuleAccountRequest { const message = createBaseQueryDepositModuleAccountRequest(); return message; }, @@ -1645,14 +1625,17 @@ function createBaseQueryDepositModuleAccountResponse(): QueryDepositModuleAccoun }; } export const QueryDepositModuleAccountResponse = { - encode(message: QueryDepositModuleAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode( + message: QueryDepositModuleAccountResponse, + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.balance !== undefined) { Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryDepositModuleAccountResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositModuleAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryDepositModuleAccountResponse(); while (reader.pos < end) { @@ -1679,9 +1662,7 @@ export const QueryDepositModuleAccountResponse = { (obj.balance = message.balance ? Coin.toJSON(message.balance) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryDepositModuleAccountResponse { + fromPartial(object: Partial): QueryDepositModuleAccountResponse { const message = createBaseQueryDepositModuleAccountResponse(); if (object.balance !== undefined && object.balance !== null) { message.balance = Coin.fromPartial(object.balance); @@ -1697,15 +1678,15 @@ function createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(): QueryAllDele export const QueryAllDelegatorUnbondingEpochEntriesRequest = { encode( message: QueryAllDelegatorUnbondingEpochEntriesRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { if (message.delegatorAddress !== "") { writer.uint32(10).string(message.delegatorAddress); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllDelegatorUnbondingEpochEntriesRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllDelegatorUnbondingEpochEntriesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(); while (reader.pos < end) { @@ -1731,8 +1712,8 @@ export const QueryAllDelegatorUnbondingEpochEntriesRequest = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryAllDelegatorUnbondingEpochEntriesRequest { const message = createBaseQueryAllDelegatorUnbondingEpochEntriesRequest(); message.delegatorAddress = object.delegatorAddress ?? ""; @@ -1747,15 +1728,15 @@ function createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(): QueryAllDel export const QueryAllDelegatorUnbondingEpochEntriesResponse = { encode( message: QueryAllDelegatorUnbondingEpochEntriesResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { + writer: BinaryWriter = BinaryWriter.create(), + ): BinaryWriter { for (const v of message.delegatorUnbondingEpochEntries) { DelegatorUnbondingEpochEntry.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllDelegatorUnbondingEpochEntriesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): QueryAllDelegatorUnbondingEpochEntriesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(); while (reader.pos < end) { @@ -1792,8 +1773,8 @@ export const QueryAllDelegatorUnbondingEpochEntriesResponse = { } return obj; }, - fromPartial, I>>( - object: I, + fromPartial( + object: Partial, ): QueryAllDelegatorUnbondingEpochEntriesResponse { const message = createBaseQueryAllDelegatorUnbondingEpochEntriesResponse(); message.delegatorUnbondingEpochEntries = @@ -1858,92 +1839,92 @@ export class QueryClientImpl implements Query { Params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "Params", data); - return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryParamsResponse.decode(new BinaryReader(data))); } AllState(request: QueryAllStateRequest = {}): Promise { const data = QueryAllStateRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "AllState", data); - return promise.then((data) => QueryAllStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllStateResponse.decode(new BinaryReader(data))); } HostChainParams(request: QueryHostChainParamsRequest = {}): Promise { const data = QueryHostChainParamsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "HostChainParams", data); - return promise.then((data) => QueryHostChainParamsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryHostChainParamsResponse.decode(new BinaryReader(data))); } DelegationState(request: QueryDelegationStateRequest = {}): Promise { const data = QueryDelegationStateRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DelegationState", data); - return promise.then((data) => QueryDelegationStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegationStateResponse.decode(new BinaryReader(data))); } AllowListedValidators( request: QueryAllowListedValidatorsRequest = {}, ): Promise { const data = QueryAllowListedValidatorsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "AllowListedValidators", data); - return promise.then((data) => QueryAllowListedValidatorsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryAllowListedValidatorsResponse.decode(new BinaryReader(data))); } CValue(request: QueryCValueRequest = {}): Promise { const data = QueryCValueRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "CValue", data); - return promise.then((data) => QueryCValueResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryCValueResponse.decode(new BinaryReader(data))); } ModuleState(request: QueryModuleStateRequest = {}): Promise { const data = QueryModuleStateRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "ModuleState", data); - return promise.then((data) => QueryModuleStateResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryModuleStateResponse.decode(new BinaryReader(data))); } IBCTransientStore(request: QueryIBCTransientStoreRequest = {}): Promise { const data = QueryIBCTransientStoreRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "IBCTransientStore", data); - return promise.then((data) => QueryIBCTransientStoreResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryIBCTransientStoreResponse.decode(new BinaryReader(data))); } Unclaimed(request: QueryUnclaimedRequest): Promise { const data = QueryUnclaimedRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "Unclaimed", data); - return promise.then((data) => QueryUnclaimedResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnclaimedResponse.decode(new BinaryReader(data))); } FailedUnbondings(request: QueryFailedUnbondingsRequest): Promise { const data = QueryFailedUnbondingsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "FailedUnbondings", data); - return promise.then((data) => QueryFailedUnbondingsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryFailedUnbondingsResponse.decode(new BinaryReader(data))); } PendingUnbondings(request: QueryPendingUnbondingsRequest): Promise { const data = QueryPendingUnbondingsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "PendingUnbondings", data); - return promise.then((data) => QueryPendingUnbondingsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryPendingUnbondingsResponse.decode(new BinaryReader(data))); } UnbondingEpochCValue( request: QueryUnbondingEpochCValueRequest, ): Promise { const data = QueryUnbondingEpochCValueRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "UnbondingEpochCValue", data); - return promise.then((data) => QueryUnbondingEpochCValueResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryUnbondingEpochCValueResponse.decode(new BinaryReader(data))); } HostAccountUndelegation( request: QueryHostAccountUndelegationRequest, ): Promise { const data = QueryHostAccountUndelegationRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "HostAccountUndelegation", data); - return promise.then((data) => QueryHostAccountUndelegationResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryHostAccountUndelegationResponse.decode(new BinaryReader(data))); } DelegatorUnbondingEpochEntry( request: QueryDelegatorUnbondingEpochEntryRequest, ): Promise { const data = QueryDelegatorUnbondingEpochEntryRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DelegatorUnbondingEpochEntry", data); - return promise.then((data) => QueryDelegatorUnbondingEpochEntryResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDelegatorUnbondingEpochEntryResponse.decode(new BinaryReader(data))); } HostAccounts(request: QueryHostAccountsRequest = {}): Promise { const data = QueryHostAccountsRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "HostAccounts", data); - return promise.then((data) => QueryHostAccountsResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryHostAccountsResponse.decode(new BinaryReader(data))); } DepositModuleAccount( request: QueryDepositModuleAccountRequest = {}, ): Promise { const data = QueryDepositModuleAccountRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DepositModuleAccount", data); - return promise.then((data) => QueryDepositModuleAccountResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryDepositModuleAccountResponse.decode(new BinaryReader(data))); } DelegatorUnbondingEpochEntries( request: QueryAllDelegatorUnbondingEpochEntriesRequest, @@ -1951,7 +1932,7 @@ export class QueryClientImpl implements Query { const data = QueryAllDelegatorUnbondingEpochEntriesRequest.encode(request).finish(); const promise = this.rpc.request("pstake.lscosmos.v1beta1.Query", "DelegatorUnbondingEpochEntries", data); return promise.then((data) => - QueryAllDelegatorUnbondingEpochEntriesResponse.decode(new _m0.Reader(data)), + QueryAllDelegatorUnbondingEpochEntriesResponse.decode(new BinaryReader(data)), ); } } diff --git a/src/tendermint/abci/types.ts b/src/tendermint/abci/types.ts index 7dc5071..9ab0ad1 100644 --- a/src/tendermint/abci/types.ts +++ b/src/tendermint/abci/types.ts @@ -4,18 +4,15 @@ import { ConsensusParams } from "../types/params"; import { Header } from "../types/types"; import { ProofOps } from "../crypto/proof"; import { PublicKey } from "../crypto/keys"; +import { BinaryReader, BinaryWriter } from "../../binary"; import { - Long, isSet, - DeepPartial, - Exact, fromJsonTimestamp, bytesFromBase64, fromTimestamp, base64FromBytes, Rpc, } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "tendermint.abci"; export enum CheckTxType { NEW = 0, @@ -267,8 +264,8 @@ export interface RequestEcho { export interface RequestFlush {} export interface RequestInfo { version: string; - blockVersion: Long; - p2pVersion: Long; + blockVersion: bigint; + p2pVersion: bigint; abciVersion: string; } export interface RequestInitChain { @@ -277,12 +274,12 @@ export interface RequestInitChain { consensusParams: ConsensusParams; validators: ValidatorUpdate[]; appStateBytes: Uint8Array; - initialHeight: Long; + initialHeight: bigint; } export interface RequestQuery { data: Uint8Array; path: string; - height: Long; + height: bigint; prove: boolean; } export interface RequestBeginBlock { @@ -299,7 +296,7 @@ export interface RequestDeliverTx { tx: Uint8Array; } export interface RequestEndBlock { - height: Long; + height: bigint; } export interface RequestCommit {} /** lists available snapshots */ @@ -313,7 +310,7 @@ export interface RequestOfferSnapshot { } /** loads a snapshot chunk */ export interface RequestLoadSnapshotChunk { - height: Long; + height: bigint; format: number; chunk: number; } @@ -325,7 +322,7 @@ export interface RequestApplySnapshotChunk { } export interface RequestPrepareProposal { /** the modified transactions cannot exceed this size. */ - maxTxBytes: Long; + maxTxBytes: bigint; /** * txs is an array of transactions that will be included in a block, * sent to the app for possible modifications. @@ -333,7 +330,7 @@ export interface RequestPrepareProposal { txs: Uint8Array[]; localLastCommit: ExtendedCommitInfo; misbehavior: Misbehavior[]; - height: Long; + height: bigint; time: Timestamp; nextValidatorsHash: Uint8Array; /** address of the public key of the validator proposing the block. */ @@ -345,7 +342,7 @@ export interface RequestProcessProposal { misbehavior: Misbehavior[]; /** hash is the merkle root hash of the fields of the proposed block. */ hash: Uint8Array; - height: Long; + height: bigint; time: Timestamp; nextValidatorsHash: Uint8Array; /** address of the public key of the original proposer of the block. */ @@ -381,8 +378,8 @@ export interface ResponseFlush {} export interface ResponseInfo { data: string; version: string; - appVersion: Long; - lastBlockHeight: Long; + appVersion: bigint; + lastBlockHeight: bigint; lastBlockAppHash: Uint8Array; } export interface ResponseInitChain { @@ -396,11 +393,11 @@ export interface ResponseQuery { log: string; /** nondeterministic */ info: string; - index: Long; + index: bigint; key: Uint8Array; value: Uint8Array; proofOps: ProofOps; - height: Long; + height: bigint; codespace: string; } export interface ResponseBeginBlock { @@ -413,12 +410,12 @@ export interface ResponseCheckTx { log: string; /** nondeterministic */ info: string; - gasWanted: Long; - gasUsed: Long; + gasWanted: bigint; + gasUsed: bigint; events: Event[]; codespace: string; sender: string; - priority: Long; + priority: bigint; /** * mempool_error is set by CometBFT. * ABCI applictions creating a ResponseCheckTX should not set mempool_error. @@ -432,8 +429,8 @@ export interface ResponseDeliverTx { log: string; /** nondeterministic */ info: string; - gasWanted: Long; - gasUsed: Long; + gasWanted: bigint; + gasUsed: bigint; events: Event[]; codespace: string; } @@ -445,7 +442,7 @@ export interface ResponseEndBlock { export interface ResponseCommit { /** reserve 1 */ data: Uint8Array; - retainHeight: Long; + retainHeight: bigint; } export interface ResponseListSnapshots { snapshots: Snapshot[]; @@ -504,7 +501,7 @@ export interface EventAttribute { * One usage is indexing transaction results. */ export interface TxResult { - height: Long; + height: bigint; index: number; tx: Uint8Array; result: ResponseDeliverTx; @@ -517,12 +514,12 @@ export interface Validator { */ address: Uint8Array; /** The voting power */ - power: Long; + power: bigint; } /** ValidatorUpdate */ export interface ValidatorUpdate { pubKey: PublicKey; - power: Long; + power: bigint; } /** VoteInfo */ export interface VoteInfo { @@ -540,7 +537,7 @@ export interface Misbehavior { /** The offending validator */ validator: Validator; /** The height when the offense occurred */ - height: Long; + height: bigint; /** The corresponding time where the offense occurred */ time: Timestamp; /** @@ -548,11 +545,11 @@ export interface Misbehavior { * not store historical validators. * https://github.com/tendermint/tendermint/issues/4581 */ - totalVotingPower: Long; + totalVotingPower: bigint; } export interface Snapshot { /** The height at which the snapshot was taken */ - height: Long; + height: bigint; /** The application-specific snapshot format */ format: number; /** Number of chunks in the snapshot */ @@ -583,7 +580,7 @@ function createBaseRequest(): Request { }; } export const Request = { - encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Request, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.echo !== undefined) { RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim(); } @@ -634,8 +631,8 @@ export const Request = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Request { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Request { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequest(); while (reader.pos < end) { @@ -766,7 +763,7 @@ export const Request = { : undefined); return obj; }, - fromPartial, I>>(object: I): Request { + fromPartial(object: Partial): Request { const message = createBaseRequest(); if (object.echo !== undefined && object.echo !== null) { message.echo = RequestEcho.fromPartial(object.echo); @@ -825,14 +822,14 @@ function createBaseRequestEcho(): RequestEcho { }; } export const RequestEcho = { - encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestEcho(); while (reader.pos < end) { @@ -858,7 +855,7 @@ export const RequestEcho = { message.message !== undefined && (obj.message = message.message); return obj; }, - fromPartial, I>>(object: I): RequestEcho { + fromPartial(object: Partial): RequestEcho { const message = createBaseRequestEcho(); message.message = object.message ?? ""; return message; @@ -868,11 +865,11 @@ function createBaseRequestFlush(): RequestFlush { return {}; } export const RequestFlush = { - encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: RequestFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestFlush(); while (reader.pos < end) { @@ -893,7 +890,7 @@ export const RequestFlush = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): RequestFlush { + fromPartial(_: Partial): RequestFlush { const message = createBaseRequestFlush(); return message; }, @@ -901,20 +898,20 @@ export const RequestFlush = { function createBaseRequestInfo(): RequestInfo { return { version: "", - blockVersion: Long.UZERO, - p2pVersion: Long.UZERO, + blockVersion: BigInt(0), + p2pVersion: BigInt(0), abciVersion: "", }; } export const RequestInfo = { - encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== "") { writer.uint32(10).string(message.version); } - if (!message.blockVersion.isZero()) { + if (message.blockVersion !== BigInt(0)) { writer.uint32(16).uint64(message.blockVersion); } - if (!message.p2pVersion.isZero()) { + if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } if (message.abciVersion !== "") { @@ -922,8 +919,8 @@ export const RequestInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestInfo(); while (reader.pos < end) { @@ -933,10 +930,10 @@ export const RequestInfo = { message.version = reader.string(); break; case 2: - message.blockVersion = reader.uint64() as Long; + message.blockVersion = reader.uint64(); break; case 3: - message.p2pVersion = reader.uint64() as Long; + message.p2pVersion = reader.uint64(); break; case 4: message.abciVersion = reader.string(); @@ -951,28 +948,27 @@ export const RequestInfo = { fromJSON(object: any): RequestInfo { const obj = createBaseRequestInfo(); if (isSet(object.version)) obj.version = String(object.version); - if (isSet(object.blockVersion)) obj.blockVersion = Long.fromValue(object.blockVersion); - if (isSet(object.p2pVersion)) obj.p2pVersion = Long.fromValue(object.p2pVersion); + if (isSet(object.blockVersion)) obj.blockVersion = BigInt(object.blockVersion.toString()); + if (isSet(object.p2pVersion)) obj.p2pVersion = BigInt(object.p2pVersion.toString()); if (isSet(object.abciVersion)) obj.abciVersion = String(object.abciVersion); return obj; }, toJSON(message: RequestInfo): unknown { const obj: any = {}; message.version !== undefined && (obj.version = message.version); - message.blockVersion !== undefined && - (obj.blockVersion = (message.blockVersion || Long.UZERO).toString()); - message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || Long.UZERO).toString()); + message.blockVersion !== undefined && (obj.blockVersion = (message.blockVersion || BigInt(0)).toString()); + message.p2pVersion !== undefined && (obj.p2pVersion = (message.p2pVersion || BigInt(0)).toString()); message.abciVersion !== undefined && (obj.abciVersion = message.abciVersion); return obj; }, - fromPartial, I>>(object: I): RequestInfo { + fromPartial(object: Partial): RequestInfo { const message = createBaseRequestInfo(); message.version = object.version ?? ""; if (object.blockVersion !== undefined && object.blockVersion !== null) { - message.blockVersion = Long.fromValue(object.blockVersion); + message.blockVersion = BigInt(object.blockVersion.toString()); } if (object.p2pVersion !== undefined && object.p2pVersion !== null) { - message.p2pVersion = Long.fromValue(object.p2pVersion); + message.p2pVersion = BigInt(object.p2pVersion.toString()); } message.abciVersion = object.abciVersion ?? ""; return message; @@ -985,11 +981,11 @@ function createBaseRequestInitChain(): RequestInitChain { consensusParams: ConsensusParams.fromPartial({}), validators: [], appStateBytes: new Uint8Array(), - initialHeight: Long.ZERO, + initialHeight: BigInt(0), }; } export const RequestInitChain = { - encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(10).fork()).ldelim(); } @@ -1005,13 +1001,13 @@ export const RequestInitChain = { if (message.appStateBytes.length !== 0) { writer.uint32(42).bytes(message.appStateBytes); } - if (!message.initialHeight.isZero()) { + if (message.initialHeight !== BigInt(0)) { writer.uint32(48).int64(message.initialHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestInitChain(); while (reader.pos < end) { @@ -1033,7 +1029,7 @@ export const RequestInitChain = { message.appStateBytes = reader.bytes(); break; case 6: - message.initialHeight = reader.int64() as Long; + message.initialHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1050,7 +1046,7 @@ export const RequestInitChain = { if (Array.isArray(object?.validators)) obj.validators = object.validators.map((e: any) => ValidatorUpdate.fromJSON(e)); if (isSet(object.appStateBytes)) obj.appStateBytes = bytesFromBase64(object.appStateBytes); - if (isSet(object.initialHeight)) obj.initialHeight = Long.fromValue(object.initialHeight); + if (isSet(object.initialHeight)) obj.initialHeight = BigInt(object.initialHeight.toString()); return obj; }, toJSON(message: RequestInitChain): unknown { @@ -1071,10 +1067,10 @@ export const RequestInitChain = { message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(), )); message.initialHeight !== undefined && - (obj.initialHeight = (message.initialHeight || Long.ZERO).toString()); + (obj.initialHeight = (message.initialHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): RequestInitChain { + fromPartial(object: Partial): RequestInitChain { const message = createBaseRequestInitChain(); if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); @@ -1086,7 +1082,7 @@ export const RequestInitChain = { message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || []; message.appStateBytes = object.appStateBytes ?? new Uint8Array(); if (object.initialHeight !== undefined && object.initialHeight !== null) { - message.initialHeight = Long.fromValue(object.initialHeight); + message.initialHeight = BigInt(object.initialHeight.toString()); } return message; }, @@ -1095,19 +1091,19 @@ function createBaseRequestQuery(): RequestQuery { return { data: new Uint8Array(), path: "", - height: Long.ZERO, + height: BigInt(0), prove: false, }; } export const RequestQuery = { - encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(10).bytes(message.data); } if (message.path !== "") { writer.uint32(18).string(message.path); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.prove === true) { @@ -1115,8 +1111,8 @@ export const RequestQuery = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestQuery(); while (reader.pos < end) { @@ -1129,7 +1125,7 @@ export const RequestQuery = { message.path = reader.string(); break; case 3: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 4: message.prove = reader.bool(); @@ -1145,7 +1141,7 @@ export const RequestQuery = { const obj = createBaseRequestQuery(); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); if (isSet(object.path)) obj.path = String(object.path); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.prove)) obj.prove = Boolean(object.prove); return obj; }, @@ -1154,16 +1150,16 @@ export const RequestQuery = { message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.path !== undefined && (obj.path = message.path); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.prove !== undefined && (obj.prove = message.prove); return obj; }, - fromPartial, I>>(object: I): RequestQuery { + fromPartial(object: Partial): RequestQuery { const message = createBaseRequestQuery(); message.data = object.data ?? new Uint8Array(); message.path = object.path ?? ""; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.prove = object.prove ?? false; return message; @@ -1178,7 +1174,7 @@ function createBaseRequestBeginBlock(): RequestBeginBlock { }; } export const RequestBeginBlock = { - encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } @@ -1193,8 +1189,8 @@ export const RequestBeginBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestBeginBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestBeginBlock(); while (reader.pos < end) { @@ -1244,7 +1240,7 @@ export const RequestBeginBlock = { } return obj; }, - fromPartial, I>>(object: I): RequestBeginBlock { + fromPartial(object: Partial): RequestBeginBlock { const message = createBaseRequestBeginBlock(); message.hash = object.hash ?? new Uint8Array(); if (object.header !== undefined && object.header !== null) { @@ -1264,7 +1260,7 @@ function createBaseRequestCheckTx(): RequestCheckTx { }; } export const RequestCheckTx = { - encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } @@ -1273,8 +1269,8 @@ export const RequestCheckTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestCheckTx(); while (reader.pos < end) { @@ -1306,7 +1302,7 @@ export const RequestCheckTx = { message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type)); return obj; }, - fromPartial, I>>(object: I): RequestCheckTx { + fromPartial(object: Partial): RequestCheckTx { const message = createBaseRequestCheckTx(); message.tx = object.tx ?? new Uint8Array(); message.type = object.type ?? 0; @@ -1319,14 +1315,14 @@ function createBaseRequestDeliverTx(): RequestDeliverTx { }; } export const RequestDeliverTx = { - encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.tx.length !== 0) { writer.uint32(10).bytes(message.tx); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestDeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestDeliverTx(); while (reader.pos < end) { @@ -1353,7 +1349,7 @@ export const RequestDeliverTx = { (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): RequestDeliverTx { + fromPartial(object: Partial): RequestDeliverTx { const message = createBaseRequestDeliverTx(); message.tx = object.tx ?? new Uint8Array(); return message; @@ -1361,25 +1357,25 @@ export const RequestDeliverTx = { }; function createBaseRequestEndBlock(): RequestEndBlock { return { - height: Long.ZERO, + height: BigInt(0), }; } export const RequestEndBlock = { - encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: RequestEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestEndBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestEndBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1390,18 +1386,18 @@ export const RequestEndBlock = { }, fromJSON(object: any): RequestEndBlock { const obj = createBaseRequestEndBlock(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); return obj; }, toJSON(message: RequestEndBlock): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): RequestEndBlock { + fromPartial(object: Partial): RequestEndBlock { const message = createBaseRequestEndBlock(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } return message; }, @@ -1410,11 +1406,11 @@ function createBaseRequestCommit(): RequestCommit { return {}; } export const RequestCommit = { - encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: RequestCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestCommit(); while (reader.pos < end) { @@ -1435,7 +1431,7 @@ export const RequestCommit = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): RequestCommit { + fromPartial(_: Partial): RequestCommit { const message = createBaseRequestCommit(); return message; }, @@ -1444,11 +1440,11 @@ function createBaseRequestListSnapshots(): RequestListSnapshots { return {}; } export const RequestListSnapshots = { - encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: RequestListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestListSnapshots(); while (reader.pos < end) { @@ -1469,7 +1465,7 @@ export const RequestListSnapshots = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): RequestListSnapshots { + fromPartial(_: Partial): RequestListSnapshots { const message = createBaseRequestListSnapshots(); return message; }, @@ -1481,7 +1477,7 @@ function createBaseRequestOfferSnapshot(): RequestOfferSnapshot { }; } export const RequestOfferSnapshot = { - encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.snapshot !== undefined) { Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim(); } @@ -1490,8 +1486,8 @@ export const RequestOfferSnapshot = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestOfferSnapshot(); while (reader.pos < end) { @@ -1524,7 +1520,7 @@ export const RequestOfferSnapshot = { (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): RequestOfferSnapshot { + fromPartial(object: Partial): RequestOfferSnapshot { const message = createBaseRequestOfferSnapshot(); if (object.snapshot !== undefined && object.snapshot !== null) { message.snapshot = Snapshot.fromPartial(object.snapshot); @@ -1535,14 +1531,14 @@ export const RequestOfferSnapshot = { }; function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk { return { - height: Long.UZERO, + height: BigInt(0), format: 0, chunk: 0, }; } export const RequestLoadSnapshotChunk = { - encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: RequestLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { @@ -1553,15 +1549,15 @@ export const RequestLoadSnapshotChunk = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestLoadSnapshotChunk(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.uint64() as Long; + message.height = reader.uint64(); break; case 2: message.format = reader.uint32(); @@ -1578,24 +1574,22 @@ export const RequestLoadSnapshotChunk = { }, fromJSON(object: any): RequestLoadSnapshotChunk { const obj = createBaseRequestLoadSnapshotChunk(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.format)) obj.format = Number(object.format); if (isSet(object.chunk)) obj.chunk = Number(object.chunk); return obj; }, toJSON(message: RequestLoadSnapshotChunk): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.format !== undefined && (obj.format = Math.round(message.format)); message.chunk !== undefined && (obj.chunk = Math.round(message.chunk)); return obj; }, - fromPartial, I>>( - object: I, - ): RequestLoadSnapshotChunk { + fromPartial(object: Partial): RequestLoadSnapshotChunk { const message = createBaseRequestLoadSnapshotChunk(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.format = object.format ?? 0; message.chunk = object.chunk ?? 0; @@ -1610,7 +1604,7 @@ function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk { }; } export const RequestApplySnapshotChunk = { - encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -1622,8 +1616,8 @@ export const RequestApplySnapshotChunk = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestApplySnapshotChunk(); while (reader.pos < end) { @@ -1660,9 +1654,7 @@ export const RequestApplySnapshotChunk = { message.sender !== undefined && (obj.sender = message.sender); return obj; }, - fromPartial, I>>( - object: I, - ): RequestApplySnapshotChunk { + fromPartial(object: Partial): RequestApplySnapshotChunk { const message = createBaseRequestApplySnapshotChunk(); message.index = object.index ?? 0; message.chunk = object.chunk ?? new Uint8Array(); @@ -1672,19 +1664,19 @@ export const RequestApplySnapshotChunk = { }; function createBaseRequestPrepareProposal(): RequestPrepareProposal { return { - maxTxBytes: Long.ZERO, + maxTxBytes: BigInt(0), txs: [], localLastCommit: ExtendedCommitInfo.fromPartial({}), misbehavior: [], - height: Long.ZERO, + height: BigInt(0), time: Timestamp.fromPartial({}), nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array(), }; } export const RequestPrepareProposal = { - encode(message: RequestPrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxTxBytes.isZero()) { + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { writer.uint32(8).int64(message.maxTxBytes); } for (const v of message.txs) { @@ -1696,7 +1688,7 @@ export const RequestPrepareProposal = { for (const v of message.misbehavior) { Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { @@ -1710,15 +1702,15 @@ export const RequestPrepareProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestPrepareProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestPrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestPrepareProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxTxBytes = reader.int64() as Long; + message.maxTxBytes = reader.int64(); break; case 2: message.txs.push(reader.bytes()); @@ -1730,7 +1722,7 @@ export const RequestPrepareProposal = { message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 5: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 6: message.time = Timestamp.decode(reader, reader.uint32()); @@ -1750,13 +1742,13 @@ export const RequestPrepareProposal = { }, fromJSON(object: any): RequestPrepareProposal { const obj = createBaseRequestPrepareProposal(); - if (isSet(object.maxTxBytes)) obj.maxTxBytes = Long.fromValue(object.maxTxBytes); + if (isSet(object.maxTxBytes)) obj.maxTxBytes = BigInt(object.maxTxBytes.toString()); if (Array.isArray(object?.txs)) obj.txs = object.txs.map((e: any) => bytesFromBase64(e)); if (isSet(object.localLastCommit)) obj.localLastCommit = ExtendedCommitInfo.fromJSON(object.localLastCommit); if (Array.isArray(object?.misbehavior)) obj.misbehavior = object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); if (isSet(object.nextValidatorsHash)) obj.nextValidatorsHash = bytesFromBase64(object.nextValidatorsHash); if (isSet(object.proposerAddress)) obj.proposerAddress = bytesFromBase64(object.proposerAddress); @@ -1764,7 +1756,7 @@ export const RequestPrepareProposal = { }, toJSON(message: RequestPrepareProposal): unknown { const obj: any = {}; - message.maxTxBytes !== undefined && (obj.maxTxBytes = (message.maxTxBytes || Long.ZERO).toString()); + message.maxTxBytes !== undefined && (obj.maxTxBytes = (message.maxTxBytes || BigInt(0)).toString()); if (message.txs) { obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { @@ -1779,7 +1771,7 @@ export const RequestPrepareProposal = { } else { obj.misbehavior = []; } - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes( @@ -1791,10 +1783,10 @@ export const RequestPrepareProposal = { )); return obj; }, - fromPartial, I>>(object: I): RequestPrepareProposal { + fromPartial(object: Partial): RequestPrepareProposal { const message = createBaseRequestPrepareProposal(); if (object.maxTxBytes !== undefined && object.maxTxBytes !== null) { - message.maxTxBytes = Long.fromValue(object.maxTxBytes); + message.maxTxBytes = BigInt(object.maxTxBytes.toString()); } message.txs = object.txs?.map((e) => e) || []; if (object.localLastCommit !== undefined && object.localLastCommit !== null) { @@ -1802,7 +1794,7 @@ export const RequestPrepareProposal = { } message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || []; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); @@ -1818,14 +1810,14 @@ function createBaseRequestProcessProposal(): RequestProcessProposal { proposedLastCommit: CommitInfo.fromPartial({}), misbehavior: [], hash: new Uint8Array(), - height: Long.ZERO, + height: BigInt(0), time: Timestamp.fromPartial({}), nextValidatorsHash: new Uint8Array(), proposerAddress: new Uint8Array(), }; } export const RequestProcessProposal = { - encode(message: RequestProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: RequestProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); } @@ -1838,7 +1830,7 @@ export const RequestProcessProposal = { if (message.hash.length !== 0) { writer.uint32(34).bytes(message.hash); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(40).int64(message.height); } if (message.time !== undefined) { @@ -1852,8 +1844,8 @@ export const RequestProcessProposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): RequestProcessProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): RequestProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRequestProcessProposal(); while (reader.pos < end) { @@ -1872,7 +1864,7 @@ export const RequestProcessProposal = { message.hash = reader.bytes(); break; case 5: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 6: message.time = Timestamp.decode(reader, reader.uint32()); @@ -1898,7 +1890,7 @@ export const RequestProcessProposal = { if (Array.isArray(object?.misbehavior)) obj.misbehavior = object.misbehavior.map((e: any) => Misbehavior.fromJSON(e)); if (isSet(object.hash)) obj.hash = bytesFromBase64(object.hash); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); if (isSet(object.nextValidatorsHash)) obj.nextValidatorsHash = bytesFromBase64(object.nextValidatorsHash); if (isSet(object.proposerAddress)) obj.proposerAddress = bytesFromBase64(object.proposerAddress); @@ -1922,7 +1914,7 @@ export const RequestProcessProposal = { } message.hash !== undefined && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.nextValidatorsHash !== undefined && (obj.nextValidatorsHash = base64FromBytes( @@ -1934,7 +1926,7 @@ export const RequestProcessProposal = { )); return obj; }, - fromPartial, I>>(object: I): RequestProcessProposal { + fromPartial(object: Partial): RequestProcessProposal { const message = createBaseRequestProcessProposal(); message.txs = object.txs?.map((e) => e) || []; if (object.proposedLastCommit !== undefined && object.proposedLastCommit !== null) { @@ -1943,7 +1935,7 @@ export const RequestProcessProposal = { message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || []; message.hash = object.hash ?? new Uint8Array(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); @@ -1975,7 +1967,7 @@ function createBaseResponse(): Response { }; } export const Response = { - encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.exception !== undefined) { ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); } @@ -2029,8 +2021,8 @@ export const Response = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Response { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponse(); while (reader.pos < end) { @@ -2167,7 +2159,7 @@ export const Response = { : undefined); return obj; }, - fromPartial, I>>(object: I): Response { + fromPartial(object: Partial): Response { const message = createBaseResponse(); if (object.exception !== undefined && object.exception !== null) { message.exception = ResponseException.fromPartial(object.exception); @@ -2229,14 +2221,14 @@ function createBaseResponseException(): ResponseException { }; } export const ResponseException = { - encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.error !== "") { writer.uint32(10).string(message.error); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseException(); while (reader.pos < end) { @@ -2262,7 +2254,7 @@ export const ResponseException = { message.error !== undefined && (obj.error = message.error); return obj; }, - fromPartial, I>>(object: I): ResponseException { + fromPartial(object: Partial): ResponseException { const message = createBaseResponseException(); message.error = object.error ?? ""; return message; @@ -2274,14 +2266,14 @@ function createBaseResponseEcho(): ResponseEcho { }; } export const ResponseEcho = { - encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.message !== "") { writer.uint32(10).string(message.message); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseEcho(); while (reader.pos < end) { @@ -2307,7 +2299,7 @@ export const ResponseEcho = { message.message !== undefined && (obj.message = message.message); return obj; }, - fromPartial, I>>(object: I): ResponseEcho { + fromPartial(object: Partial): ResponseEcho { const message = createBaseResponseEcho(); message.message = object.message ?? ""; return message; @@ -2317,11 +2309,11 @@ function createBaseResponseFlush(): ResponseFlush { return {}; } export const ResponseFlush = { - encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseFlush(); while (reader.pos < end) { @@ -2342,7 +2334,7 @@ export const ResponseFlush = { const obj: any = {}; return obj; }, - fromPartial, I>>(_: I): ResponseFlush { + fromPartial(_: Partial): ResponseFlush { const message = createBaseResponseFlush(); return message; }, @@ -2351,23 +2343,23 @@ function createBaseResponseInfo(): ResponseInfo { return { data: "", version: "", - appVersion: Long.UZERO, - lastBlockHeight: Long.ZERO, + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), lastBlockAppHash: new Uint8Array(), }; } export const ResponseInfo = { - encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data !== "") { writer.uint32(10).string(message.data); } if (message.version !== "") { writer.uint32(18).string(message.version); } - if (!message.appVersion.isZero()) { + if (message.appVersion !== BigInt(0)) { writer.uint32(24).uint64(message.appVersion); } - if (!message.lastBlockHeight.isZero()) { + if (message.lastBlockHeight !== BigInt(0)) { writer.uint32(32).int64(message.lastBlockHeight); } if (message.lastBlockAppHash.length !== 0) { @@ -2375,8 +2367,8 @@ export const ResponseInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseInfo(); while (reader.pos < end) { @@ -2389,10 +2381,10 @@ export const ResponseInfo = { message.version = reader.string(); break; case 3: - message.appVersion = reader.uint64() as Long; + message.appVersion = reader.uint64(); break; case 4: - message.lastBlockHeight = reader.int64() as Long; + message.lastBlockHeight = reader.int64(); break; case 5: message.lastBlockAppHash = reader.bytes(); @@ -2408,8 +2400,8 @@ export const ResponseInfo = { const obj = createBaseResponseInfo(); if (isSet(object.data)) obj.data = String(object.data); if (isSet(object.version)) obj.version = String(object.version); - if (isSet(object.appVersion)) obj.appVersion = Long.fromValue(object.appVersion); - if (isSet(object.lastBlockHeight)) obj.lastBlockHeight = Long.fromValue(object.lastBlockHeight); + if (isSet(object.appVersion)) obj.appVersion = BigInt(object.appVersion.toString()); + if (isSet(object.lastBlockHeight)) obj.lastBlockHeight = BigInt(object.lastBlockHeight.toString()); if (isSet(object.lastBlockAppHash)) obj.lastBlockAppHash = bytesFromBase64(object.lastBlockAppHash); return obj; }, @@ -2417,24 +2409,24 @@ export const ResponseInfo = { const obj: any = {}; message.data !== undefined && (obj.data = message.data); message.version !== undefined && (obj.version = message.version); - message.appVersion !== undefined && (obj.appVersion = (message.appVersion || Long.UZERO).toString()); + message.appVersion !== undefined && (obj.appVersion = (message.appVersion || BigInt(0)).toString()); message.lastBlockHeight !== undefined && - (obj.lastBlockHeight = (message.lastBlockHeight || Long.ZERO).toString()); + (obj.lastBlockHeight = (message.lastBlockHeight || BigInt(0)).toString()); message.lastBlockAppHash !== undefined && (obj.lastBlockAppHash = base64FromBytes( message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(), )); return obj; }, - fromPartial, I>>(object: I): ResponseInfo { + fromPartial(object: Partial): ResponseInfo { const message = createBaseResponseInfo(); message.data = object.data ?? ""; message.version = object.version ?? ""; if (object.appVersion !== undefined && object.appVersion !== null) { - message.appVersion = Long.fromValue(object.appVersion); + message.appVersion = BigInt(object.appVersion.toString()); } if (object.lastBlockHeight !== undefined && object.lastBlockHeight !== null) { - message.lastBlockHeight = Long.fromValue(object.lastBlockHeight); + message.lastBlockHeight = BigInt(object.lastBlockHeight.toString()); } message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; @@ -2448,7 +2440,7 @@ function createBaseResponseInitChain(): ResponseInitChain { }; } export const ResponseInitChain = { - encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.consensusParams !== undefined) { ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); } @@ -2460,8 +2452,8 @@ export const ResponseInitChain = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInitChain { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseInitChain(); while (reader.pos < end) { @@ -2506,7 +2498,7 @@ export const ResponseInitChain = { (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): ResponseInitChain { + fromPartial(object: Partial): ResponseInitChain { const message = createBaseResponseInitChain(); if (object.consensusParams !== undefined && object.consensusParams !== null) { message.consensusParams = ConsensusParams.fromPartial(object.consensusParams); @@ -2521,16 +2513,16 @@ function createBaseResponseQuery(): ResponseQuery { code: 0, log: "", info: "", - index: Long.ZERO, + index: BigInt(0), key: new Uint8Array(), value: new Uint8Array(), proofOps: ProofOps.fromPartial({}), - height: Long.ZERO, + height: BigInt(0), codespace: "", }; } export const ResponseQuery = { - encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -2540,7 +2532,7 @@ export const ResponseQuery = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.index.isZero()) { + if (message.index !== BigInt(0)) { writer.uint32(40).int64(message.index); } if (message.key.length !== 0) { @@ -2552,7 +2544,7 @@ export const ResponseQuery = { if (message.proofOps !== undefined) { ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(72).int64(message.height); } if (message.codespace !== "") { @@ -2560,8 +2552,8 @@ export const ResponseQuery = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseQuery(); while (reader.pos < end) { @@ -2577,7 +2569,7 @@ export const ResponseQuery = { message.info = reader.string(); break; case 5: - message.index = reader.int64() as Long; + message.index = reader.int64(); break; case 6: message.key = reader.bytes(); @@ -2589,7 +2581,7 @@ export const ResponseQuery = { message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 10: message.codespace = reader.string(); @@ -2606,11 +2598,11 @@ export const ResponseQuery = { if (isSet(object.code)) obj.code = Number(object.code); if (isSet(object.log)) obj.log = String(object.log); if (isSet(object.info)) obj.info = String(object.info); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); if (isSet(object.key)) obj.key = bytesFromBase64(object.key); if (isSet(object.value)) obj.value = bytesFromBase64(object.value); if (isSet(object.proofOps)) obj.proofOps = ProofOps.fromJSON(object.proofOps); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.codespace)) obj.codespace = String(object.codespace); return obj; }, @@ -2619,24 +2611,24 @@ export const ResponseQuery = { message.code !== undefined && (obj.code = Math.round(message.code)); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.codespace !== undefined && (obj.codespace = message.codespace); return obj; }, - fromPartial, I>>(object: I): ResponseQuery { + fromPartial(object: Partial): ResponseQuery { const message = createBaseResponseQuery(); message.code = object.code ?? 0; message.log = object.log ?? ""; message.info = object.info ?? ""; if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } message.key = object.key ?? new Uint8Array(); message.value = object.value ?? new Uint8Array(); @@ -2644,7 +2636,7 @@ export const ResponseQuery = { message.proofOps = ProofOps.fromPartial(object.proofOps); } if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.codespace = object.codespace ?? ""; return message; @@ -2656,14 +2648,14 @@ function createBaseResponseBeginBlock(): ResponseBeginBlock { }; } export const ResponseBeginBlock = { - encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.events) { Event.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseBeginBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseBeginBlock(); while (reader.pos < end) { @@ -2693,7 +2685,7 @@ export const ResponseBeginBlock = { } return obj; }, - fromPartial, I>>(object: I): ResponseBeginBlock { + fromPartial(object: Partial): ResponseBeginBlock { const message = createBaseResponseBeginBlock(); message.events = object.events?.map((e) => Event.fromPartial(e)) || []; return message; @@ -2705,17 +2697,17 @@ function createBaseResponseCheckTx(): ResponseCheckTx { data: new Uint8Array(), log: "", info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), events: [], codespace: "", sender: "", - priority: Long.ZERO, + priority: BigInt(0), mempoolError: "", }; } export const ResponseCheckTx = { - encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -2728,10 +2720,10 @@ export const ResponseCheckTx = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.gasWanted.isZero()) { + if (message.gasWanted !== BigInt(0)) { writer.uint32(40).int64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { @@ -2743,7 +2735,7 @@ export const ResponseCheckTx = { if (message.sender !== "") { writer.uint32(74).string(message.sender); } - if (!message.priority.isZero()) { + if (message.priority !== BigInt(0)) { writer.uint32(80).int64(message.priority); } if (message.mempoolError !== "") { @@ -2751,8 +2743,8 @@ export const ResponseCheckTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseCheckTx(); while (reader.pos < end) { @@ -2771,10 +2763,10 @@ export const ResponseCheckTx = { message.info = reader.string(); break; case 5: - message.gasWanted = reader.int64() as Long; + message.gasWanted = reader.int64(); break; case 6: - message.gasUsed = reader.int64() as Long; + message.gasUsed = reader.int64(); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); @@ -2786,7 +2778,7 @@ export const ResponseCheckTx = { message.sender = reader.string(); break; case 10: - message.priority = reader.int64() as Long; + message.priority = reader.int64(); break; case 11: message.mempoolError = reader.string(); @@ -2804,12 +2796,12 @@ export const ResponseCheckTx = { if (isSet(object.data)) obj.data = bytesFromBase64(object.data); if (isSet(object.log)) obj.log = String(object.log); if (isSet(object.info)) obj.info = String(object.info); - if (isSet(object.gas_wanted)) obj.gasWanted = Long.fromValue(object.gas_wanted); - if (isSet(object.gas_used)) obj.gasUsed = Long.fromValue(object.gas_used); + if (isSet(object.gas_wanted)) obj.gasWanted = BigInt(object.gas_wanted.toString()); + if (isSet(object.gas_used)) obj.gasUsed = BigInt(object.gas_used.toString()); if (Array.isArray(object?.events)) obj.events = object.events.map((e: any) => Event.fromJSON(e)); if (isSet(object.codespace)) obj.codespace = String(object.codespace); if (isSet(object.sender)) obj.sender = String(object.sender); - if (isSet(object.priority)) obj.priority = Long.fromValue(object.priority); + if (isSet(object.priority)) obj.priority = BigInt(object.priority.toString()); if (isSet(object.mempoolError)) obj.mempoolError = String(object.mempoolError); return obj; }, @@ -2820,8 +2812,8 @@ export const ResponseCheckTx = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || Long.ZERO).toString()); + message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || BigInt(0)).toString()); if (message.events) { obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); } else { @@ -2829,27 +2821,27 @@ export const ResponseCheckTx = { } message.codespace !== undefined && (obj.codespace = message.codespace); message.sender !== undefined && (obj.sender = message.sender); - message.priority !== undefined && (obj.priority = (message.priority || Long.ZERO).toString()); + message.priority !== undefined && (obj.priority = (message.priority || BigInt(0)).toString()); message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError); return obj; }, - fromPartial, I>>(object: I): ResponseCheckTx { + fromPartial(object: Partial): ResponseCheckTx { const message = createBaseResponseCheckTx(); message.code = object.code ?? 0; message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; if (object.gasWanted !== undefined && object.gasWanted !== null) { - message.gasWanted = Long.fromValue(object.gasWanted); + message.gasWanted = BigInt(object.gasWanted.toString()); } if (object.gasUsed !== undefined && object.gasUsed !== null) { - message.gasUsed = Long.fromValue(object.gasUsed); + message.gasUsed = BigInt(object.gasUsed.toString()); } message.events = object.events?.map((e) => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; message.sender = object.sender ?? ""; if (object.priority !== undefined && object.priority !== null) { - message.priority = Long.fromValue(object.priority); + message.priority = BigInt(object.priority.toString()); } message.mempoolError = object.mempoolError ?? ""; return message; @@ -2861,14 +2853,14 @@ function createBaseResponseDeliverTx(): ResponseDeliverTx { data: new Uint8Array(), log: "", info: "", - gasWanted: Long.ZERO, - gasUsed: Long.ZERO, + gasWanted: BigInt(0), + gasUsed: BigInt(0), events: [], codespace: "", }; } export const ResponseDeliverTx = { - encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -2881,10 +2873,10 @@ export const ResponseDeliverTx = { if (message.info !== "") { writer.uint32(34).string(message.info); } - if (!message.gasWanted.isZero()) { + if (message.gasWanted !== BigInt(0)) { writer.uint32(40).int64(message.gasWanted); } - if (!message.gasUsed.isZero()) { + if (message.gasUsed !== BigInt(0)) { writer.uint32(48).int64(message.gasUsed); } for (const v of message.events) { @@ -2895,8 +2887,8 @@ export const ResponseDeliverTx = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseDeliverTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseDeliverTx(); while (reader.pos < end) { @@ -2915,10 +2907,10 @@ export const ResponseDeliverTx = { message.info = reader.string(); break; case 5: - message.gasWanted = reader.int64() as Long; + message.gasWanted = reader.int64(); break; case 6: - message.gasUsed = reader.int64() as Long; + message.gasUsed = reader.int64(); break; case 7: message.events.push(Event.decode(reader, reader.uint32())); @@ -2939,8 +2931,8 @@ export const ResponseDeliverTx = { if (isSet(object.data)) obj.data = bytesFromBase64(object.data); if (isSet(object.log)) obj.log = String(object.log); if (isSet(object.info)) obj.info = String(object.info); - if (isSet(object.gas_wanted)) obj.gasWanted = Long.fromValue(object.gas_wanted); - if (isSet(object.gas_used)) obj.gasUsed = Long.fromValue(object.gas_used); + if (isSet(object.gas_wanted)) obj.gasWanted = BigInt(object.gas_wanted.toString()); + if (isSet(object.gas_used)) obj.gasUsed = BigInt(object.gas_used.toString()); if (Array.isArray(object?.events)) obj.events = object.events.map((e: any) => Event.fromJSON(e)); if (isSet(object.codespace)) obj.codespace = String(object.codespace); return obj; @@ -2952,8 +2944,8 @@ export const ResponseDeliverTx = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); message.log !== undefined && (obj.log = message.log); message.info !== undefined && (obj.info = message.info); - message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || Long.ZERO).toString()); - message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || Long.ZERO).toString()); + message.gasWanted !== undefined && (obj.gas_wanted = (message.gasWanted || BigInt(0)).toString()); + message.gasUsed !== undefined && (obj.gas_used = (message.gasUsed || BigInt(0)).toString()); if (message.events) { obj.events = message.events.map((e) => (e ? Event.toJSON(e) : undefined)); } else { @@ -2962,17 +2954,17 @@ export const ResponseDeliverTx = { message.codespace !== undefined && (obj.codespace = message.codespace); return obj; }, - fromPartial, I>>(object: I): ResponseDeliverTx { + fromPartial(object: Partial): ResponseDeliverTx { const message = createBaseResponseDeliverTx(); message.code = object.code ?? 0; message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; if (object.gasWanted !== undefined && object.gasWanted !== null) { - message.gasWanted = Long.fromValue(object.gasWanted); + message.gasWanted = BigInt(object.gasWanted.toString()); } if (object.gasUsed !== undefined && object.gasUsed !== null) { - message.gasUsed = Long.fromValue(object.gasUsed); + message.gasUsed = BigInt(object.gasUsed.toString()); } message.events = object.events?.map((e) => Event.fromPartial(e)) || []; message.codespace = object.codespace ?? ""; @@ -2987,7 +2979,7 @@ function createBaseResponseEndBlock(): ResponseEndBlock { }; } export const ResponseEndBlock = { - encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validatorUpdates) { ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } @@ -2999,8 +2991,8 @@ export const ResponseEndBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEndBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseEndBlock(); while (reader.pos < end) { @@ -3049,7 +3041,7 @@ export const ResponseEndBlock = { } return obj; }, - fromPartial, I>>(object: I): ResponseEndBlock { + fromPartial(object: Partial): ResponseEndBlock { const message = createBaseResponseEndBlock(); message.validatorUpdates = object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || []; if (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null) { @@ -3062,21 +3054,21 @@ export const ResponseEndBlock = { function createBaseResponseCommit(): ResponseCommit { return { data: new Uint8Array(), - retainHeight: Long.ZERO, + retainHeight: BigInt(0), }; } export const ResponseCommit = { - encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.data.length !== 0) { writer.uint32(18).bytes(message.data); } - if (!message.retainHeight.isZero()) { + if (message.retainHeight !== BigInt(0)) { writer.uint32(24).int64(message.retainHeight); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseCommit(); while (reader.pos < end) { @@ -3086,7 +3078,7 @@ export const ResponseCommit = { message.data = reader.bytes(); break; case 3: - message.retainHeight = reader.int64() as Long; + message.retainHeight = reader.int64(); break; default: reader.skipType(tag & 7); @@ -3098,21 +3090,21 @@ export const ResponseCommit = { fromJSON(object: any): ResponseCommit { const obj = createBaseResponseCommit(); if (isSet(object.data)) obj.data = bytesFromBase64(object.data); - if (isSet(object.retainHeight)) obj.retainHeight = Long.fromValue(object.retainHeight); + if (isSet(object.retainHeight)) obj.retainHeight = BigInt(object.retainHeight.toString()); return obj; }, toJSON(message: ResponseCommit): unknown { const obj: any = {}; message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); - message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || Long.ZERO).toString()); + message.retainHeight !== undefined && (obj.retainHeight = (message.retainHeight || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ResponseCommit { + fromPartial(object: Partial): ResponseCommit { const message = createBaseResponseCommit(); message.data = object.data ?? new Uint8Array(); if (object.retainHeight !== undefined && object.retainHeight !== null) { - message.retainHeight = Long.fromValue(object.retainHeight); + message.retainHeight = BigInt(object.retainHeight.toString()); } return message; }, @@ -3123,14 +3115,14 @@ function createBaseResponseListSnapshots(): ResponseListSnapshots { }; } export const ResponseListSnapshots = { - encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseListSnapshots, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.snapshots) { Snapshot.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseListSnapshots { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseListSnapshots(); while (reader.pos < end) { @@ -3161,7 +3153,7 @@ export const ResponseListSnapshots = { } return obj; }, - fromPartial, I>>(object: I): ResponseListSnapshots { + fromPartial(object: Partial): ResponseListSnapshots { const message = createBaseResponseListSnapshots(); message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || []; return message; @@ -3173,14 +3165,14 @@ function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot { }; } export const ResponseOfferSnapshot = { - encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseOfferSnapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseOfferSnapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseOfferSnapshot(); while (reader.pos < end) { @@ -3206,7 +3198,7 @@ export const ResponseOfferSnapshot = { message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result)); return obj; }, - fromPartial, I>>(object: I): ResponseOfferSnapshot { + fromPartial(object: Partial): ResponseOfferSnapshot { const message = createBaseResponseOfferSnapshot(); message.result = object.result ?? 0; return message; @@ -3218,14 +3210,14 @@ function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk { }; } export const ResponseLoadSnapshotChunk = { - encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseLoadSnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.chunk.length !== 0) { writer.uint32(10).bytes(message.chunk); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseLoadSnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseLoadSnapshotChunk(); while (reader.pos < end) { @@ -3252,9 +3244,7 @@ export const ResponseLoadSnapshotChunk = { (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array())); return obj; }, - fromPartial, I>>( - object: I, - ): ResponseLoadSnapshotChunk { + fromPartial(object: Partial): ResponseLoadSnapshotChunk { const message = createBaseResponseLoadSnapshotChunk(); message.chunk = object.chunk ?? new Uint8Array(); return message; @@ -3268,7 +3258,7 @@ function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk { }; } export const ResponseApplySnapshotChunk = { - encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseApplySnapshotChunk, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.result !== 0) { writer.uint32(8).int32(message.result); } @@ -3282,8 +3272,8 @@ export const ResponseApplySnapshotChunk = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseApplySnapshotChunk { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseApplySnapshotChunk(); while (reader.pos < end) { @@ -3336,9 +3326,7 @@ export const ResponseApplySnapshotChunk = { } return obj; }, - fromPartial, I>>( - object: I, - ): ResponseApplySnapshotChunk { + fromPartial(object: Partial): ResponseApplySnapshotChunk { const message = createBaseResponseApplySnapshotChunk(); message.result = object.result ?? 0; message.refetchChunks = object.refetchChunks?.map((e) => e) || []; @@ -3352,14 +3340,14 @@ function createBaseResponsePrepareProposal(): ResponsePrepareProposal { }; } export const ResponsePrepareProposal = { - encode(message: ResponsePrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponsePrepareProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponsePrepareProposal(); while (reader.pos < end) { @@ -3389,7 +3377,7 @@ export const ResponsePrepareProposal = { } return obj; }, - fromPartial, I>>(object: I): ResponsePrepareProposal { + fromPartial(object: Partial): ResponsePrepareProposal { const message = createBaseResponsePrepareProposal(); message.txs = object.txs?.map((e) => e) || []; return message; @@ -3401,14 +3389,14 @@ function createBaseResponseProcessProposal(): ResponseProcessProposal { }; } export const ResponseProcessProposal = { - encode(message: ResponseProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ResponseProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.status !== 0) { writer.uint32(8).int32(message.status); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ResponseProcessProposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ResponseProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseResponseProcessProposal(); while (reader.pos < end) { @@ -3435,7 +3423,7 @@ export const ResponseProcessProposal = { (obj.status = responseProcessProposal_ProposalStatusToJSON(message.status)); return obj; }, - fromPartial, I>>(object: I): ResponseProcessProposal { + fromPartial(object: Partial): ResponseProcessProposal { const message = createBaseResponseProcessProposal(); message.status = object.status ?? 0; return message; @@ -3448,7 +3436,7 @@ function createBaseCommitInfo(): CommitInfo { }; } export const CommitInfo = { - encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } @@ -3457,8 +3445,8 @@ export const CommitInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitInfo(); while (reader.pos < end) { @@ -3493,7 +3481,7 @@ export const CommitInfo = { } return obj; }, - fromPartial, I>>(object: I): CommitInfo { + fromPartial(object: Partial): CommitInfo { const message = createBaseCommitInfo(); message.round = object.round ?? 0; message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || []; @@ -3507,7 +3495,7 @@ function createBaseExtendedCommitInfo(): ExtendedCommitInfo { }; } export const ExtendedCommitInfo = { - encode(message: ExtendedCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } @@ -3516,8 +3504,8 @@ export const ExtendedCommitInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedCommitInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { @@ -3552,7 +3540,7 @@ export const ExtendedCommitInfo = { } return obj; }, - fromPartial, I>>(object: I): ExtendedCommitInfo { + fromPartial(object: Partial): ExtendedCommitInfo { const message = createBaseExtendedCommitInfo(); message.round = object.round ?? 0; message.votes = object.votes?.map((e) => ExtendedVoteInfo.fromPartial(e)) || []; @@ -3566,7 +3554,7 @@ function createBaseEvent(): Event { }; } export const Event = { - encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Event, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -3575,8 +3563,8 @@ export const Event = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Event { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Event { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvent(); while (reader.pos < end) { @@ -3612,7 +3600,7 @@ export const Event = { } return obj; }, - fromPartial, I>>(object: I): Event { + fromPartial(object: Partial): Event { const message = createBaseEvent(); message.type = object.type ?? ""; message.attributes = object.attributes?.map((e) => EventAttribute.fromPartial(e)) || []; @@ -3627,7 +3615,7 @@ function createBaseEventAttribute(): EventAttribute { }; } export const EventAttribute = { - encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -3639,8 +3627,8 @@ export const EventAttribute = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EventAttribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventAttribute(); while (reader.pos < end) { @@ -3676,7 +3664,7 @@ export const EventAttribute = { message.index !== undefined && (obj.index = message.index); return obj; }, - fromPartial, I>>(object: I): EventAttribute { + fromPartial(object: Partial): EventAttribute { const message = createBaseEventAttribute(); message.key = object.key ?? ""; message.value = object.value ?? ""; @@ -3686,15 +3674,15 @@ export const EventAttribute = { }; function createBaseTxResult(): TxResult { return { - height: Long.ZERO, + height: BigInt(0), index: 0, tx: new Uint8Array(), result: ResponseDeliverTx.fromPartial({}), }; } export const TxResult = { - encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: TxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.index !== 0) { @@ -3708,15 +3696,15 @@ export const TxResult = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxResult { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 2: message.index = reader.uint32(); @@ -3736,7 +3724,7 @@ export const TxResult = { }, fromJSON(object: any): TxResult { const obj = createBaseTxResult(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.index)) obj.index = Number(object.index); if (isSet(object.tx)) obj.tx = bytesFromBase64(object.tx); if (isSet(object.result)) obj.result = ResponseDeliverTx.fromJSON(object.result); @@ -3744,7 +3732,7 @@ export const TxResult = { }, toJSON(message: TxResult): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.index !== undefined && (obj.index = Math.round(message.index)); message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array())); @@ -3752,10 +3740,10 @@ export const TxResult = { (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined); return obj; }, - fromPartial, I>>(object: I): TxResult { + fromPartial(object: Partial): TxResult { const message = createBaseTxResult(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.index = object.index ?? 0; message.tx = object.tx ?? new Uint8Array(); @@ -3768,21 +3756,21 @@ export const TxResult = { function createBaseValidator(): Validator { return { address: new Uint8Array(), - power: Long.ZERO, + power: BigInt(0), }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(24).int64(message.power); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -3792,7 +3780,7 @@ export const Validator = { message.address = reader.bytes(); break; case 3: - message.power = reader.int64() as Long; + message.power = reader.int64(); break; default: reader.skipType(tag & 7); @@ -3804,21 +3792,21 @@ export const Validator = { fromJSON(object: any): Validator { const obj = createBaseValidator(); if (isSet(object.address)) obj.address = bytesFromBase64(object.address); - if (isSet(object.power)) obj.power = Long.fromValue(object.power); + if (isSet(object.power)) obj.power = BigInt(object.power.toString()); return obj; }, toJSON(message: Validator): unknown { const obj: any = {}; message.address !== undefined && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Validator { + fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); if (object.power !== undefined && object.power !== null) { - message.power = Long.fromValue(object.power); + message.power = BigInt(object.power.toString()); } return message; }, @@ -3826,21 +3814,21 @@ export const Validator = { function createBaseValidatorUpdate(): ValidatorUpdate { return { pubKey: PublicKey.fromPartial({}), - power: Long.ZERO, + power: BigInt(0), }; } export const ValidatorUpdate = { - encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (!message.power.isZero()) { + if (message.power !== BigInt(0)) { writer.uint32(16).int64(message.power); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorUpdate(); while (reader.pos < end) { @@ -3850,7 +3838,7 @@ export const ValidatorUpdate = { message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.power = reader.int64() as Long; + message.power = reader.int64(); break; default: reader.skipType(tag & 7); @@ -3862,23 +3850,23 @@ export const ValidatorUpdate = { fromJSON(object: any): ValidatorUpdate { const obj = createBaseValidatorUpdate(); if (isSet(object.pubKey)) obj.pubKey = PublicKey.fromJSON(object.pubKey); - if (isSet(object.power)) obj.power = Long.fromValue(object.power); + if (isSet(object.power)) obj.power = BigInt(object.power.toString()); return obj; }, toJSON(message: ValidatorUpdate): unknown { const obj: any = {}; message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); + message.power !== undefined && (obj.power = (message.power || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ValidatorUpdate { + fromPartial(object: Partial): ValidatorUpdate { const message = createBaseValidatorUpdate(); if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = PublicKey.fromPartial(object.pubKey); } if (object.power !== undefined && object.power !== null) { - message.power = Long.fromValue(object.power); + message.power = BigInt(object.power.toString()); } return message; }, @@ -3890,7 +3878,7 @@ function createBaseVoteInfo(): VoteInfo { }; } export const VoteInfo = { - encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: VoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } @@ -3899,8 +3887,8 @@ export const VoteInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVoteInfo(); while (reader.pos < end) { @@ -3932,7 +3920,7 @@ export const VoteInfo = { message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock); return obj; }, - fromPartial, I>>(object: I): VoteInfo { + fromPartial(object: Partial): VoteInfo { const message = createBaseVoteInfo(); if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromPartial(object.validator); @@ -3949,7 +3937,7 @@ function createBaseExtendedVoteInfo(): ExtendedVoteInfo { }; } export const ExtendedVoteInfo = { - encode(message: ExtendedVoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ExtendedVoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } @@ -3961,8 +3949,8 @@ export const ExtendedVoteInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedVoteInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExtendedVoteInfo(); while (reader.pos < end) { @@ -4002,7 +3990,7 @@ export const ExtendedVoteInfo = { )); return obj; }, - fromPartial, I>>(object: I): ExtendedVoteInfo { + fromPartial(object: Partial): ExtendedVoteInfo { const message = createBaseExtendedVoteInfo(); if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromPartial(object.validator); @@ -4016,32 +4004,32 @@ function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: Validator.fromPartial({}), - height: Long.ZERO, + height: BigInt(0), time: Timestamp.fromPartial({}), - totalVotingPower: Long.ZERO, + totalVotingPower: BigInt(0), }; } export const Misbehavior = { - encode(message: Misbehavior, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(18).fork()).ldelim(); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { Timestamp.encode(message.time, writer.uint32(34).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(40).int64(message.totalVotingPower); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Misbehavior { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMisbehavior(); while (reader.pos < end) { @@ -4054,13 +4042,13 @@ export const Misbehavior = { message.validator = Validator.decode(reader, reader.uint32()); break; case 3: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 4: message.time = Timestamp.decode(reader, reader.uint32()); break; case 5: - message.totalVotingPower = reader.int64() as Long; + message.totalVotingPower = reader.int64(); break; default: reader.skipType(tag & 7); @@ -4073,9 +4061,9 @@ export const Misbehavior = { const obj = createBaseMisbehavior(); if (isSet(object.type)) obj.type = misbehaviorTypeFromJSON(object.type); if (isSet(object.validator)) obj.validator = Validator.fromJSON(object.validator); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); - if (isSet(object.totalVotingPower)) obj.totalVotingPower = Long.fromValue(object.totalVotingPower); + if (isSet(object.totalVotingPower)) obj.totalVotingPower = BigInt(object.totalVotingPower.toString()); return obj; }, toJSON(message: Misbehavior): unknown { @@ -4083,33 +4071,33 @@ export const Misbehavior = { message.type !== undefined && (obj.type = misbehaviorTypeToJSON(message.type)); message.validator !== undefined && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Misbehavior { + fromPartial(object: Partial): Misbehavior { const message = createBaseMisbehavior(); message.type = object.type ?? 0; if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromPartial(object.validator); } if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); } if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { - message.totalVotingPower = Long.fromValue(object.totalVotingPower); + message.totalVotingPower = BigInt(object.totalVotingPower.toString()); } return message; }, }; function createBaseSnapshot(): Snapshot { return { - height: Long.UZERO, + height: BigInt(0), format: 0, chunks: 0, hash: new Uint8Array(), @@ -4117,8 +4105,8 @@ function createBaseSnapshot(): Snapshot { }; } export const Snapshot = { - encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).uint64(message.height); } if (message.format !== 0) { @@ -4135,15 +4123,15 @@ export const Snapshot = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSnapshot(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.uint64() as Long; + message.height = reader.uint64(); break; case 2: message.format = reader.uint32(); @@ -4166,7 +4154,7 @@ export const Snapshot = { }, fromJSON(object: any): Snapshot { const obj = createBaseSnapshot(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.format)) obj.format = Number(object.format); if (isSet(object.chunks)) obj.chunks = Number(object.chunks); if (isSet(object.hash)) obj.hash = bytesFromBase64(object.hash); @@ -4175,7 +4163,7 @@ export const Snapshot = { }, toJSON(message: Snapshot): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.UZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.format !== undefined && (obj.format = Math.round(message.format)); message.chunks !== undefined && (obj.chunks = Math.round(message.chunks)); message.hash !== undefined && @@ -4184,10 +4172,10 @@ export const Snapshot = { (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): Snapshot { + fromPartial(object: Partial): Snapshot { const message = createBaseSnapshot(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.format = object.format ?? 0; message.chunks = object.chunks ?? 0; @@ -4238,81 +4226,81 @@ export class ABCIApplicationClientImpl implements ABCIApplication { Echo(request: RequestEcho): Promise { const data = RequestEcho.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data); - return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseEcho.decode(new BinaryReader(data))); } Flush(request: RequestFlush = {}): Promise { const data = RequestFlush.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data); - return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseFlush.decode(new BinaryReader(data))); } Info(request: RequestInfo): Promise { const data = RequestInfo.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data); - return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseInfo.decode(new BinaryReader(data))); } DeliverTx(request: RequestDeliverTx): Promise { const data = RequestDeliverTx.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data); - return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseDeliverTx.decode(new BinaryReader(data))); } CheckTx(request: RequestCheckTx): Promise { const data = RequestCheckTx.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data); - return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseCheckTx.decode(new BinaryReader(data))); } Query(request: RequestQuery): Promise { const data = RequestQuery.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data); - return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseQuery.decode(new BinaryReader(data))); } Commit(request: RequestCommit = {}): Promise { const data = RequestCommit.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data); - return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseCommit.decode(new BinaryReader(data))); } InitChain(request: RequestInitChain): Promise { const data = RequestInitChain.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data); - return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseInitChain.decode(new BinaryReader(data))); } BeginBlock(request: RequestBeginBlock): Promise { const data = RequestBeginBlock.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data); - return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseBeginBlock.decode(new BinaryReader(data))); } EndBlock(request: RequestEndBlock): Promise { const data = RequestEndBlock.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data); - return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseEndBlock.decode(new BinaryReader(data))); } ListSnapshots(request: RequestListSnapshots = {}): Promise { const data = RequestListSnapshots.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data); - return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseListSnapshots.decode(new BinaryReader(data))); } OfferSnapshot(request: RequestOfferSnapshot): Promise { const data = RequestOfferSnapshot.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data); - return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseOfferSnapshot.decode(new BinaryReader(data))); } LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise { const data = RequestLoadSnapshotChunk.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data); - return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseLoadSnapshotChunk.decode(new BinaryReader(data))); } ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise { const data = RequestApplySnapshotChunk.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data); - return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseApplySnapshotChunk.decode(new BinaryReader(data))); } PrepareProposal(request: RequestPrepareProposal): Promise { const data = RequestPrepareProposal.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "PrepareProposal", data); - return promise.then((data) => ResponsePrepareProposal.decode(new _m0.Reader(data))); + return promise.then((data) => ResponsePrepareProposal.decode(new BinaryReader(data))); } ProcessProposal(request: RequestProcessProposal): Promise { const data = RequestProcessProposal.encode(request).finish(); const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ProcessProposal", data); - return promise.then((data) => ResponseProcessProposal.decode(new _m0.Reader(data))); + return promise.then((data) => ResponseProcessProposal.decode(new BinaryReader(data))); } } diff --git a/src/tendermint/crypto/keys.ts b/src/tendermint/crypto/keys.ts index 220ede2..10e3679 100644 --- a/src/tendermint/crypto/keys.ts +++ b/src/tendermint/crypto/keys.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import * as _m0 from "protobufjs/minimal"; -import { isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../helpers"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export const protobufPackage = "tendermint.crypto"; /** PublicKey defines the keys available for use with Validators */ export interface PublicKey { @@ -14,7 +14,7 @@ function createBasePublicKey(): PublicKey { }; } export const PublicKey = { - encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PublicKey, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.ed25519 !== undefined) { writer.uint32(10).bytes(message.ed25519); } @@ -23,8 +23,8 @@ export const PublicKey = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PublicKey { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePublicKey(); while (reader.pos < end) { @@ -57,7 +57,7 @@ export const PublicKey = { (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); return obj; }, - fromPartial, I>>(object: I): PublicKey { + fromPartial(object: Partial): PublicKey { const message = createBasePublicKey(); message.ed25519 = object.ed25519 ?? undefined; message.secp256k1 = object.secp256k1 ?? undefined; diff --git a/src/tendermint/crypto/proof.ts b/src/tendermint/crypto/proof.ts index 7315c60..013ab16 100644 --- a/src/tendermint/crypto/proof.ts +++ b/src/tendermint/crypto/proof.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import { Long, isSet, bytesFromBase64, base64FromBytes, DeepPartial, Exact } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export const protobufPackage = "tendermint.crypto"; export interface Proof { - total: Long; - index: Long; + total: bigint; + index: bigint; leafHash: Uint8Array; aunts: Uint8Array[]; } @@ -35,18 +35,18 @@ export interface ProofOps { } function createBaseProof(): Proof { return { - total: Long.ZERO, - index: Long.ZERO, + total: BigInt(0), + index: BigInt(0), leafHash: new Uint8Array(), aunts: [], }; } export const Proof = { - encode(message: Proof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.total.isZero()) { + encode(message: Proof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.total !== BigInt(0)) { writer.uint32(8).int64(message.total); } - if (!message.index.isZero()) { + if (message.index !== BigInt(0)) { writer.uint32(16).int64(message.index); } if (message.leafHash.length !== 0) { @@ -57,18 +57,18 @@ export const Proof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProof(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.total = reader.int64() as Long; + message.total = reader.int64(); break; case 2: - message.index = reader.int64() as Long; + message.index = reader.int64(); break; case 3: message.leafHash = reader.bytes(); @@ -85,16 +85,16 @@ export const Proof = { }, fromJSON(object: any): Proof { const obj = createBaseProof(); - if (isSet(object.total)) obj.total = Long.fromValue(object.total); - if (isSet(object.index)) obj.index = Long.fromValue(object.index); + if (isSet(object.total)) obj.total = BigInt(object.total.toString()); + if (isSet(object.index)) obj.index = BigInt(object.index.toString()); if (isSet(object.leafHash)) obj.leafHash = bytesFromBase64(object.leafHash); if (Array.isArray(object?.aunts)) obj.aunts = object.aunts.map((e: any) => bytesFromBase64(e)); return obj; }, toJSON(message: Proof): unknown { const obj: any = {}; - message.total !== undefined && (obj.total = (message.total || Long.ZERO).toString()); - message.index !== undefined && (obj.index = (message.index || Long.ZERO).toString()); + message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); + message.index !== undefined && (obj.index = (message.index || BigInt(0)).toString()); message.leafHash !== undefined && (obj.leafHash = base64FromBytes(message.leafHash !== undefined ? message.leafHash : new Uint8Array())); if (message.aunts) { @@ -104,13 +104,13 @@ export const Proof = { } return obj; }, - fromPartial, I>>(object: I): Proof { + fromPartial(object: Partial): Proof { const message = createBaseProof(); if (object.total !== undefined && object.total !== null) { - message.total = Long.fromValue(object.total); + message.total = BigInt(object.total.toString()); } if (object.index !== undefined && object.index !== null) { - message.index = Long.fromValue(object.index); + message.index = BigInt(object.index.toString()); } message.leafHash = object.leafHash ?? new Uint8Array(); message.aunts = object.aunts?.map((e) => e) || []; @@ -124,7 +124,7 @@ function createBaseValueOp(): ValueOp { }; } export const ValueOp = { - encode(message: ValueOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValueOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key.length !== 0) { writer.uint32(10).bytes(message.key); } @@ -133,8 +133,8 @@ export const ValueOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValueOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValueOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValueOp(); while (reader.pos < end) { @@ -166,7 +166,7 @@ export const ValueOp = { message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial, I>>(object: I): ValueOp { + fromPartial(object: Partial): ValueOp { const message = createBaseValueOp(); message.key = object.key ?? new Uint8Array(); if (object.proof !== undefined && object.proof !== null) { @@ -183,7 +183,7 @@ function createBaseDominoOp(): DominoOp { }; } export const DominoOp = { - encode(message: DominoOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DominoOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } @@ -195,8 +195,8 @@ export const DominoOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DominoOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DominoOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDominoOp(); while (reader.pos < end) { @@ -232,7 +232,7 @@ export const DominoOp = { message.output !== undefined && (obj.output = message.output); return obj; }, - fromPartial, I>>(object: I): DominoOp { + fromPartial(object: Partial): DominoOp { const message = createBaseDominoOp(); message.key = object.key ?? ""; message.input = object.input ?? ""; @@ -248,7 +248,7 @@ function createBaseProofOp(): ProofOp { }; } export const ProofOp = { - encode(message: ProofOp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== "") { writer.uint32(10).string(message.type); } @@ -260,8 +260,8 @@ export const ProofOp = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOp { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOp(); while (reader.pos < end) { @@ -299,7 +299,7 @@ export const ProofOp = { (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): ProofOp { + fromPartial(object: Partial): ProofOp { const message = createBaseProofOp(); message.type = object.type ?? ""; message.key = object.key ?? new Uint8Array(); @@ -313,14 +313,14 @@ function createBaseProofOps(): ProofOps { }; } export const ProofOps = { - encode(message: ProofOps, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.ops) { ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProofOps { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProofOps(); while (reader.pos < end) { @@ -350,7 +350,7 @@ export const ProofOps = { } return obj; }, - fromPartial, I>>(object: I): ProofOps { + fromPartial(object: Partial): ProofOps { const message = createBaseProofOps(); message.ops = object.ops?.map((e) => ProofOp.fromPartial(e)) || []; return message; diff --git a/src/tendermint/p2p/types.ts b/src/tendermint/p2p/types.ts index 66fb3ae..0bac04d 100644 --- a/src/tendermint/p2p/types.ts +++ b/src/tendermint/p2p/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export const protobufPackage = "tendermint.p2p"; export interface NetAddress { id: string; @@ -8,9 +8,9 @@ export interface NetAddress { port: number; } export interface ProtocolVersion { - p2p: Long; - block: Long; - app: Long; + p2p: bigint; + block: bigint; + app: bigint; } export interface DefaultNodeInfo { protocolVersion: ProtocolVersion; @@ -34,7 +34,7 @@ function createBaseNetAddress(): NetAddress { }; } export const NetAddress = { - encode(message: NetAddress, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: NetAddress, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.id !== "") { writer.uint32(10).string(message.id); } @@ -46,8 +46,8 @@ export const NetAddress = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): NetAddress { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): NetAddress { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseNetAddress(); while (reader.pos < end) { @@ -83,7 +83,7 @@ export const NetAddress = { message.port !== undefined && (obj.port = Math.round(message.port)); return obj; }, - fromPartial, I>>(object: I): NetAddress { + fromPartial(object: Partial): NetAddress { const message = createBaseNetAddress(); message.id = object.id ?? ""; message.ip = object.ip ?? ""; @@ -93,39 +93,39 @@ export const NetAddress = { }; function createBaseProtocolVersion(): ProtocolVersion { return { - p2p: Long.UZERO, - block: Long.UZERO, - app: Long.UZERO, + p2p: BigInt(0), + block: BigInt(0), + app: BigInt(0), }; } export const ProtocolVersion = { - encode(message: ProtocolVersion, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.p2p.isZero()) { + encode(message: ProtocolVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.p2p !== BigInt(0)) { writer.uint32(8).uint64(message.p2p); } - if (!message.block.isZero()) { + if (message.block !== BigInt(0)) { writer.uint32(16).uint64(message.block); } - if (!message.app.isZero()) { + if (message.app !== BigInt(0)) { writer.uint32(24).uint64(message.app); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ProtocolVersion { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ProtocolVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProtocolVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.p2p = reader.uint64() as Long; + message.p2p = reader.uint64(); break; case 2: - message.block = reader.uint64() as Long; + message.block = reader.uint64(); break; case 3: - message.app = reader.uint64() as Long; + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -136,28 +136,28 @@ export const ProtocolVersion = { }, fromJSON(object: any): ProtocolVersion { const obj = createBaseProtocolVersion(); - if (isSet(object.p2p)) obj.p2p = Long.fromValue(object.p2p); - if (isSet(object.block)) obj.block = Long.fromValue(object.block); - if (isSet(object.app)) obj.app = Long.fromValue(object.app); + if (isSet(object.p2p)) obj.p2p = BigInt(object.p2p.toString()); + if (isSet(object.block)) obj.block = BigInt(object.block.toString()); + if (isSet(object.app)) obj.app = BigInt(object.app.toString()); return obj; }, toJSON(message: ProtocolVersion): unknown { const obj: any = {}; - message.p2p !== undefined && (obj.p2p = (message.p2p || Long.UZERO).toString()); - message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + message.p2p !== undefined && (obj.p2p = (message.p2p || BigInt(0)).toString()); + message.block !== undefined && (obj.block = (message.block || BigInt(0)).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ProtocolVersion { + fromPartial(object: Partial): ProtocolVersion { const message = createBaseProtocolVersion(); if (object.p2p !== undefined && object.p2p !== null) { - message.p2p = Long.fromValue(object.p2p); + message.p2p = BigInt(object.p2p.toString()); } if (object.block !== undefined && object.block !== null) { - message.block = Long.fromValue(object.block); + message.block = BigInt(object.block.toString()); } if (object.app !== undefined && object.app !== null) { - message.app = Long.fromValue(object.app); + message.app = BigInt(object.app.toString()); } return message; }, @@ -175,7 +175,7 @@ function createBaseDefaultNodeInfo(): DefaultNodeInfo { }; } export const DefaultNodeInfo = { - encode(message: DefaultNodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DefaultNodeInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.protocolVersion !== undefined) { ProtocolVersion.encode(message.protocolVersion, writer.uint32(10).fork()).ldelim(); } @@ -202,8 +202,8 @@ export const DefaultNodeInfo = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDefaultNodeInfo(); while (reader.pos < end) { @@ -269,7 +269,7 @@ export const DefaultNodeInfo = { (obj.other = message.other ? DefaultNodeInfoOther.toJSON(message.other) : undefined); return obj; }, - fromPartial, I>>(object: I): DefaultNodeInfo { + fromPartial(object: Partial): DefaultNodeInfo { const message = createBaseDefaultNodeInfo(); if (object.protocolVersion !== undefined && object.protocolVersion !== null) { message.protocolVersion = ProtocolVersion.fromPartial(object.protocolVersion); @@ -293,7 +293,7 @@ function createBaseDefaultNodeInfoOther(): DefaultNodeInfoOther { }; } export const DefaultNodeInfoOther = { - encode(message: DefaultNodeInfoOther, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DefaultNodeInfoOther, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.txIndex !== "") { writer.uint32(10).string(message.txIndex); } @@ -302,8 +302,8 @@ export const DefaultNodeInfoOther = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DefaultNodeInfoOther { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DefaultNodeInfoOther { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDefaultNodeInfoOther(); while (reader.pos < end) { @@ -334,7 +334,7 @@ export const DefaultNodeInfoOther = { message.rpcAddress !== undefined && (obj.rpcAddress = message.rpcAddress); return obj; }, - fromPartial, I>>(object: I): DefaultNodeInfoOther { + fromPartial(object: Partial): DefaultNodeInfoOther { const message = createBaseDefaultNodeInfoOther(); message.txIndex = object.txIndex ?? ""; message.rpcAddress = object.rpcAddress ?? ""; diff --git a/src/tendermint/types/block.ts b/src/tendermint/types/block.ts index b7d5f1f..1c1c21d 100644 --- a/src/tendermint/types/block.ts +++ b/src/tendermint/types/block.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { Header, Data, Commit } from "./types"; import { EvidenceList } from "./evidence"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Exact } from "../../helpers"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; export const protobufPackage = "tendermint.types"; export interface Block { header: Header; @@ -19,7 +19,7 @@ function createBaseBlock(): Block { }; } export const Block = { - encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -34,8 +34,8 @@ export const Block = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Block { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Block { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlock(); while (reader.pos < end) { @@ -78,7 +78,7 @@ export const Block = { (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); return obj; }, - fromPartial, I>>(object: I): Block { + fromPartial(object: Partial): Block { const message = createBaseBlock(); if (object.header !== undefined && object.header !== null) { message.header = Header.fromPartial(object.header); diff --git a/src/tendermint/types/evidence.ts b/src/tendermint/types/evidence.ts index 0794135..729ab1d 100644 --- a/src/tendermint/types/evidence.ts +++ b/src/tendermint/types/evidence.ts @@ -2,8 +2,8 @@ import { Vote, LightBlock } from "./types"; import { Timestamp } from "../../google/protobuf/timestamp"; import { Validator } from "./validator"; -import { Long, isSet, DeepPartial, Exact, fromJsonTimestamp, fromTimestamp } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../helpers"; export const protobufPackage = "tendermint.types"; export interface Evidence { duplicateVoteEvidence?: DuplicateVoteEvidence; @@ -13,16 +13,16 @@ export interface Evidence { export interface DuplicateVoteEvidence { voteA: Vote; voteB: Vote; - totalVotingPower: Long; - validatorPower: Long; + totalVotingPower: bigint; + validatorPower: bigint; timestamp: Timestamp; } /** LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. */ export interface LightClientAttackEvidence { conflictingBlock: LightBlock; - commonHeight: Long; + commonHeight: bigint; byzantineValidators: Validator[]; - totalVotingPower: Long; + totalVotingPower: bigint; timestamp: Timestamp; } export interface EvidenceList { @@ -35,7 +35,7 @@ function createBaseEvidence(): Evidence { }; } export const Evidence = { - encode(message: Evidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.duplicateVoteEvidence !== undefined) { DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(10).fork()).ldelim(); } @@ -44,8 +44,8 @@ export const Evidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Evidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidence(); while (reader.pos < end) { @@ -84,7 +84,7 @@ export const Evidence = { : undefined); return obj; }, - fromPartial, I>>(object: I): Evidence { + fromPartial(object: Partial): Evidence { const message = createBaseEvidence(); if (object.duplicateVoteEvidence !== undefined && object.duplicateVoteEvidence !== null) { message.duplicateVoteEvidence = DuplicateVoteEvidence.fromPartial(object.duplicateVoteEvidence); @@ -101,23 +101,23 @@ function createBaseDuplicateVoteEvidence(): DuplicateVoteEvidence { return { voteA: Vote.fromPartial({}), voteB: Vote.fromPartial({}), - totalVotingPower: Long.ZERO, - validatorPower: Long.ZERO, + totalVotingPower: BigInt(0), + validatorPower: BigInt(0), timestamp: Timestamp.fromPartial({}), }; } export const DuplicateVoteEvidence = { - encode(message: DuplicateVoteEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: DuplicateVoteEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.voteA !== undefined) { Vote.encode(message.voteA, writer.uint32(10).fork()).ldelim(); } if (message.voteB !== undefined) { Vote.encode(message.voteB, writer.uint32(18).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(24).int64(message.totalVotingPower); } - if (!message.validatorPower.isZero()) { + if (message.validatorPower !== BigInt(0)) { writer.uint32(32).int64(message.validatorPower); } if (message.timestamp !== undefined) { @@ -125,8 +125,8 @@ export const DuplicateVoteEvidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): DuplicateVoteEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): DuplicateVoteEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseDuplicateVoteEvidence(); while (reader.pos < end) { @@ -139,10 +139,10 @@ export const DuplicateVoteEvidence = { message.voteB = Vote.decode(reader, reader.uint32()); break; case 3: - message.totalVotingPower = reader.int64() as Long; + message.totalVotingPower = reader.int64(); break; case 4: - message.validatorPower = reader.int64() as Long; + message.validatorPower = reader.int64(); break; case 5: message.timestamp = Timestamp.decode(reader, reader.uint32()); @@ -158,8 +158,8 @@ export const DuplicateVoteEvidence = { const obj = createBaseDuplicateVoteEvidence(); if (isSet(object.voteA)) obj.voteA = Vote.fromJSON(object.voteA); if (isSet(object.voteB)) obj.voteB = Vote.fromJSON(object.voteB); - if (isSet(object.totalVotingPower)) obj.totalVotingPower = Long.fromValue(object.totalVotingPower); - if (isSet(object.validatorPower)) obj.validatorPower = Long.fromValue(object.validatorPower); + if (isSet(object.totalVotingPower)) obj.totalVotingPower = BigInt(object.totalVotingPower.toString()); + if (isSet(object.validatorPower)) obj.validatorPower = BigInt(object.validatorPower.toString()); if (isSet(object.timestamp)) obj.timestamp = fromJsonTimestamp(object.timestamp); return obj; }, @@ -168,13 +168,13 @@ export const DuplicateVoteEvidence = { message.voteA !== undefined && (obj.voteA = message.voteA ? Vote.toJSON(message.voteA) : undefined); message.voteB !== undefined && (obj.voteB = message.voteB ? Vote.toJSON(message.voteB) : undefined); message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); message.validatorPower !== undefined && - (obj.validatorPower = (message.validatorPower || Long.ZERO).toString()); + (obj.validatorPower = (message.validatorPower || BigInt(0)).toString()); message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); return obj; }, - fromPartial, I>>(object: I): DuplicateVoteEvidence { + fromPartial(object: Partial): DuplicateVoteEvidence { const message = createBaseDuplicateVoteEvidence(); if (object.voteA !== undefined && object.voteA !== null) { message.voteA = Vote.fromPartial(object.voteA); @@ -183,10 +183,10 @@ export const DuplicateVoteEvidence = { message.voteB = Vote.fromPartial(object.voteB); } if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { - message.totalVotingPower = Long.fromValue(object.totalVotingPower); + message.totalVotingPower = BigInt(object.totalVotingPower.toString()); } if (object.validatorPower !== undefined && object.validatorPower !== null) { - message.validatorPower = Long.fromValue(object.validatorPower); + message.validatorPower = BigInt(object.validatorPower.toString()); } if (object.timestamp !== undefined && object.timestamp !== null) { message.timestamp = Timestamp.fromPartial(object.timestamp); @@ -197,24 +197,24 @@ export const DuplicateVoteEvidence = { function createBaseLightClientAttackEvidence(): LightClientAttackEvidence { return { conflictingBlock: LightBlock.fromPartial({}), - commonHeight: Long.ZERO, + commonHeight: BigInt(0), byzantineValidators: [], - totalVotingPower: Long.ZERO, + totalVotingPower: BigInt(0), timestamp: Timestamp.fromPartial({}), }; } export const LightClientAttackEvidence = { - encode(message: LightClientAttackEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: LightClientAttackEvidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.conflictingBlock !== undefined) { LightBlock.encode(message.conflictingBlock, writer.uint32(10).fork()).ldelim(); } - if (!message.commonHeight.isZero()) { + if (message.commonHeight !== BigInt(0)) { writer.uint32(16).int64(message.commonHeight); } for (const v of message.byzantineValidators) { Validator.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(32).int64(message.totalVotingPower); } if (message.timestamp !== undefined) { @@ -222,8 +222,8 @@ export const LightClientAttackEvidence = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LightClientAttackEvidence { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LightClientAttackEvidence { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLightClientAttackEvidence(); while (reader.pos < end) { @@ -233,13 +233,13 @@ export const LightClientAttackEvidence = { message.conflictingBlock = LightBlock.decode(reader, reader.uint32()); break; case 2: - message.commonHeight = reader.int64() as Long; + message.commonHeight = reader.int64(); break; case 3: message.byzantineValidators.push(Validator.decode(reader, reader.uint32())); break; case 4: - message.totalVotingPower = reader.int64() as Long; + message.totalVotingPower = reader.int64(); break; case 5: message.timestamp = Timestamp.decode(reader, reader.uint32()); @@ -254,10 +254,10 @@ export const LightClientAttackEvidence = { fromJSON(object: any): LightClientAttackEvidence { const obj = createBaseLightClientAttackEvidence(); if (isSet(object.conflictingBlock)) obj.conflictingBlock = LightBlock.fromJSON(object.conflictingBlock); - if (isSet(object.commonHeight)) obj.commonHeight = Long.fromValue(object.commonHeight); + if (isSet(object.commonHeight)) obj.commonHeight = BigInt(object.commonHeight.toString()); if (Array.isArray(object?.byzantineValidators)) obj.byzantineValidators = object.byzantineValidators.map((e: any) => Validator.fromJSON(e)); - if (isSet(object.totalVotingPower)) obj.totalVotingPower = Long.fromValue(object.totalVotingPower); + if (isSet(object.totalVotingPower)) obj.totalVotingPower = BigInt(object.totalVotingPower.toString()); if (isSet(object.timestamp)) obj.timestamp = fromJsonTimestamp(object.timestamp); return obj; }, @@ -267,30 +267,28 @@ export const LightClientAttackEvidence = { (obj.conflictingBlock = message.conflictingBlock ? LightBlock.toJSON(message.conflictingBlock) : undefined); - message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || Long.ZERO).toString()); + message.commonHeight !== undefined && (obj.commonHeight = (message.commonHeight || BigInt(0)).toString()); if (message.byzantineValidators) { obj.byzantineValidators = message.byzantineValidators.map((e) => (e ? Validator.toJSON(e) : undefined)); } else { obj.byzantineValidators = []; } message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); message.timestamp !== undefined && (obj.timestamp = fromTimestamp(message.timestamp).toISOString()); return obj; }, - fromPartial, I>>( - object: I, - ): LightClientAttackEvidence { + fromPartial(object: Partial): LightClientAttackEvidence { const message = createBaseLightClientAttackEvidence(); if (object.conflictingBlock !== undefined && object.conflictingBlock !== null) { message.conflictingBlock = LightBlock.fromPartial(object.conflictingBlock); } if (object.commonHeight !== undefined && object.commonHeight !== null) { - message.commonHeight = Long.fromValue(object.commonHeight); + message.commonHeight = BigInt(object.commonHeight.toString()); } message.byzantineValidators = object.byzantineValidators?.map((e) => Validator.fromPartial(e)) || []; if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { - message.totalVotingPower = Long.fromValue(object.totalVotingPower); + message.totalVotingPower = BigInt(object.totalVotingPower.toString()); } if (object.timestamp !== undefined && object.timestamp !== null) { message.timestamp = Timestamp.fromPartial(object.timestamp); @@ -304,14 +302,14 @@ function createBaseEvidenceList(): EvidenceList { }; } export const EvidenceList = { - encode(message: EvidenceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: EvidenceList, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.evidence) { Evidence.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceList { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidenceList(); while (reader.pos < end) { @@ -341,7 +339,7 @@ export const EvidenceList = { } return obj; }, - fromPartial, I>>(object: I): EvidenceList { + fromPartial(object: Partial): EvidenceList { const message = createBaseEvidenceList(); message.evidence = object.evidence?.map((e) => Evidence.fromPartial(e)) || []; return message; diff --git a/src/tendermint/types/params.ts b/src/tendermint/types/params.ts index 55b2b2f..09773ce 100644 --- a/src/tendermint/types/params.ts +++ b/src/tendermint/types/params.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import { Duration } from "../../google/protobuf/duration"; -import { Long, isSet, DeepPartial, Exact } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; export const protobufPackage = "tendermint.types"; /** * ConsensusParams contains consensus critical parameters that determine the @@ -19,12 +19,12 @@ export interface BlockParams { * Max block size, in bytes. * Note: must be greater than 0 */ - maxBytes: Long; + maxBytes: bigint; /** * Max gas per block. * Note: must be greater or equal to -1 */ - maxGas: Long; + maxGas: bigint; } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { @@ -34,7 +34,7 @@ export interface EvidenceParams { * The basic formula for calculating this is: MaxAgeDuration / {average block * time}. */ - maxAgeNumBlocks: Long; + maxAgeNumBlocks: bigint; /** * Max age of evidence, in time. * @@ -48,7 +48,7 @@ export interface EvidenceParams { * and should fall comfortably under the max block bytes. * Default is 1048576 or 1MB */ - maxBytes: Long; + maxBytes: bigint; } /** * ValidatorParams restrict the public key types validators can use. @@ -59,7 +59,7 @@ export interface ValidatorParams { } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - app: Long; + app: bigint; } /** * HashedParams is a subset of ConsensusParams. @@ -67,8 +67,8 @@ export interface VersionParams { * It is hashed into the Header.ConsensusHash. */ export interface HashedParams { - blockMaxBytes: Long; - blockMaxGas: Long; + blockMaxBytes: bigint; + blockMaxGas: bigint; } function createBaseConsensusParams(): ConsensusParams { return { @@ -79,7 +79,7 @@ function createBaseConsensusParams(): ConsensusParams { }; } export const ConsensusParams = { - encode(message: ConsensusParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.block !== undefined) { BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); } @@ -94,8 +94,8 @@ export const ConsensusParams = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ConsensusParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensusParams(); while (reader.pos < end) { @@ -140,7 +140,7 @@ export const ConsensusParams = { (obj.version = message.version ? VersionParams.toJSON(message.version) : undefined); return obj; }, - fromPartial, I>>(object: I): ConsensusParams { + fromPartial(object: Partial): ConsensusParams { const message = createBaseConsensusParams(); if (object.block !== undefined && object.block !== null) { message.block = BlockParams.fromPartial(object.block); @@ -159,32 +159,32 @@ export const ConsensusParams = { }; function createBaseBlockParams(): BlockParams { return { - maxBytes: Long.ZERO, - maxGas: Long.ZERO, + maxBytes: BigInt(0), + maxGas: BigInt(0), }; } export const BlockParams = { - encode(message: BlockParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxBytes.isZero()) { + encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxBytes !== BigInt(0)) { writer.uint32(8).int64(message.maxBytes); } - if (!message.maxGas.isZero()) { + if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64() as Long; + message.maxBytes = reader.int64(); break; case 2: - message.maxGas = reader.int64() as Long; + message.maxGas = reader.int64(); break; default: reader.skipType(tag & 7); @@ -195,62 +195,62 @@ export const BlockParams = { }, fromJSON(object: any): BlockParams { const obj = createBaseBlockParams(); - if (isSet(object.maxBytes)) obj.maxBytes = Long.fromValue(object.maxBytes); - if (isSet(object.maxGas)) obj.maxGas = Long.fromValue(object.maxGas); + if (isSet(object.maxBytes)) obj.maxBytes = BigInt(object.maxBytes.toString()); + if (isSet(object.maxGas)) obj.maxGas = BigInt(object.maxGas.toString()); return obj; }, toJSON(message: BlockParams): unknown { const obj: any = {}; - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); - message.maxGas !== undefined && (obj.maxGas = (message.maxGas || Long.ZERO).toString()); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || BigInt(0)).toString()); + message.maxGas !== undefined && (obj.maxGas = (message.maxGas || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): BlockParams { + fromPartial(object: Partial): BlockParams { const message = createBaseBlockParams(); if (object.maxBytes !== undefined && object.maxBytes !== null) { - message.maxBytes = Long.fromValue(object.maxBytes); + message.maxBytes = BigInt(object.maxBytes.toString()); } if (object.maxGas !== undefined && object.maxGas !== null) { - message.maxGas = Long.fromValue(object.maxGas); + message.maxGas = BigInt(object.maxGas.toString()); } return message; }, }; function createBaseEvidenceParams(): EvidenceParams { return { - maxAgeNumBlocks: Long.ZERO, + maxAgeNumBlocks: BigInt(0), maxAgeDuration: Duration.fromPartial({}), - maxBytes: Long.ZERO, + maxBytes: BigInt(0), }; } export const EvidenceParams = { - encode(message: EvidenceParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.maxAgeNumBlocks.isZero()) { + encode(message: EvidenceParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxAgeNumBlocks !== BigInt(0)) { writer.uint32(8).int64(message.maxAgeNumBlocks); } if (message.maxAgeDuration !== undefined) { Duration.encode(message.maxAgeDuration, writer.uint32(18).fork()).ldelim(); } - if (!message.maxBytes.isZero()) { + if (message.maxBytes !== BigInt(0)) { writer.uint32(24).int64(message.maxBytes); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): EvidenceParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): EvidenceParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEvidenceParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxAgeNumBlocks = reader.int64() as Long; + message.maxAgeNumBlocks = reader.int64(); break; case 2: message.maxAgeDuration = Duration.decode(reader, reader.uint32()); break; case 3: - message.maxBytes = reader.int64() as Long; + message.maxBytes = reader.int64(); break; default: reader.skipType(tag & 7); @@ -261,30 +261,30 @@ export const EvidenceParams = { }, fromJSON(object: any): EvidenceParams { const obj = createBaseEvidenceParams(); - if (isSet(object.maxAgeNumBlocks)) obj.maxAgeNumBlocks = Long.fromValue(object.maxAgeNumBlocks); + if (isSet(object.maxAgeNumBlocks)) obj.maxAgeNumBlocks = BigInt(object.maxAgeNumBlocks.toString()); if (isSet(object.maxAgeDuration)) obj.maxAgeDuration = Duration.fromJSON(object.maxAgeDuration); - if (isSet(object.maxBytes)) obj.maxBytes = Long.fromValue(object.maxBytes); + if (isSet(object.maxBytes)) obj.maxBytes = BigInt(object.maxBytes.toString()); return obj; }, toJSON(message: EvidenceParams): unknown { const obj: any = {}; message.maxAgeNumBlocks !== undefined && - (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || Long.ZERO).toString()); + (obj.maxAgeNumBlocks = (message.maxAgeNumBlocks || BigInt(0)).toString()); message.maxAgeDuration !== undefined && (obj.maxAgeDuration = message.maxAgeDuration ? Duration.toJSON(message.maxAgeDuration) : undefined); - message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || Long.ZERO).toString()); + message.maxBytes !== undefined && (obj.maxBytes = (message.maxBytes || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): EvidenceParams { + fromPartial(object: Partial): EvidenceParams { const message = createBaseEvidenceParams(); if (object.maxAgeNumBlocks !== undefined && object.maxAgeNumBlocks !== null) { - message.maxAgeNumBlocks = Long.fromValue(object.maxAgeNumBlocks); + message.maxAgeNumBlocks = BigInt(object.maxAgeNumBlocks.toString()); } if (object.maxAgeDuration !== undefined && object.maxAgeDuration !== null) { message.maxAgeDuration = Duration.fromPartial(object.maxAgeDuration); } if (object.maxBytes !== undefined && object.maxBytes !== null) { - message.maxBytes = Long.fromValue(object.maxBytes); + message.maxBytes = BigInt(object.maxBytes.toString()); } return message; }, @@ -295,14 +295,14 @@ function createBaseValidatorParams(): ValidatorParams { }; } export const ValidatorParams = { - encode(message: ValidatorParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.pubKeyTypes) { writer.uint32(10).string(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorParams(); while (reader.pos < end) { @@ -332,7 +332,7 @@ export const ValidatorParams = { } return obj; }, - fromPartial, I>>(object: I): ValidatorParams { + fromPartial(object: Partial): ValidatorParams { const message = createBaseValidatorParams(); message.pubKeyTypes = object.pubKeyTypes?.map((e) => e) || []; return message; @@ -340,25 +340,25 @@ export const ValidatorParams = { }; function createBaseVersionParams(): VersionParams { return { - app: Long.UZERO, + app: BigInt(0), }; } export const VersionParams = { - encode(message: VersionParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.app.isZero()) { + encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.app !== BigInt(0)) { writer.uint32(8).uint64(message.app); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): VersionParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): VersionParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVersionParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.app = reader.uint64() as Long; + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -369,50 +369,50 @@ export const VersionParams = { }, fromJSON(object: any): VersionParams { const obj = createBaseVersionParams(); - if (isSet(object.app)) obj.app = Long.fromValue(object.app); + if (isSet(object.app)) obj.app = BigInt(object.app.toString()); return obj; }, toJSON(message: VersionParams): unknown { const obj: any = {}; - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): VersionParams { + fromPartial(object: Partial): VersionParams { const message = createBaseVersionParams(); if (object.app !== undefined && object.app !== null) { - message.app = Long.fromValue(object.app); + message.app = BigInt(object.app.toString()); } return message; }, }; function createBaseHashedParams(): HashedParams { return { - blockMaxBytes: Long.ZERO, - blockMaxGas: Long.ZERO, + blockMaxBytes: BigInt(0), + blockMaxGas: BigInt(0), }; } export const HashedParams = { - encode(message: HashedParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.blockMaxBytes.isZero()) { + encode(message: HashedParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockMaxBytes !== BigInt(0)) { writer.uint32(8).int64(message.blockMaxBytes); } - if (!message.blockMaxGas.isZero()) { + if (message.blockMaxGas !== BigInt(0)) { writer.uint32(16).int64(message.blockMaxGas); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): HashedParams { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): HashedParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHashedParams(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blockMaxBytes = reader.int64() as Long; + message.blockMaxBytes = reader.int64(); break; case 2: - message.blockMaxGas = reader.int64() as Long; + message.blockMaxGas = reader.int64(); break; default: reader.skipType(tag & 7); @@ -423,24 +423,24 @@ export const HashedParams = { }, fromJSON(object: any): HashedParams { const obj = createBaseHashedParams(); - if (isSet(object.blockMaxBytes)) obj.blockMaxBytes = Long.fromValue(object.blockMaxBytes); - if (isSet(object.blockMaxGas)) obj.blockMaxGas = Long.fromValue(object.blockMaxGas); + if (isSet(object.blockMaxBytes)) obj.blockMaxBytes = BigInt(object.blockMaxBytes.toString()); + if (isSet(object.blockMaxGas)) obj.blockMaxGas = BigInt(object.blockMaxGas.toString()); return obj; }, toJSON(message: HashedParams): unknown { const obj: any = {}; message.blockMaxBytes !== undefined && - (obj.blockMaxBytes = (message.blockMaxBytes || Long.ZERO).toString()); - message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || Long.ZERO).toString()); + (obj.blockMaxBytes = (message.blockMaxBytes || BigInt(0)).toString()); + message.blockMaxGas !== undefined && (obj.blockMaxGas = (message.blockMaxGas || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): HashedParams { + fromPartial(object: Partial): HashedParams { const message = createBaseHashedParams(); if (object.blockMaxBytes !== undefined && object.blockMaxBytes !== null) { - message.blockMaxBytes = Long.fromValue(object.blockMaxBytes); + message.blockMaxBytes = BigInt(object.blockMaxBytes.toString()); } if (object.blockMaxGas !== undefined && object.blockMaxGas !== null) { - message.blockMaxGas = Long.fromValue(object.blockMaxGas); + message.blockMaxGas = BigInt(object.blockMaxGas.toString()); } return message; }, diff --git a/src/tendermint/types/types.ts b/src/tendermint/types/types.ts index 27bc9af..9a18316 100644 --- a/src/tendermint/types/types.ts +++ b/src/tendermint/types/types.ts @@ -3,17 +3,8 @@ import { Proof } from "../crypto/proof"; import { Consensus } from "../version/types"; import { Timestamp } from "../../google/protobuf/timestamp"; import { ValidatorSet } from "./validator"; -import { - Long, - isSet, - bytesFromBase64, - base64FromBytes, - DeepPartial, - Exact, - fromJsonTimestamp, - fromTimestamp, -} from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes, fromJsonTimestamp, fromTimestamp } from "../../helpers"; export const protobufPackage = "tendermint.types"; /** BlockIdFlag indicates which BlcokID the signature is for */ export enum BlockIDFlag { @@ -123,7 +114,7 @@ export interface Header { /** basic block info */ version: Consensus; chainId: string; - height: Long; + height: bigint; time: Timestamp; /** prev block info */ lastBlockId: BlockID; @@ -159,7 +150,7 @@ export interface Data { */ export interface Vote { type: SignedMsgType; - height: Long; + height: bigint; round: number; /** zero if vote is nil. */ blockId: BlockID; @@ -170,7 +161,7 @@ export interface Vote { } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface Commit { - height: Long; + height: bigint; round: number; blockId: BlockID; signatures: CommitSig[]; @@ -184,7 +175,7 @@ export interface CommitSig { } export interface Proposal { type: SignedMsgType; - height: Long; + height: bigint; round: number; polRound: number; blockId: BlockID; @@ -201,9 +192,9 @@ export interface LightBlock { } export interface BlockMeta { blockId: BlockID; - blockSize: Long; + blockSize: bigint; header: Header; - numTxs: Long; + numTxs: bigint; } /** TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. */ export interface TxProof { @@ -218,7 +209,7 @@ function createBasePartSetHeader(): PartSetHeader { }; } export const PartSetHeader = { - encode(message: PartSetHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: PartSetHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.total !== 0) { writer.uint32(8).uint32(message.total); } @@ -227,8 +218,8 @@ export const PartSetHeader = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): PartSetHeader { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): PartSetHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePartSetHeader(); while (reader.pos < end) { @@ -260,7 +251,7 @@ export const PartSetHeader = { (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); return obj; }, - fromPartial, I>>(object: I): PartSetHeader { + fromPartial(object: Partial): PartSetHeader { const message = createBasePartSetHeader(); message.total = object.total ?? 0; message.hash = object.hash ?? new Uint8Array(); @@ -275,7 +266,7 @@ function createBasePart(): Part { }; } export const Part = { - encode(message: Part, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Part, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.index !== 0) { writer.uint32(8).uint32(message.index); } @@ -287,8 +278,8 @@ export const Part = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Part { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Part { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBasePart(); while (reader.pos < end) { @@ -325,7 +316,7 @@ export const Part = { message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial, I>>(object: I): Part { + fromPartial(object: Partial): Part { const message = createBasePart(); message.index = object.index ?? 0; message.bytes = object.bytes ?? new Uint8Array(); @@ -342,7 +333,7 @@ function createBaseBlockID(): BlockID { }; } export const BlockID = { - encode(message: BlockID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BlockID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.hash.length !== 0) { writer.uint32(10).bytes(message.hash); } @@ -351,8 +342,8 @@ export const BlockID = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockID { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockID(); while (reader.pos < end) { @@ -385,7 +376,7 @@ export const BlockID = { (obj.partSetHeader = message.partSetHeader ? PartSetHeader.toJSON(message.partSetHeader) : undefined); return obj; }, - fromPartial, I>>(object: I): BlockID { + fromPartial(object: Partial): BlockID { const message = createBaseBlockID(); message.hash = object.hash ?? new Uint8Array(); if (object.partSetHeader !== undefined && object.partSetHeader !== null) { @@ -398,7 +389,7 @@ function createBaseHeader(): Header { return { version: Consensus.fromPartial({}), chainId: "", - height: Long.ZERO, + height: BigInt(0), time: Timestamp.fromPartial({}), lastBlockId: BlockID.fromPartial({}), lastCommitHash: new Uint8Array(), @@ -413,14 +404,14 @@ function createBaseHeader(): Header { }; } export const Header = { - encode(message: Header, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.version !== undefined) { Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); } if (message.chainId !== "") { writer.uint32(18).string(message.chainId); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(24).int64(message.height); } if (message.time !== undefined) { @@ -458,8 +449,8 @@ export const Header = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Header { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHeader(); while (reader.pos < end) { @@ -472,7 +463,7 @@ export const Header = { message.chainId = reader.string(); break; case 3: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 4: message.time = Timestamp.decode(reader, reader.uint32()); @@ -518,7 +509,7 @@ export const Header = { const obj = createBaseHeader(); if (isSet(object.version)) obj.version = Consensus.fromJSON(object.version); if (isSet(object.chainId)) obj.chainId = String(object.chainId); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.time)) obj.time = fromJsonTimestamp(object.time); if (isSet(object.lastBlockId)) obj.lastBlockId = BlockID.fromJSON(object.lastBlockId); if (isSet(object.lastCommitHash)) obj.lastCommitHash = bytesFromBase64(object.lastCommitHash); @@ -537,7 +528,7 @@ export const Header = { message.version !== undefined && (obj.version = message.version ? Consensus.toJSON(message.version) : undefined); message.chainId !== undefined && (obj.chainId = message.chainId); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); message.lastBlockId !== undefined && (obj.lastBlockId = message.lastBlockId ? BlockID.toJSON(message.lastBlockId) : undefined); @@ -575,14 +566,14 @@ export const Header = { )); return obj; }, - fromPartial, I>>(object: I): Header { + fromPartial(object: Partial
): Header { const message = createBaseHeader(); if (object.version !== undefined && object.version !== null) { message.version = Consensus.fromPartial(object.version); } message.chainId = object.chainId ?? ""; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } if (object.time !== undefined && object.time !== null) { message.time = Timestamp.fromPartial(object.time); @@ -608,14 +599,14 @@ function createBaseData(): Data { }; } export const Data = { - encode(message: Data, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Data, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.txs) { writer.uint32(10).bytes(v!); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Data { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Data { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseData(); while (reader.pos < end) { @@ -645,7 +636,7 @@ export const Data = { } return obj; }, - fromPartial, I>>(object: I): Data { + fromPartial(object: Partial): Data { const message = createBaseData(); message.txs = object.txs?.map((e) => e) || []; return message; @@ -654,7 +645,7 @@ export const Data = { function createBaseVote(): Vote { return { type: 0, - height: Long.ZERO, + height: BigInt(0), round: 0, blockId: BlockID.fromPartial({}), timestamp: Timestamp.fromPartial({}), @@ -664,11 +655,11 @@ function createBaseVote(): Vote { }; } export const Vote = { - encode(message: Vote, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(16).int64(message.height); } if (message.round !== 0) { @@ -691,8 +682,8 @@ export const Vote = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Vote { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseVote(); while (reader.pos < end) { @@ -702,7 +693,7 @@ export const Vote = { message.type = reader.int32() as any; break; case 2: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 3: message.round = reader.int32(); @@ -732,7 +723,7 @@ export const Vote = { fromJSON(object: any): Vote { const obj = createBaseVote(); if (isSet(object.type)) obj.type = signedMsgTypeFromJSON(object.type); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.round)) obj.round = Number(object.round); if (isSet(object.blockId)) obj.blockId = BlockID.fromJSON(object.blockId); if (isSet(object.timestamp)) obj.timestamp = fromJsonTimestamp(object.timestamp); @@ -744,7 +735,7 @@ export const Vote = { toJSON(message: Vote): unknown { const obj: any = {}; message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.round !== undefined && (obj.round = Math.round(message.round)); message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); @@ -760,11 +751,11 @@ export const Vote = { )); return obj; }, - fromPartial, I>>(object: I): Vote { + fromPartial(object: Partial): Vote { const message = createBaseVote(); message.type = object.type ?? 0; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.round = object.round ?? 0; if (object.blockId !== undefined && object.blockId !== null) { @@ -781,15 +772,15 @@ export const Vote = { }; function createBaseCommit(): Commit { return { - height: Long.ZERO, + height: BigInt(0), round: 0, blockId: BlockID.fromPartial({}), signatures: [], }; } export const Commit = { - encode(message: Commit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.height.isZero()) { + encode(message: Commit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { writer.uint32(8).int64(message.height); } if (message.round !== 0) { @@ -803,15 +794,15 @@ export const Commit = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Commit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Commit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommit(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 2: message.round = reader.int32(); @@ -831,7 +822,7 @@ export const Commit = { }, fromJSON(object: any): Commit { const obj = createBaseCommit(); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.round)) obj.round = Number(object.round); if (isSet(object.blockId)) obj.blockId = BlockID.fromJSON(object.blockId); if (Array.isArray(object?.signatures)) @@ -840,7 +831,7 @@ export const Commit = { }, toJSON(message: Commit): unknown { const obj: any = {}; - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.round !== undefined && (obj.round = Math.round(message.round)); message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); @@ -851,10 +842,10 @@ export const Commit = { } return obj; }, - fromPartial, I>>(object: I): Commit { + fromPartial(object: Partial): Commit { const message = createBaseCommit(); if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.round = object.round ?? 0; if (object.blockId !== undefined && object.blockId !== null) { @@ -873,7 +864,7 @@ function createBaseCommitSig(): CommitSig { }; } export const CommitSig = { - encode(message: CommitSig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: CommitSig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockIdFlag !== 0) { writer.uint32(8).int32(message.blockIdFlag); } @@ -888,8 +879,8 @@ export const CommitSig = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): CommitSig { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): CommitSig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommitSig(); while (reader.pos < end) { @@ -936,7 +927,7 @@ export const CommitSig = { )); return obj; }, - fromPartial, I>>(object: I): CommitSig { + fromPartial(object: Partial): CommitSig { const message = createBaseCommitSig(); message.blockIdFlag = object.blockIdFlag ?? 0; message.validatorAddress = object.validatorAddress ?? new Uint8Array(); @@ -950,7 +941,7 @@ export const CommitSig = { function createBaseProposal(): Proposal { return { type: 0, - height: Long.ZERO, + height: BigInt(0), round: 0, polRound: 0, blockId: BlockID.fromPartial({}), @@ -959,11 +950,11 @@ function createBaseProposal(): Proposal { }; } export const Proposal = { - encode(message: Proposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } - if (!message.height.isZero()) { + if (message.height !== BigInt(0)) { writer.uint32(16).int64(message.height); } if (message.round !== 0) { @@ -983,8 +974,8 @@ export const Proposal = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Proposal { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseProposal(); while (reader.pos < end) { @@ -994,7 +985,7 @@ export const Proposal = { message.type = reader.int32() as any; break; case 2: - message.height = reader.int64() as Long; + message.height = reader.int64(); break; case 3: message.round = reader.int32(); @@ -1021,7 +1012,7 @@ export const Proposal = { fromJSON(object: any): Proposal { const obj = createBaseProposal(); if (isSet(object.type)) obj.type = signedMsgTypeFromJSON(object.type); - if (isSet(object.height)) obj.height = Long.fromValue(object.height); + if (isSet(object.height)) obj.height = BigInt(object.height.toString()); if (isSet(object.round)) obj.round = Number(object.round); if (isSet(object.polRound)) obj.polRound = Number(object.polRound); if (isSet(object.blockId)) obj.blockId = BlockID.fromJSON(object.blockId); @@ -1032,7 +1023,7 @@ export const Proposal = { toJSON(message: Proposal): unknown { const obj: any = {}; message.type !== undefined && (obj.type = signedMsgTypeToJSON(message.type)); - message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.round !== undefined && (obj.round = Math.round(message.round)); message.polRound !== undefined && (obj.polRound = Math.round(message.polRound)); message.blockId !== undefined && @@ -1044,11 +1035,11 @@ export const Proposal = { )); return obj; }, - fromPartial, I>>(object: I): Proposal { + fromPartial(object: Partial): Proposal { const message = createBaseProposal(); message.type = object.type ?? 0; if (object.height !== undefined && object.height !== null) { - message.height = Long.fromValue(object.height); + message.height = BigInt(object.height.toString()); } message.round = object.round ?? 0; message.polRound = object.polRound ?? 0; @@ -1069,7 +1060,7 @@ function createBaseSignedHeader(): SignedHeader { }; } export const SignedHeader = { - encode(message: SignedHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SignedHeader, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.header !== undefined) { Header.encode(message.header, writer.uint32(10).fork()).ldelim(); } @@ -1078,8 +1069,8 @@ export const SignedHeader = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SignedHeader { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SignedHeader { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSignedHeader(); while (reader.pos < end) { @@ -1110,7 +1101,7 @@ export const SignedHeader = { message.commit !== undefined && (obj.commit = message.commit ? Commit.toJSON(message.commit) : undefined); return obj; }, - fromPartial, I>>(object: I): SignedHeader { + fromPartial(object: Partial): SignedHeader { const message = createBaseSignedHeader(); if (object.header !== undefined && object.header !== null) { message.header = Header.fromPartial(object.header); @@ -1128,7 +1119,7 @@ function createBaseLightBlock(): LightBlock { }; } export const LightBlock = { - encode(message: LightBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: LightBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.signedHeader !== undefined) { SignedHeader.encode(message.signedHeader, writer.uint32(10).fork()).ldelim(); } @@ -1137,8 +1128,8 @@ export const LightBlock = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): LightBlock { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): LightBlock { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseLightBlock(); while (reader.pos < end) { @@ -1171,7 +1162,7 @@ export const LightBlock = { (obj.validatorSet = message.validatorSet ? ValidatorSet.toJSON(message.validatorSet) : undefined); return obj; }, - fromPartial, I>>(object: I): LightBlock { + fromPartial(object: Partial): LightBlock { const message = createBaseLightBlock(); if (object.signedHeader !== undefined && object.signedHeader !== null) { message.signedHeader = SignedHeader.fromPartial(object.signedHeader); @@ -1185,29 +1176,29 @@ export const LightBlock = { function createBaseBlockMeta(): BlockMeta { return { blockId: BlockID.fromPartial({}), - blockSize: Long.ZERO, + blockSize: BigInt(0), header: Header.fromPartial({}), - numTxs: Long.ZERO, + numTxs: BigInt(0), }; } export const BlockMeta = { - encode(message: BlockMeta, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: BlockMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.blockId !== undefined) { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } - if (!message.blockSize.isZero()) { + if (message.blockSize !== BigInt(0)) { writer.uint32(16).int64(message.blockSize); } if (message.header !== undefined) { Header.encode(message.header, writer.uint32(26).fork()).ldelim(); } - if (!message.numTxs.isZero()) { + if (message.numTxs !== BigInt(0)) { writer.uint32(32).int64(message.numTxs); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): BlockMeta { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): BlockMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseBlockMeta(); while (reader.pos < end) { @@ -1217,13 +1208,13 @@ export const BlockMeta = { message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.blockSize = reader.int64() as Long; + message.blockSize = reader.int64(); break; case 3: message.header = Header.decode(reader, reader.uint32()); break; case 4: - message.numTxs = reader.int64() as Long; + message.numTxs = reader.int64(); break; default: reader.skipType(tag & 7); @@ -1235,33 +1226,33 @@ export const BlockMeta = { fromJSON(object: any): BlockMeta { const obj = createBaseBlockMeta(); if (isSet(object.blockId)) obj.blockId = BlockID.fromJSON(object.blockId); - if (isSet(object.blockSize)) obj.blockSize = Long.fromValue(object.blockSize); + if (isSet(object.blockSize)) obj.blockSize = BigInt(object.blockSize.toString()); if (isSet(object.header)) obj.header = Header.fromJSON(object.header); - if (isSet(object.numTxs)) obj.numTxs = Long.fromValue(object.numTxs); + if (isSet(object.numTxs)) obj.numTxs = BigInt(object.numTxs.toString()); return obj; }, toJSON(message: BlockMeta): unknown { const obj: any = {}; message.blockId !== undefined && (obj.blockId = message.blockId ? BlockID.toJSON(message.blockId) : undefined); - message.blockSize !== undefined && (obj.blockSize = (message.blockSize || Long.ZERO).toString()); + message.blockSize !== undefined && (obj.blockSize = (message.blockSize || BigInt(0)).toString()); message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); - message.numTxs !== undefined && (obj.numTxs = (message.numTxs || Long.ZERO).toString()); + message.numTxs !== undefined && (obj.numTxs = (message.numTxs || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): BlockMeta { + fromPartial(object: Partial): BlockMeta { const message = createBaseBlockMeta(); if (object.blockId !== undefined && object.blockId !== null) { message.blockId = BlockID.fromPartial(object.blockId); } if (object.blockSize !== undefined && object.blockSize !== null) { - message.blockSize = Long.fromValue(object.blockSize); + message.blockSize = BigInt(object.blockSize.toString()); } if (object.header !== undefined && object.header !== null) { message.header = Header.fromPartial(object.header); } if (object.numTxs !== undefined && object.numTxs !== null) { - message.numTxs = Long.fromValue(object.numTxs); + message.numTxs = BigInt(object.numTxs.toString()); } return message; }, @@ -1274,7 +1265,7 @@ function createBaseTxProof(): TxProof { }; } export const TxProof = { - encode(message: TxProof, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: TxProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.rootHash.length !== 0) { writer.uint32(10).bytes(message.rootHash); } @@ -1286,8 +1277,8 @@ export const TxProof = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): TxProof { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): TxProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTxProof(); while (reader.pos < end) { @@ -1325,7 +1316,7 @@ export const TxProof = { message.proof !== undefined && (obj.proof = message.proof ? Proof.toJSON(message.proof) : undefined); return obj; }, - fromPartial, I>>(object: I): TxProof { + fromPartial(object: Partial): TxProof { const message = createBaseTxProof(); message.rootHash = object.rootHash ?? new Uint8Array(); message.data = object.data ?? new Uint8Array(); diff --git a/src/tendermint/types/validator.ts b/src/tendermint/types/validator.ts index a799d37..d2db0f9 100644 --- a/src/tendermint/types/validator.ts +++ b/src/tendermint/types/validator.ts @@ -1,45 +1,45 @@ /* eslint-disable */ import { PublicKey } from "../crypto/keys"; -import { Long, isSet, DeepPartial, Exact, bytesFromBase64, base64FromBytes } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export const protobufPackage = "tendermint.types"; export interface ValidatorSet { validators: Validator[]; proposer: Validator; - totalVotingPower: Long; + totalVotingPower: bigint; } export interface Validator { address: Uint8Array; pubKey: PublicKey; - votingPower: Long; - proposerPriority: Long; + votingPower: bigint; + proposerPriority: bigint; } export interface SimpleValidator { pubKey: PublicKey; - votingPower: Long; + votingPower: bigint; } function createBaseValidatorSet(): ValidatorSet { return { validators: [], proposer: Validator.fromPartial({}), - totalVotingPower: Long.ZERO, + totalVotingPower: BigInt(0), }; } export const ValidatorSet = { - encode(message: ValidatorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: ValidatorSet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { for (const v of message.validators) { Validator.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.proposer !== undefined) { Validator.encode(message.proposer, writer.uint32(18).fork()).ldelim(); } - if (!message.totalVotingPower.isZero()) { + if (message.totalVotingPower !== BigInt(0)) { writer.uint32(24).int64(message.totalVotingPower); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): ValidatorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidatorSet(); while (reader.pos < end) { @@ -52,7 +52,7 @@ export const ValidatorSet = { message.proposer = Validator.decode(reader, reader.uint32()); break; case 3: - message.totalVotingPower = reader.int64() as Long; + message.totalVotingPower = reader.int64(); break; default: reader.skipType(tag & 7); @@ -66,7 +66,7 @@ export const ValidatorSet = { if (Array.isArray(object?.validators)) obj.validators = object.validators.map((e: any) => Validator.fromJSON(e)); if (isSet(object.proposer)) obj.proposer = Validator.fromJSON(object.proposer); - if (isSet(object.totalVotingPower)) obj.totalVotingPower = Long.fromValue(object.totalVotingPower); + if (isSet(object.totalVotingPower)) obj.totalVotingPower = BigInt(object.totalVotingPower.toString()); return obj; }, toJSON(message: ValidatorSet): unknown { @@ -79,17 +79,17 @@ export const ValidatorSet = { message.proposer !== undefined && (obj.proposer = message.proposer ? Validator.toJSON(message.proposer) : undefined); message.totalVotingPower !== undefined && - (obj.totalVotingPower = (message.totalVotingPower || Long.ZERO).toString()); + (obj.totalVotingPower = (message.totalVotingPower || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): ValidatorSet { + fromPartial(object: Partial): ValidatorSet { const message = createBaseValidatorSet(); message.validators = object.validators?.map((e) => Validator.fromPartial(e)) || []; if (object.proposer !== undefined && object.proposer !== null) { message.proposer = Validator.fromPartial(object.proposer); } if (object.totalVotingPower !== undefined && object.totalVotingPower !== null) { - message.totalVotingPower = Long.fromValue(object.totalVotingPower); + message.totalVotingPower = BigInt(object.totalVotingPower.toString()); } return message; }, @@ -98,28 +98,28 @@ function createBaseValidator(): Validator { return { address: new Uint8Array(), pubKey: PublicKey.fromPartial({}), - votingPower: Long.ZERO, - proposerPriority: Long.ZERO, + votingPower: BigInt(0), + proposerPriority: BigInt(0), }; } export const Validator = { - encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address.length !== 0) { writer.uint32(10).bytes(message.address); } if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); } - if (!message.votingPower.isZero()) { + if (message.votingPower !== BigInt(0)) { writer.uint32(24).int64(message.votingPower); } - if (!message.proposerPriority.isZero()) { + if (message.proposerPriority !== BigInt(0)) { writer.uint32(32).int64(message.proposerPriority); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Validator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Validator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidator(); while (reader.pos < end) { @@ -132,10 +132,10 @@ export const Validator = { message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 3: - message.votingPower = reader.int64() as Long; + message.votingPower = reader.int64(); break; case 4: - message.proposerPriority = reader.int64() as Long; + message.proposerPriority = reader.int64(); break; default: reader.skipType(tag & 7); @@ -148,8 +148,8 @@ export const Validator = { const obj = createBaseValidator(); if (isSet(object.address)) obj.address = bytesFromBase64(object.address); if (isSet(object.pubKey)) obj.pubKey = PublicKey.fromJSON(object.pubKey); - if (isSet(object.votingPower)) obj.votingPower = Long.fromValue(object.votingPower); - if (isSet(object.proposerPriority)) obj.proposerPriority = Long.fromValue(object.proposerPriority); + if (isSet(object.votingPower)) obj.votingPower = BigInt(object.votingPower.toString()); + if (isSet(object.proposerPriority)) obj.proposerPriority = BigInt(object.proposerPriority.toString()); return obj; }, toJSON(message: Validator): unknown { @@ -158,22 +158,22 @@ export const Validator = { (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array())); message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || BigInt(0)).toString()); message.proposerPriority !== undefined && - (obj.proposerPriority = (message.proposerPriority || Long.ZERO).toString()); + (obj.proposerPriority = (message.proposerPriority || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Validator { + fromPartial(object: Partial): Validator { const message = createBaseValidator(); message.address = object.address ?? new Uint8Array(); if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = PublicKey.fromPartial(object.pubKey); } if (object.votingPower !== undefined && object.votingPower !== null) { - message.votingPower = Long.fromValue(object.votingPower); + message.votingPower = BigInt(object.votingPower.toString()); } if (object.proposerPriority !== undefined && object.proposerPriority !== null) { - message.proposerPriority = Long.fromValue(object.proposerPriority); + message.proposerPriority = BigInt(object.proposerPriority.toString()); } return message; }, @@ -181,21 +181,21 @@ export const Validator = { function createBaseSimpleValidator(): SimpleValidator { return { pubKey: PublicKey.fromPartial({}), - votingPower: Long.ZERO, + votingPower: BigInt(0), }; } export const SimpleValidator = { - encode(message: SimpleValidator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: SimpleValidator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.pubKey !== undefined) { PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim(); } - if (!message.votingPower.isZero()) { + if (message.votingPower !== BigInt(0)) { writer.uint32(16).int64(message.votingPower); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): SimpleValidator { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): SimpleValidator { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSimpleValidator(); while (reader.pos < end) { @@ -205,7 +205,7 @@ export const SimpleValidator = { message.pubKey = PublicKey.decode(reader, reader.uint32()); break; case 2: - message.votingPower = reader.int64() as Long; + message.votingPower = reader.int64(); break; default: reader.skipType(tag & 7); @@ -217,23 +217,23 @@ export const SimpleValidator = { fromJSON(object: any): SimpleValidator { const obj = createBaseSimpleValidator(); if (isSet(object.pubKey)) obj.pubKey = PublicKey.fromJSON(object.pubKey); - if (isSet(object.votingPower)) obj.votingPower = Long.fromValue(object.votingPower); + if (isSet(object.votingPower)) obj.votingPower = BigInt(object.votingPower.toString()); return obj; }, toJSON(message: SimpleValidator): unknown { const obj: any = {}; message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined); - message.votingPower !== undefined && (obj.votingPower = (message.votingPower || Long.ZERO).toString()); + message.votingPower !== undefined && (obj.votingPower = (message.votingPower || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): SimpleValidator { + fromPartial(object: Partial): SimpleValidator { const message = createBaseSimpleValidator(); if (object.pubKey !== undefined && object.pubKey !== null) { message.pubKey = PublicKey.fromPartial(object.pubKey); } if (object.votingPower !== undefined && object.votingPower !== null) { - message.votingPower = Long.fromValue(object.votingPower); + message.votingPower = BigInt(object.votingPower.toString()); } return message; }, diff --git a/src/tendermint/version/types.ts b/src/tendermint/version/types.ts index 1527d8a..2ae37a9 100644 --- a/src/tendermint/version/types.ts +++ b/src/tendermint/version/types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Long, isSet, DeepPartial, Exact } from "../../helpers"; -import * as _m0 from "protobufjs/minimal"; +import { BinaryReader, BinaryWriter } from "../../binary"; +import { isSet } from "../../helpers"; export const protobufPackage = "tendermint.version"; /** * App includes the protocol and software version for the application. @@ -8,7 +8,7 @@ export const protobufPackage = "tendermint.version"; * updated in ResponseEndBlock. */ export interface App { - protocol: Long; + protocol: bigint; software: string; } /** @@ -17,18 +17,18 @@ export interface App { * state transition machine. */ export interface Consensus { - block: Long; - app: Long; + block: bigint; + app: bigint; } function createBaseApp(): App { return { - protocol: Long.UZERO, + protocol: BigInt(0), software: "", }; } export const App = { - encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.protocol.isZero()) { + encode(message: App, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protocol !== BigInt(0)) { writer.uint32(8).uint64(message.protocol); } if (message.software !== "") { @@ -36,15 +36,15 @@ export const App = { } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): App { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): App { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseApp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.protocol = reader.uint64() as Long; + message.protocol = reader.uint64(); break; case 2: message.software = reader.string(); @@ -58,20 +58,20 @@ export const App = { }, fromJSON(object: any): App { const obj = createBaseApp(); - if (isSet(object.protocol)) obj.protocol = Long.fromValue(object.protocol); + if (isSet(object.protocol)) obj.protocol = BigInt(object.protocol.toString()); if (isSet(object.software)) obj.software = String(object.software); return obj; }, toJSON(message: App): unknown { const obj: any = {}; - message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); + message.protocol !== undefined && (obj.protocol = (message.protocol || BigInt(0)).toString()); message.software !== undefined && (obj.software = message.software); return obj; }, - fromPartial, I>>(object: I): App { + fromPartial(object: Partial): App { const message = createBaseApp(); if (object.protocol !== undefined && object.protocol !== null) { - message.protocol = Long.fromValue(object.protocol); + message.protocol = BigInt(object.protocol.toString()); } message.software = object.software ?? ""; return message; @@ -79,32 +79,32 @@ export const App = { }; function createBaseConsensus(): Consensus { return { - block: Long.UZERO, - app: Long.UZERO, + block: BigInt(0), + app: BigInt(0), }; } export const Consensus = { - encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.block.isZero()) { + encode(message: Consensus, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.block !== BigInt(0)) { writer.uint32(8).uint64(message.block); } - if (!message.app.isZero()) { + if (message.app !== BigInt(0)) { writer.uint32(16).uint64(message.app); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + decode(input: BinaryReader | Uint8Array, length?: number): Consensus { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConsensus(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = reader.uint64() as Long; + message.block = reader.uint64(); break; case 2: - message.app = reader.uint64() as Long; + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -115,23 +115,23 @@ export const Consensus = { }, fromJSON(object: any): Consensus { const obj = createBaseConsensus(); - if (isSet(object.block)) obj.block = Long.fromValue(object.block); - if (isSet(object.app)) obj.app = Long.fromValue(object.app); + if (isSet(object.block)) obj.block = BigInt(object.block.toString()); + if (isSet(object.app)) obj.app = BigInt(object.app.toString()); return obj; }, toJSON(message: Consensus): unknown { const obj: any = {}; - message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); - message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); + message.block !== undefined && (obj.block = (message.block || BigInt(0)).toString()); + message.app !== undefined && (obj.app = (message.app || BigInt(0)).toString()); return obj; }, - fromPartial, I>>(object: I): Consensus { + fromPartial(object: Partial): Consensus { const message = createBaseConsensus(); if (object.block !== undefined && object.block !== null) { - message.block = Long.fromValue(object.block); + message.block = BigInt(object.block.toString()); } if (object.app !== undefined && object.app !== null) { - message.app = Long.fromValue(object.app); + message.app = BigInt(object.app.toString()); } return message; }, diff --git a/src/utf8.ts b/src/utf8.ts new file mode 100644 index 0000000..9f94a57 --- /dev/null +++ b/src/utf8.ts @@ -0,0 +1,129 @@ +/* eslint-disable */ +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@0.109.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +// Copyright (c) 2016, Daniel Wirtz All rights reserved. + +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: + +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of its author, nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. + +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"use strict"; + +/** + * Calculates the UTF8 byte length of a string. + * @param {string} string String + * @returns {number} Byte length + */ +export function utf8Length(str: string) { + let len = 0, + c = 0; + for (let i = 0; i < str.length; ++i) { + c = str.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ((c & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) { + ++i; + len += 4; + } else len += 3; + } + return len; +} + +/** + * Reads UTF8 bytes as a string. + * @param {Uint8Array} buffer Source buffer + * @param {number} start Source start + * @param {number} end Source end + * @returns {string} String read + */ +export function utf8Read(buffer: ArrayLike, start: number, end: number) { + const len = end - start; + if (len < 1) return ""; + const chunk = []; + let parts: string[] = [], + i = 0, // char offset + t; // temporary + while (start < end) { + t = buffer[start++]; + if (t < 128) chunk[i++] = t; + else if (t > 191 && t < 224) chunk[i++] = ((t & 31) << 6) | (buffer[start++] & 63); + else if (t > 239 && t < 365) { + t = + (((t & 7) << 18) | + ((buffer[start++] & 63) << 12) | + ((buffer[start++] & 63) << 6) | + (buffer[start++] & 63)) - + 0x10000; + chunk[i++] = 0xd800 + (t >> 10); + chunk[i++] = 0xdc00 + (t & 1023); + } else chunk[i++] = ((t & 15) << 12) | ((buffer[start++] & 63) << 6) | (buffer[start++] & 63); + if (i > 8191) { + (parts || (parts = [])).push(String.fromCharCode(...chunk)); + i = 0; + } + } + if (parts) { + if (i) parts.push(String.fromCharCode(...chunk.slice(0, i))); + return parts.join(""); + } + return String.fromCharCode(...chunk.slice(0, i)); +} + +/** + * Writes a string as UTF8 bytes. + * @param {string} string Source string + * @param {Uint8Array} buffer Destination buffer + * @param {number} offset Destination offset + * @returns {number} Bytes written + */ +export function utf8Write(str: string, buffer: Uint8Array | Array, offset: number) { + const start = offset; + let c1, // character 1 + c2; // character 2 + for (let i = 0; i < str.length; ++i) { + c1 = str.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = (c1 >> 6) | 192; + buffer[offset++] = (c1 & 63) | 128; + } else if ((c1 & 0xfc00) === 0xd800 && ((c2 = str.charCodeAt(i + 1)) & 0xfc00) === 0xdc00) { + c1 = 0x10000 + ((c1 & 0x03ff) << 10) + (c2 & 0x03ff); + ++i; + buffer[offset++] = (c1 >> 18) | 240; + buffer[offset++] = ((c1 >> 12) & 63) | 128; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } else { + buffer[offset++] = (c1 >> 12) | 224; + buffer[offset++] = ((c1 >> 6) & 63) | 128; + buffer[offset++] = (c1 & 63) | 128; + } + } + return offset - start; +} diff --git a/src/varint.ts b/src/varint.ts new file mode 100644 index 0000000..407a8db --- /dev/null +++ b/src/varint.ts @@ -0,0 +1,461 @@ +/* eslint-disable */ +/** + * This file and any referenced files were automatically generated by @cosmology/telescope@0.109.4 + * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain + * and run the transpile command or yarn proto command to regenerate this bundle. + */ + +// Copyright 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Code generated by the Protocol Buffer compiler is owned by the owner +// of the input file used when generating it. This code is not +// standalone and requires a support library to be linked with it. This +// support library is itself covered by the above license. + +/* eslint-disable prefer-const,@typescript-eslint/restrict-plus-operands */ + +/** + * Read a 64 bit varint as two JS numbers. + * + * Returns tuple: + * [0]: low bits + * [1]: high bits + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175 + */ +export function varint64read(this: ReaderLike): [number, number] { + let lowBits = 0; + let highBits = 0; + + for (let shift = 0; shift < 28; shift += 7) { + let b = this.buf[this.pos++]; + lowBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + let middleByte = this.buf[this.pos++]; + + // last four bits of the first 32 bit number + lowBits |= (middleByte & 0x0f) << 28; + + // 3 upper bits are part of the next 32 bit number + highBits = (middleByte & 0x70) >> 4; + + if ((middleByte & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + + for (let shift = 3; shift <= 31; shift += 7) { + let b = this.buf[this.pos++]; + highBits |= (b & 0x7f) << shift; + if ((b & 0x80) == 0) { + this.assertBounds(); + return [lowBits, highBits]; + } + } + + throw new Error("invalid varint"); +} + +/** + * Write a 64 bit varint, given as two JS numbers, to the given bytes array. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344 + */ +export function varint64write(lo: number, hi: number, bytes: number[]): void { + for (let i = 0; i < 28; i = i + 7) { + const shift = lo >>> i; + const hasNext = !(shift >>> 7 == 0 && hi == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + const splitBits = ((lo >>> 28) & 0x0f) | ((hi & 0x07) << 4); + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 0x80 : splitBits) & 0xff); + + if (!hasMoreBits) { + return; + } + + for (let i = 3; i < 31; i = i + 7) { + const shift = hi >>> i; + const hasNext = !(shift >>> 7 == 0); + const byte = (hasNext ? shift | 0x80 : shift) & 0xff; + bytes.push(byte); + if (!hasNext) { + return; + } + } + + bytes.push((hi >>> 31) & 0x01); +} + +// constants for binary math +const TWO_PWR_32_DBL = 0x100000000; + +/** + * Parse decimal string of 64 bit integer value as two JS numbers. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64FromString(dec: string): { lo: number; hi: number } { + // Check for minus sign. + const minus = dec[0] === "-"; + if (minus) { + dec = dec.slice(1); + } + + // Work 6 decimal digits at a time, acting like we're converting base 1e6 + // digits to binary. This is safe to do with floating point math because + // Number.isSafeInteger(ALL_32_BITS * 1e6) == true. + const base = 1e6; + let lowBits = 0; + let highBits = 0; + + function add1e6digit(begin: number, end?: number) { + // Note: Number('') is 0. + const digit1e6 = Number(dec.slice(begin, end)); + highBits *= base; + lowBits = lowBits * base + digit1e6; + // Carry bits from lowBits to + if (lowBits >= TWO_PWR_32_DBL) { + highBits = highBits + ((lowBits / TWO_PWR_32_DBL) | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + + add1e6digit(-24, -18); + add1e6digit(-18, -12); + add1e6digit(-12, -6); + add1e6digit(-6); + return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits); +} + +/** + * Losslessly converts a 64-bit signed integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function int64ToString(lo: number, hi: number): string { + let bits = newBits(lo, hi); + // If we're treating the input as a signed value and the high bit is set, do + // a manual two's complement conversion before the decimal conversion. + const negative = bits.hi & 0x80000000; + if (negative) { + bits = negate(bits.lo, bits.hi); + } + const result = uInt64ToString(bits.lo, bits.hi); + return negative ? "-" + result : result; +} + +/** + * Losslessly converts a 64-bit unsigned integer in 32:32 split representation + * into a decimal string. + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10 + */ +export function uInt64ToString(lo: number, hi: number): string { + ({ lo, hi } = toUnsigned(lo, hi)); + // Skip the expensive conversion if the number is small enough to use the + // built-in conversions. + // Number.MAX_SAFE_INTEGER = 0x001FFFFF FFFFFFFF, thus any number with + // highBits <= 0x1FFFFF can be safely expressed with a double and retain + // integer precision. + // Proven by: Number.isSafeInteger(0x1FFFFF * 2**32 + 0xFFFFFFFF) == true. + if (hi <= 0x1fffff) { + return String(TWO_PWR_32_DBL * hi + lo); + } + + // What this code is doing is essentially converting the input number from + // base-2 to base-1e7, which allows us to represent the 64-bit range with + // only 3 (very large) digits. Those digits are then trivial to convert to + // a base-10 string. + + // The magic numbers used here are - + // 2^24 = 16777216 = (1,6777216) in base-1e7. + // 2^48 = 281474976710656 = (2,8147497,6710656) in base-1e7. + + // Split 32:32 representation into 16:24:24 representation so our + // intermediate digits don't overflow. + const low = lo & 0xffffff; + const mid = ((lo >>> 24) | (hi << 8)) & 0xffffff; + const high = (hi >> 16) & 0xffff; + + // Assemble our three base-1e7 digits, ignoring carries. The maximum + // value in a digit at this step is representable as a 48-bit integer, which + // can be stored in a 64-bit floating point number. + let digitA = low + mid * 6777216 + high * 6710656; + let digitB = mid + high * 8147497; + let digitC = high * 2; + + // Apply carries from A to B and from B to C. + const base = 10000000; + if (digitA >= base) { + digitB += Math.floor(digitA / base); + digitA %= base; + } + + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; + } + + // If digitC is 0, then we should have returned in the trivial code path + // at the top for non-safe integers. Given this, we can assume both digitB + // and digitA need leading zeros. + return digitC.toString() + decimalFrom1e7WithLeadingZeros(digitB) + decimalFrom1e7WithLeadingZeros(digitA); +} + +function toUnsigned(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo >>> 0, hi: hi >>> 0 }; +} + +function newBits(lo: number, hi: number): { lo: number; hi: number } { + return { lo: lo | 0, hi: hi | 0 }; +} + +/** + * Returns two's compliment negation of input. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers + */ +function negate(lowBits: number, highBits: number) { + highBits = ~highBits; + if (lowBits) { + lowBits = ~lowBits + 1; + } else { + // If lowBits is 0, then bitwise-not is 0xFFFFFFFF, + // adding 1 to that, results in 0x100000000, which leaves + // the low bits 0x0 and simply adds one to the high bits. + highBits += 1; + } + return newBits(lowBits, highBits); +} + +/** + * Returns decimal representation of digit1e7 with leading zeros. + */ +const decimalFrom1e7WithLeadingZeros = (digit1e7: number) => { + const partial = String(digit1e7); + return "0000000".slice(partial.length) + partial; +}; + +/** + * Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)` + * + * Copyright 2008 Google Inc. All rights reserved. + * + * See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144 + */ +export function varint32write(value: number, bytes: number[]): void { + if (value >= 0) { + // write value as varint 32 + while (value > 0x7f) { + bytes.push((value & 0x7f) | 0x80); + value = value >>> 7; + } + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push((value & 127) | 128); + value = value >> 7; + } + bytes.push(1); + } +} + +/** + * Read an unsigned 32 bit varint. + * + * See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220 + */ +export function varint32read(this: ReaderLike): number { + let b = this.buf[this.pos++]; + let result = b & 0x7f; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 7; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 14; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + b = this.buf[this.pos++]; + result |= (b & 0x7f) << 21; + if ((b & 0x80) == 0) { + this.assertBounds(); + return result; + } + + // Extract only last 4 bits + b = this.buf[this.pos++]; + result |= (b & 0x0f) << 28; + + for (let readBytes = 5; (b & 0x80) !== 0 && readBytes < 10; readBytes++) b = this.buf[this.pos++]; + + if ((b & 0x80) != 0) throw new Error("invalid varint"); + + this.assertBounds(); + + // Result can have 32 bits, convert it to unsigned + return result >>> 0; +} + +type ReaderLike = { + buf: Uint8Array; + pos: number; + len: number; + assertBounds(): void; +}; + +/** + * encode zig zag + */ +export function zzEncode(lo: number, hi: number) { + let mask = hi >> 31; + hi = (((hi << 1) | (lo >>> 31)) ^ mask) >>> 0; + lo = ((lo << 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * decode zig zag + */ +export function zzDecode(lo: number, hi: number) { + let mask = -(lo & 1); + lo = (((lo >>> 1) | (hi << 31)) ^ mask) >>> 0; + hi = ((hi >>> 1) ^ mask) >>> 0; + return [lo, hi]; +} + +/** + * unsigned int32 without moving pos. + */ +export function readUInt32(buf: Uint8Array, pos: number) { + return (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + buf[pos + 3] * 0x1000000; +} + +/** + * signed int32 without moving pos. + */ +export function readInt32(buf: Uint8Array, pos: number) { + return (buf[pos] | (buf[pos + 1] << 8) | (buf[pos + 2] << 16)) + (buf[pos + 3] << 24); +} + +/** + * writing varint32 to pos + */ +export function writeVarint32(val: number, buf: Uint8Array | number[], pos: number) { + while (val > 127) { + buf[pos++] = (val & 127) | 128; + val >>>= 7; + } + buf[pos] = val; +} + +/** + * writing varint64 to pos + */ +export function writeVarint64(val: { lo: number; hi: number }, buf: Uint8Array | number[], pos: number) { + while (val.hi) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = ((val.lo >>> 7) | (val.hi << 25)) >>> 0; + val.hi >>>= 7; + } + while (val.lo > 127) { + buf[pos++] = (val.lo & 127) | 128; + val.lo = val.lo >>> 7; + } + buf[pos++] = val.lo; +} + +export function int64Length(lo: number, hi: number) { + let part0 = lo, + part1 = ((lo >>> 28) | (hi << 4)) >>> 0, + part2 = hi >>> 24; + return part2 === 0 + ? part1 === 0 + ? part0 < 16384 + ? part0 < 128 + ? 1 + : 2 + : part0 < 2097152 + ? 3 + : 4 + : part1 < 16384 + ? part1 < 128 + ? 5 + : 6 + : part1 < 2097152 + ? 7 + : 8 + : part2 < 128 + ? 9 + : 10; +} + +export function writeFixed32(val: number, buf: Uint8Array | number[], pos: number) { + buf[pos] = val & 255; + buf[pos + 1] = (val >>> 8) & 255; + buf[pos + 2] = (val >>> 16) & 255; + buf[pos + 3] = val >>> 24; +} + +export function writeByte(val: number, buf: Uint8Array | number[], pos: number) { + buf[pos] = val & 255; +} diff --git a/tsconfig.json b/tsconfig.json index 93a0e0d..b743d16 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,7 +22,7 @@ "resolveJsonModule": true, "rootDir": "src", "sourceMap": true, - "strict": true, + "strict": false, "target": "es2020" }, "include": ["src/**/*"]