├── .editorconfig ├── .gitattributes ├── .gitignore ├── .gitmodules ├── .pnp.js ├── .prettierrc.json ├── .yarn ├── cache │ ├── @protobufjs-aspromise-npm-1.1.2-71d00b938f-83ced0798a.zip │ ├── @protobufjs-base64-npm-1.1.2-cd8ca6814a-ae9e84aaf6.zip │ ├── @protobufjs-codegen-npm-2.0.4-36e188bbe6-a05d5f8892.zip │ ├── @protobufjs-eventemitter-npm-1.1.0-029cc7d431-32a84e33f1.zip │ ├── @protobufjs-fetch-npm-1.1.0-ca857b7df4-d682e5d8a1.zip │ ├── @protobufjs-float-npm-1.0.2-5678f64d08-eee7278de2.zip │ ├── @protobufjs-inquire-npm-1.1.0-3c7759e9ce-3541518cca.zip │ ├── @protobufjs-path-npm-1.1.2-641d08de76-22f10c5c22.zip │ ├── @protobufjs-pool-npm-1.1.0-47a76f96a1-5fc4af9e06.zip │ ├── @protobufjs-utf8-npm-1.1.0-02c590807c-5b3fa7425f.zip │ ├── @types-long-npm-4.0.1-022c8b6e77-ed2a125330.zip │ ├── @types-node-npm-15.6.1-1a0b9c8653-07b3855bc0.zip │ ├── @types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip │ ├── @types-object-hash-npm-1.3.4-3b3e2e44e8-2ae12c7b34.zip │ ├── @types-prettier-npm-1.19.1-396f22bcd2-394a4364ce.zip │ ├── dataloader-npm-1.4.0-ba03bd2183-1c698b6d47.zip │ ├── lodash-npm-4.17.21-6382451519-4983720b9a.zip │ ├── long-npm-4.0.0-ecd96a31ed-9cebc1ee8b.zip │ ├── object-hash-npm-1.3.1-ea495b8e52-035cb0b0e6.zip │ ├── prettier-npm-2.3.0-29ef37e8b6-652640cc8b.zip │ ├── protobufjs-npm-6.11.2-9b422ce98e-3c7c6875ca.zip │ ├── ts-poet-npm-4.5.0-5771bc00e9-8d8e59a29d.zip │ ├── ts-proto-descriptors-npm-1.2.1-bdac3b6021-ad62bdf0a3.zip │ ├── ts-proto-npm-1.81.1-638c7076bc-7d6f3387ea.zip │ ├── typescript-npm-4.0.7-e760e37efc-1b4c63a228.zip │ └── typescript-patch-92bf6e8d8b-f234923fbe.zip ├── plugins │ └── @yarnpkg │ │ ├── plugin-interactive-tools.cjs │ │ ├── plugin-version.cjs │ │ └── plugin-workspace-tools.cjs ├── releases │ └── yarn-2.4.1.cjs ├── sdks │ ├── integrations.yml │ ├── prettier │ │ ├── index.js │ │ └── package.json │ └── typescript │ │ ├── bin │ │ ├── tsc │ │ └── tsserver │ │ ├── lib │ │ ├── tsc.js │ │ ├── tsserver.js │ │ ├── tsserverlibrary.js │ │ └── typescript.js │ │ └── package.json └── versions │ ├── 36774439.yml │ └── 4f152a06.yml ├── .yarnrc.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── bin └── protoc-gen-ts_proto_yarn_2 ├── package.json ├── scripts ├── define-proto.sh └── prepare.sh ├── src ├── confio │ └── proofs.ts ├── cosmos │ ├── auth │ │ └── v1beta1 │ │ │ ├── auth.ts │ │ │ ├── genesis.ts │ │ │ └── query.ts │ ├── bank │ │ └── v1beta1 │ │ │ ├── bank.ts │ │ │ ├── genesis.ts │ │ │ ├── query.ts │ │ │ └── tx.ts │ ├── base │ │ ├── abci │ │ │ └── v1beta1 │ │ │ │ └── abci.ts │ │ ├── kv │ │ │ └── v1beta1 │ │ │ │ └── kv.ts │ │ ├── query │ │ │ └── v1beta1 │ │ │ │ └── pagination.ts │ │ ├── reflection │ │ │ └── v1beta1 │ │ │ │ └── reflection.ts │ │ ├── snapshots │ │ │ └── v1beta1 │ │ │ │ └── snapshot.ts │ │ ├── store │ │ │ └── v1beta1 │ │ │ │ ├── commit_info.ts │ │ │ │ └── snapshot.ts │ │ ├── tendermint │ │ │ └── v1beta1 │ │ │ │ └── query.ts │ │ └── v1beta1 │ │ │ └── coin.ts │ ├── capability │ │ └── v1beta1 │ │ │ ├── capability.ts │ │ │ └── genesis.ts │ ├── crisis │ │ └── v1beta1 │ │ │ ├── genesis.ts │ │ │ └── tx.ts │ ├── crypto │ │ ├── ed25519 │ │ │ └── keys.ts │ │ ├── multisig │ │ │ ├── keys.ts │ │ │ └── v1beta1 │ │ │ │ └── multisig.ts │ │ └── secp256k1 │ │ │ └── keys.ts │ ├── distribution │ │ └── v1beta1 │ │ │ ├── distribution.ts │ │ │ ├── genesis.ts │ │ │ ├── query.ts │ │ │ └── tx.ts │ ├── evidence │ │ └── v1beta1 │ │ │ ├── evidence.ts │ │ │ ├── genesis.ts │ │ │ ├── query.ts │ │ │ └── tx.ts │ ├── genutil │ │ └── v1beta1 │ │ │ └── genesis.ts │ ├── gov │ │ └── v1beta1 │ │ │ ├── genesis.ts │ │ │ ├── gov.ts │ │ │ ├── query.ts │ │ │ └── tx.ts │ ├── mint │ │ └── v1beta1 │ │ │ ├── genesis.ts │ │ │ ├── mint.ts │ │ │ └── query.ts │ ├── params │ │ └── v1beta1 │ │ │ ├── params.ts │ │ │ └── query.ts │ ├── slashing │ │ └── v1beta1 │ │ │ ├── genesis.ts │ │ │ ├── query.ts │ │ │ ├── slashing.ts │ │ │ └── tx.ts │ ├── staking │ │ └── v1beta1 │ │ │ ├── genesis.ts │ │ │ ├── query.ts │ │ │ ├── staking.ts │ │ │ └── tx.ts │ ├── tx │ │ ├── signing │ │ │ └── v1beta1 │ │ │ │ └── signing.ts │ │ └── v1beta1 │ │ │ ├── service.ts │ │ │ └── tx.ts │ ├── upgrade │ │ └── v1beta1 │ │ │ ├── query.ts │ │ │ └── upgrade.ts │ └── vesting │ │ └── v1beta1 │ │ ├── tx.ts │ │ └── vesting.ts ├── cosmos_proto │ └── cosmos.ts ├── cosmwasm │ └── wasm │ │ ├── v1 │ │ ├── genesis.ts │ │ ├── ibc.ts │ │ ├── proposal.ts │ │ ├── query.ts │ │ ├── tx.ts │ │ └── types.ts │ │ └── v1beta1 │ │ ├── genesis.ts │ │ ├── ibc.ts │ │ ├── proposal.ts │ │ ├── query.ts │ │ ├── tx.ts │ │ └── types.ts ├── gogoproto │ └── gogo.ts ├── google │ ├── api │ │ ├── annotations.ts │ │ └── http.ts │ └── protobuf │ │ ├── any.ts │ │ ├── descriptor.ts │ │ ├── duration.ts │ │ └── timestamp.ts ├── ibc │ ├── applications │ │ └── transfer │ │ │ └── v1 │ │ │ ├── genesis.ts │ │ │ ├── query.ts │ │ │ ├── transfer.ts │ │ │ └── tx.ts │ ├── core │ │ ├── channel │ │ │ └── v1 │ │ │ │ ├── channel.ts │ │ │ │ ├── genesis.ts │ │ │ │ ├── query.ts │ │ │ │ └── tx.ts │ │ ├── client │ │ │ └── v1 │ │ │ │ ├── client.ts │ │ │ │ ├── genesis.ts │ │ │ │ ├── query.ts │ │ │ │ └── tx.ts │ │ ├── commitment │ │ │ └── v1 │ │ │ │ └── commitment.ts │ │ ├── connection │ │ │ └── v1 │ │ │ │ ├── connection.ts │ │ │ │ ├── genesis.ts │ │ │ │ ├── query.ts │ │ │ │ └── tx.ts │ │ └── types │ │ │ └── v1 │ │ │ └── genesis.ts │ └── lightclients │ │ ├── localhost │ │ └── v1 │ │ │ └── localhost.ts │ │ ├── solomachine │ │ └── v1 │ │ │ └── solomachine.ts │ │ └── tendermint │ │ └── v1 │ │ └── tendermint.ts └── tendermint │ ├── abci │ └── types.ts │ ├── crypto │ ├── keys.ts │ └── proof.ts │ ├── p2p │ └── types.ts │ ├── types │ ├── block.ts │ ├── evidence.ts │ ├── params.ts │ ├── types.ts │ └── validator.ts │ └── version │ └── types.ts ├── tsconfig.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | /.yarn/** linguist-vendored 2 | 3 | *.zip filter=lfs diff=lfs merge=lfs -text 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.yarn/* 2 | !.yarn/patches 3 | !/.yarn/plugins 4 | !/.yarn/releases 5 | !/.yarn/sdks 6 | !/.yarn/versions 7 | 8 | # Swap the comments on the following lines if you don't wish to use zero-installs 9 | # Documentation here: https://yarnpkg.com/features/zero-installs 10 | !/.yarn/cache 11 | #/.pnp.* 12 | 13 | /build/ 14 | /confio/ 15 | /cosmos/ 16 | /cosmos_proto/ 17 | /cosmwasm/ 18 | /gogoproto/ 19 | /google/ 20 | /ibc/ 21 | /tendermint/ 22 | 23 | # IDEs 24 | .vscode/ 25 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "wasmd"] 2 | path = wasmd-0.16 3 | url = https://github.com/cosmwasm/wasmd 4 | [submodule "wasmd-0.18"] 5 | path = wasmd-0.18 6 | url = https://github.com/CosmWasm/wasmd.git 7 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 110, 3 | "trailingComma": "all", 4 | "overrides": [ 5 | { 6 | "files": "*.md", 7 | "options": { 8 | "printWidth": 80, 9 | "proseWrap": "always" 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-83ced0798a.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fafd90c221207d35f83457841b004bce4799a3e10a2904f18d07923029ebec07 3 | size 4234 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-base64-npm-1.1.2-cd8ca6814a-ae9e84aaf6.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cfdbe56fb2355ca7fdbe9cdcb608fa9d82b4de3bc03aeb3146ac6b559ea8a5f2 3 | size 5049 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-codegen-npm-2.0.4-36e188bbe6-a05d5f8892.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8b5dfa514d5ac23b4525ab6dc2de56e9a11d1030e0bfd6f1cd3a9c128215f6f3 3 | size 5293 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-32a84e33f1.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d8612573a8cf78c639ddf8d8e997f0ab86550b6e0d35cfae25f12d543ebf4173 3 | size 4617 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-fetch-npm-1.1.0-ca857b7df4-d682e5d8a1.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ac1c90b52006a041553faa97d1b587d0aaadbf2a4003f823b9106dae7b801d8e 3 | size 5210 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-float-npm-1.0.2-5678f64d08-eee7278de2.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b6a735c80472bccf2d92f236fac59d5a6a52cfeadf29180c731d56afe38aac49 3 | size 8365 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-inquire-npm-1.1.0-3c7759e9ce-3541518cca.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5d2c6044f40605720df6db15d652f5f8f64dfb1d175303a8a6fe8bd975ccf64a 3 | size 4866 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-path-npm-1.1.2-641d08de76-22f10c5c22.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aab124affa410e950d1a81e57a589e18ec086e5f0a4aeaa23e0b8045ca982b18 3 | size 4406 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-pool-npm-1.1.0-47a76f96a1-5fc4af9e06.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ab11e239ad7255c553d4751b8f35019f2d493b8b5b390b5fbe2433d8c9877d3a 3 | size 4353 4 | -------------------------------------------------------------------------------- /.yarn/cache/@protobufjs-utf8-npm-1.1.0-02c590807c-5b3fa7425f.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d81a102ed162d1fbfb46c5e3e34045873fda2350ab9b62f0cee59d1baea06ec0 3 | size 11511 4 | -------------------------------------------------------------------------------- /.yarn/cache/@types-long-npm-4.0.1-022c8b6e77-ed2a125330.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f1eb91b4607d4c1143025e27954c0f17d5804b4af87e83ca5df6e90354b6dcf8 3 | size 3904 4 | -------------------------------------------------------------------------------- /.yarn/cache/@types-node-npm-15.6.1-1a0b9c8653-07b3855bc0.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:64ada7a04781ebb5264dc1806759036a0cc15dac0b5b83090ab377c75072ba67 3 | size 134023 4 | -------------------------------------------------------------------------------- /.yarn/cache/@types-node-npm-15.6.2-9d8f9d46a0-e65d6d4750.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9391971c1c2e1be27c5b92e8b7103cfc3d6c4748ddd80fc1b1c7322a60510a41 3 | size 134051 4 | -------------------------------------------------------------------------------- /.yarn/cache/@types-object-hash-npm-1.3.4-3b3e2e44e8-2ae12c7b34.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c0e7308ef0f899329a44dfde29ef1d3decae809c55c5305ad26507738d1894ab 3 | size 2934 4 | -------------------------------------------------------------------------------- /.yarn/cache/@types-prettier-npm-1.19.1-396f22bcd2-394a4364ce.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6d6ac102cac1d3cd1d32aa7e41318def37cb47626556a881ae099836becb4a69 3 | size 10374 4 | -------------------------------------------------------------------------------- /.yarn/cache/dataloader-npm-1.4.0-ba03bd2183-1c698b6d47.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c9c31225a239b5934624863d29cae2b4d68424dc107606ff639221095d78c584 3 | size 18519 4 | -------------------------------------------------------------------------------- /.yarn/cache/lodash-npm-4.17.21-6382451519-4983720b9a.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:be9037b1bf81f7f9fd17f9d7ec032b9007498419c4e55d8081ce02847b13b924 3 | size 617983 4 | -------------------------------------------------------------------------------- /.yarn/cache/long-npm-4.0.0-ecd96a31ed-9cebc1ee8b.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f1983a3937d5e2317c1940ea573f1b84cf34f7f40c2e28a9e45948c602157623 3 | size 40633 4 | -------------------------------------------------------------------------------- /.yarn/cache/object-hash-npm-1.3.1-ea495b8e52-035cb0b0e6.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e1146874ebb460e175ddd5a547cec8f13cb3393595802229d207a0643716d198 3 | size 90142 4 | -------------------------------------------------------------------------------- /.yarn/cache/prettier-npm-2.3.0-29ef37e8b6-652640cc8b.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fcf82e8e67a26c93fbfd6db2ca31c79a65cd035f34586c4ebe33b47a87cb3d52 3 | size 4204917 4 | -------------------------------------------------------------------------------- /.yarn/cache/protobufjs-npm-6.11.2-9b422ce98e-3c7c6875ca.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:021e895bf63d6660df40684ad395de7e3af7324b658021c6cd929fc18cc0d80d 3 | size 1455286 4 | -------------------------------------------------------------------------------- /.yarn/cache/ts-poet-npm-4.5.0-5771bc00e9-8d8e59a29d.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9db3baf703eb53af744aa7cb77f69fb90593dcca393036d09d58f8a2730b9aa 3 | size 35105 4 | -------------------------------------------------------------------------------- /.yarn/cache/ts-proto-descriptors-npm-1.2.1-bdac3b6021-ad62bdf0a3.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f15eca06d282aa33be1b2089bb68f6d15e00975f1dacaa62af93b968ddd38353 3 | size 58205 4 | -------------------------------------------------------------------------------- /.yarn/cache/ts-proto-npm-1.81.1-638c7076bc-7d6f3387ea.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:89ba86f3d3bfda5df99e8a419bc0eeca72ef7aab55e92bb9f866178d4692afc8 3 | size 53866 4 | -------------------------------------------------------------------------------- /.yarn/cache/typescript-npm-4.0.7-e760e37efc-1b4c63a228.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d1a83f03a1aa8ac78f1400932860b334ab4dcc83b557d64a00f4da432304edf4 3 | size 9937612 4 | -------------------------------------------------------------------------------- /.yarn/cache/typescript-patch-92bf6e8d8b-f234923fbe.zip: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a2f7d42c02cef57e2160f320545ef6c81707dcc31f0056ac3f552c92ce0adcca 3 | size 9948568 4 | -------------------------------------------------------------------------------- /.yarn/sdks/integrations.yml: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by @yarnpkg/sdks. 2 | # Manual changes might be lost! 3 | 4 | integrations: 5 | - vscode 6 | -------------------------------------------------------------------------------- /.yarn/sdks/prettier/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require prettier/index.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real prettier/index.js your application uses 20 | module.exports = absRequire(`prettier/index.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/prettier/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prettier", 3 | "version": "2.3.0-sdk", 4 | "main": "./index.js", 5 | "type": "commonjs" 6 | } 7 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/bin/tsc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/bin/tsc 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/bin/tsc your application uses 20 | module.exports = absRequire(`typescript/bin/tsc`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/bin/tsserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/bin/tsserver 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/bin/tsserver your application uses 20 | module.exports = absRequire(`typescript/bin/tsserver`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/tsc.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/lib/tsc.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/lib/tsc.js your application uses 20 | module.exports = absRequire(`typescript/lib/tsc.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/tsserver.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | const moduleWrapper = tsserver => { 13 | if (!process.versions.pnp) { 14 | return tsserver; 15 | } 16 | 17 | const {isAbsolute} = require(`path`); 18 | const pnpApi = require(`pnpapi`); 19 | 20 | const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//); 21 | const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); 22 | 23 | const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => { 24 | return `${locator.name}@${locator.reference}`; 25 | })); 26 | 27 | // VSCode sends the zip paths to TS using the "zip://" prefix, that TS 28 | // doesn't understand. This layer makes sure to remove the protocol 29 | // before forwarding it to TS, and to add it back on all returned paths. 30 | 31 | function toEditorPath(str) { 32 | // We add the `zip:` prefix to both `.zip/` paths and virtual paths 33 | if (isAbsolute(str) && !str.match(/^\^zip:/) && (str.match(/\.zip\//) || isVirtual(str))) { 34 | // We also take the opportunity to turn virtual paths into physical ones; 35 | // this makes it much easier to work with workspaces that list peer 36 | // dependencies, since otherwise Ctrl+Click would bring us to the virtual 37 | // file instances instead of the real ones. 38 | // 39 | // We only do this to modules owned by the the dependency tree roots. 40 | // This avoids breaking the resolution when jumping inside a vendor 41 | // with peer dep (otherwise jumping into react-dom would show resolution 42 | // errors on react). 43 | // 44 | const resolved = isVirtual(str) ? pnpApi.resolveVirtual(str) : str; 45 | if (resolved) { 46 | const locator = pnpApi.findPackageLocator(resolved); 47 | if (locator && dependencyTreeRoots.has(`${locator.name}@${locator.reference}`)) { 48 | str = resolved; 49 | } 50 | } 51 | 52 | str = normalize(str); 53 | 54 | if (str.match(/\.zip\//)) { 55 | switch (hostInfo) { 56 | // Absolute VSCode `Uri.fsPath`s need to start with a slash. 57 | // VSCode only adds it automatically for supported schemes, 58 | // so we have to do it manually for the `zip` scheme. 59 | // The path needs to start with a caret otherwise VSCode doesn't handle the protocol 60 | // 61 | // Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910 62 | // 63 | case `vscode`: { 64 | str = `^zip:${str}`; 65 | } break; 66 | 67 | // To make "go to definition" work, 68 | // We have to resolve the actual file system path from virtual path 69 | // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) 70 | case `coc-nvim`: { 71 | str = normalize(resolved).replace(/\.zip\//, `.zip::`); 72 | str = resolve(`zipfile:${str}`); 73 | } break; 74 | 75 | // Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server) 76 | // We have to resolve the actual file system path from virtual path, 77 | // everything else is up to neovim 78 | case `neovim`: { 79 | str = normalize(resolved).replace(/\.zip\//, `.zip::`); 80 | str = `zipfile:${str}`; 81 | } break; 82 | 83 | default: { 84 | str = `zip:${str}`; 85 | } break; 86 | } 87 | } 88 | } 89 | 90 | return str; 91 | } 92 | 93 | function fromEditorPath(str) { 94 | return process.platform === `win32` 95 | ? str.replace(/^\^?zip:\//, ``) 96 | : str.replace(/^\^?zip:/, ``); 97 | } 98 | 99 | // Force enable 'allowLocalPluginLoads' 100 | // TypeScript tries to resolve plugins using a path relative to itself 101 | // which doesn't work when using the global cache 102 | // https://github.com/microsoft/TypeScript/blob/1b57a0395e0bff191581c9606aab92832001de62/src/server/project.ts#L2238 103 | // VSCode doesn't want to enable 'allowLocalPluginLoads' due to security concerns but 104 | // TypeScript already does local loads and if this code is running the user trusts the workspace 105 | // https://github.com/microsoft/vscode/issues/45856 106 | const ConfiguredProject = tsserver.server.ConfiguredProject; 107 | const {enablePluginsWithOptions: originalEnablePluginsWithOptions} = ConfiguredProject.prototype; 108 | ConfiguredProject.prototype.enablePluginsWithOptions = function() { 109 | this.projectService.allowLocalPluginLoads = true; 110 | return originalEnablePluginsWithOptions.apply(this, arguments); 111 | }; 112 | 113 | // And here is the point where we hijack the VSCode <-> TS communications 114 | // by adding ourselves in the middle. We locate everything that looks 115 | // like an absolute path of ours and normalize it. 116 | 117 | const Session = tsserver.server.Session; 118 | const {onMessage: originalOnMessage, send: originalSend} = Session.prototype; 119 | let hostInfo = `unknown`; 120 | 121 | Object.assign(Session.prototype, { 122 | onMessage(/** @type {string} */ message) { 123 | const parsedMessage = JSON.parse(message) 124 | 125 | if ( 126 | parsedMessage != null && 127 | typeof parsedMessage === `object` && 128 | parsedMessage.arguments && 129 | typeof parsedMessage.arguments.hostInfo === `string` 130 | ) { 131 | hostInfo = parsedMessage.arguments.hostInfo; 132 | } 133 | 134 | return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => { 135 | return typeof value === `string` ? fromEditorPath(value) : value; 136 | })); 137 | }, 138 | 139 | send(/** @type {any} */ msg) { 140 | return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => { 141 | return typeof value === `string` ? toEditorPath(value) : value; 142 | }))); 143 | } 144 | }); 145 | 146 | return tsserver; 147 | }; 148 | 149 | if (existsSync(absPnpApiPath)) { 150 | if (!process.versions.pnp) { 151 | // Setup the environment to be able to require typescript/lib/tsserver.js 152 | require(absPnpApiPath).setup(); 153 | } 154 | } 155 | 156 | // Defer to the real typescript/lib/tsserver.js your application uses 157 | module.exports = moduleWrapper(absRequire(`typescript/lib/tsserver.js`)); 158 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/tsserverlibrary.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | const moduleWrapper = tsserver => { 13 | if (!process.versions.pnp) { 14 | return tsserver; 15 | } 16 | 17 | const {isAbsolute} = require(`path`); 18 | const pnpApi = require(`pnpapi`); 19 | 20 | const isVirtual = str => str.match(/\/(\$\$virtual|__virtual__)\//); 21 | const normalize = str => str.replace(/\\/g, `/`).replace(/^\/?/, `/`); 22 | 23 | const dependencyTreeRoots = new Set(pnpApi.getDependencyTreeRoots().map(locator => { 24 | return `${locator.name}@${locator.reference}`; 25 | })); 26 | 27 | // VSCode sends the zip paths to TS using the "zip://" prefix, that TS 28 | // doesn't understand. This layer makes sure to remove the protocol 29 | // before forwarding it to TS, and to add it back on all returned paths. 30 | 31 | function toEditorPath(str) { 32 | // We add the `zip:` prefix to both `.zip/` paths and virtual paths 33 | if (isAbsolute(str) && !str.match(/^\^zip:/) && (str.match(/\.zip\//) || isVirtual(str))) { 34 | // We also take the opportunity to turn virtual paths into physical ones; 35 | // this makes it much easier to work with workspaces that list peer 36 | // dependencies, since otherwise Ctrl+Click would bring us to the virtual 37 | // file instances instead of the real ones. 38 | // 39 | // We only do this to modules owned by the the dependency tree roots. 40 | // This avoids breaking the resolution when jumping inside a vendor 41 | // with peer dep (otherwise jumping into react-dom would show resolution 42 | // errors on react). 43 | // 44 | const resolved = isVirtual(str) ? pnpApi.resolveVirtual(str) : str; 45 | if (resolved) { 46 | const locator = pnpApi.findPackageLocator(resolved); 47 | if (locator && dependencyTreeRoots.has(`${locator.name}@${locator.reference}`)) { 48 | str = resolved; 49 | } 50 | } 51 | 52 | str = normalize(str); 53 | 54 | if (str.match(/\.zip\//)) { 55 | switch (hostInfo) { 56 | // Absolute VSCode `Uri.fsPath`s need to start with a slash. 57 | // VSCode only adds it automatically for supported schemes, 58 | // so we have to do it manually for the `zip` scheme. 59 | // The path needs to start with a caret otherwise VSCode doesn't handle the protocol 60 | // 61 | // Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910 62 | // 63 | case `vscode`: { 64 | str = `^zip:${str}`; 65 | } break; 66 | 67 | // To make "go to definition" work, 68 | // We have to resolve the actual file system path from virtual path 69 | // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) 70 | case `coc-nvim`: { 71 | str = normalize(resolved).replace(/\.zip\//, `.zip::`); 72 | str = resolve(`zipfile:${str}`); 73 | } break; 74 | 75 | // Support neovim native LSP and [typescript-language-server](https://github.com/theia-ide/typescript-language-server) 76 | // We have to resolve the actual file system path from virtual path, 77 | // everything else is up to neovim 78 | case `neovim`: { 79 | str = normalize(resolved).replace(/\.zip\//, `.zip::`); 80 | str = `zipfile:${str}`; 81 | } break; 82 | 83 | default: { 84 | str = `zip:${str}`; 85 | } break; 86 | } 87 | } 88 | } 89 | 90 | return str; 91 | } 92 | 93 | function fromEditorPath(str) { 94 | return process.platform === `win32` 95 | ? str.replace(/^\^?zip:\//, ``) 96 | : str.replace(/^\^?zip:/, ``); 97 | } 98 | 99 | // Force enable 'allowLocalPluginLoads' 100 | // TypeScript tries to resolve plugins using a path relative to itself 101 | // which doesn't work when using the global cache 102 | // https://github.com/microsoft/TypeScript/blob/1b57a0395e0bff191581c9606aab92832001de62/src/server/project.ts#L2238 103 | // VSCode doesn't want to enable 'allowLocalPluginLoads' due to security concerns but 104 | // TypeScript already does local loads and if this code is running the user trusts the workspace 105 | // https://github.com/microsoft/vscode/issues/45856 106 | const ConfiguredProject = tsserver.server.ConfiguredProject; 107 | const {enablePluginsWithOptions: originalEnablePluginsWithOptions} = ConfiguredProject.prototype; 108 | ConfiguredProject.prototype.enablePluginsWithOptions = function() { 109 | this.projectService.allowLocalPluginLoads = true; 110 | return originalEnablePluginsWithOptions.apply(this, arguments); 111 | }; 112 | 113 | // And here is the point where we hijack the VSCode <-> TS communications 114 | // by adding ourselves in the middle. We locate everything that looks 115 | // like an absolute path of ours and normalize it. 116 | 117 | const Session = tsserver.server.Session; 118 | const {onMessage: originalOnMessage, send: originalSend} = Session.prototype; 119 | let hostInfo = `unknown`; 120 | 121 | Object.assign(Session.prototype, { 122 | onMessage(/** @type {string} */ message) { 123 | const parsedMessage = JSON.parse(message) 124 | 125 | if ( 126 | parsedMessage != null && 127 | typeof parsedMessage === `object` && 128 | parsedMessage.arguments && 129 | typeof parsedMessage.arguments.hostInfo === `string` 130 | ) { 131 | hostInfo = parsedMessage.arguments.hostInfo; 132 | } 133 | 134 | return originalOnMessage.call(this, JSON.stringify(parsedMessage, (key, value) => { 135 | return typeof value === `string` ? fromEditorPath(value) : value; 136 | })); 137 | }, 138 | 139 | send(/** @type {any} */ msg) { 140 | return originalSend.call(this, JSON.parse(JSON.stringify(msg, (key, value) => { 141 | return typeof value === `string` ? toEditorPath(value) : value; 142 | }))); 143 | } 144 | }); 145 | 146 | return tsserver; 147 | }; 148 | 149 | if (existsSync(absPnpApiPath)) { 150 | if (!process.versions.pnp) { 151 | // Setup the environment to be able to require typescript/lib/tsserverlibrary.js 152 | require(absPnpApiPath).setup(); 153 | } 154 | } 155 | 156 | // Defer to the real typescript/lib/tsserverlibrary.js your application uses 157 | module.exports = moduleWrapper(absRequire(`typescript/lib/tsserverlibrary.js`)); 158 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/lib/typescript.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const {existsSync} = require(`fs`); 4 | const {createRequire, createRequireFromPath} = require(`module`); 5 | const {resolve} = require(`path`); 6 | 7 | const relPnpApiPath = "../../../../.pnp.js"; 8 | 9 | const absPnpApiPath = resolve(__dirname, relPnpApiPath); 10 | const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath); 11 | 12 | if (existsSync(absPnpApiPath)) { 13 | if (!process.versions.pnp) { 14 | // Setup the environment to be able to require typescript/lib/typescript.js 15 | require(absPnpApiPath).setup(); 16 | } 17 | } 18 | 19 | // Defer to the real typescript/lib/typescript.js your application uses 20 | module.exports = absRequire(`typescript/lib/typescript.js`); 21 | -------------------------------------------------------------------------------- /.yarn/sdks/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "typescript", 3 | "version": "4.0.7-sdk", 4 | "main": "./lib/typescript.js", 5 | "type": "commonjs" 6 | } 7 | -------------------------------------------------------------------------------- /.yarn/versions/36774439.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirmaChain/cosmjs-types/fe7fed56ef9ef6b728e64baecc8be21a8f915d5b/.yarn/versions/36774439.yml -------------------------------------------------------------------------------- /.yarn/versions/4f152a06.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FirmaChain/cosmjs-types/fe7fed56ef9ef6b728e64baecc8be21a8f915d5b/.yarn/versions/4f152a06.yml -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | changesetBaseRefs: 2 | - "main" 3 | - "origin/main" 4 | - "upstream/main" 5 | 6 | enableTelemetry: false 7 | 8 | plugins: 9 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 10 | spec: "@yarnpkg/plugin-workspace-tools" 11 | - path: .yarn/plugins/@yarnpkg/plugin-version.cjs 12 | spec: "@yarnpkg/plugin-version" 13 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 14 | spec: "@yarnpkg/plugin-interactive-tools" 15 | 16 | preferInteractive: true 17 | 18 | yarnPath: .yarn/releases/yarn-2.4.1.cjs 19 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 6 | and this project adheres to 7 | [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 8 | 9 | ## [Unreleased] 10 | 11 | ## [0.2.0] - 2021-07-29 12 | 13 | ### Added 14 | 15 | - wasmd 0.18 types (cosmwasm/wasm/v1/*) 16 | 17 | [unreleased]: 18 | https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...HEAD 19 | [0.2.0]: 20 | https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cosmjs-types 2 | 3 | ## Maintenance 4 | 5 | This section is for maintainers of this repo, not users. 6 | 7 | ### Getting started 8 | 9 | ```sh 10 | # Pull external code 11 | git submodule init 12 | git submodule update 13 | 14 | # Install dependencies 15 | yarn install 16 | 17 | # Setup SDK for IDE support (see https://next.yarnpkg.com/getting-started/editor-sdks) 18 | yarn dlx @yarnpkg/sdks vscode 19 | ``` 20 | 21 | ### Rebuilding types 22 | 23 | ```sh 24 | yarn define-proto # Generate .ts files into ./src 25 | yarn build # Build .js/.d.ts files 26 | ``` 27 | -------------------------------------------------------------------------------- /bin/protoc-gen-ts_proto_yarn_2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S yarn node 2 | require('ts-proto/build/plugin') 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cosmjs-types", 3 | "version": "0.2.0", 4 | "description": "JS and TS types relating to Protocol Buffers used by Cosmos-SDK and other related projects", 5 | "contributors": [ 6 | "Will Clark " 7 | ], 8 | "license": "Apache-2.0", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/confio/cosmjs-types" 12 | }, 13 | "publishConfig": { 14 | "access": "public" 15 | }, 16 | "files": [ 17 | "confio/", 18 | "cosmos/", 19 | "cosmos_proto/", 20 | "cosmwasm/", 21 | "gogoproto/", 22 | "google/", 23 | "ibc/", 24 | "tendermint/", 25 | "*.md", 26 | "!wasmd-0.16/**/*.md", 27 | "!wasmd-0.18/**/*.md" 28 | ], 29 | "scripts": { 30 | "format": "prettier --write --loglevel warn \"./src/**/*.ts\"", 31 | "define-proto": "./scripts/define-proto.sh && yarn format", 32 | "prepare": "./scripts/prepare.sh", 33 | "build": "rm -rf ./build && tsc && yarn prepare" 34 | }, 35 | "dependencies": { 36 | "long": "^4.0.0", 37 | "protobufjs": "~6.11.2" 38 | }, 39 | "devDependencies": { 40 | "@types/long": "^4.0.1", 41 | "@types/node": "^15.6.2", 42 | "prettier": "^2.3.0", 43 | "ts-proto": "^1.81.1", 44 | "typescript": "~4.0" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /scripts/prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -o errexit -o nounset -o pipefail 3 | command -v shellcheck >/dev/null && shellcheck "$0" 4 | 5 | DIRS="confio cosmos cosmos_proto cosmwasm gogoproto google ibc tendermint" 6 | 7 | for dir in $DIRS; do 8 | rm -rf "$dir" 9 | cp -R "./build/$dir" ./ 10 | done 11 | -------------------------------------------------------------------------------- /src/cosmos/auth/v1beta1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Params } from "../../../cosmos/auth/v1beta1/auth"; 5 | import { Any } from "../../../google/protobuf/any"; 6 | 7 | export const protobufPackage = "cosmos.auth.v1beta1"; 8 | 9 | /** GenesisState defines the auth module's genesis state. */ 10 | export interface GenesisState { 11 | /** params defines all the paramaters of the module. */ 12 | params?: Params; 13 | /** accounts are the accounts present at genesis. */ 14 | accounts: Any[]; 15 | } 16 | 17 | const baseGenesisState: object = {}; 18 | 19 | export const GenesisState = { 20 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 21 | if (message.params !== undefined) { 22 | Params.encode(message.params, writer.uint32(10).fork()).ldelim(); 23 | } 24 | for (const v of message.accounts) { 25 | Any.encode(v!, writer.uint32(18).fork()).ldelim(); 26 | } 27 | return writer; 28 | }, 29 | 30 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 31 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 32 | let end = length === undefined ? reader.len : reader.pos + length; 33 | const message = { ...baseGenesisState } as GenesisState; 34 | message.accounts = []; 35 | while (reader.pos < end) { 36 | const tag = reader.uint32(); 37 | switch (tag >>> 3) { 38 | case 1: 39 | message.params = Params.decode(reader, reader.uint32()); 40 | break; 41 | case 2: 42 | message.accounts.push(Any.decode(reader, reader.uint32())); 43 | break; 44 | default: 45 | reader.skipType(tag & 7); 46 | break; 47 | } 48 | } 49 | return message; 50 | }, 51 | 52 | fromJSON(object: any): GenesisState { 53 | const message = { ...baseGenesisState } as GenesisState; 54 | message.accounts = []; 55 | if (object.params !== undefined && object.params !== null) { 56 | message.params = Params.fromJSON(object.params); 57 | } else { 58 | message.params = undefined; 59 | } 60 | if (object.accounts !== undefined && object.accounts !== null) { 61 | for (const e of object.accounts) { 62 | message.accounts.push(Any.fromJSON(e)); 63 | } 64 | } 65 | return message; 66 | }, 67 | 68 | toJSON(message: GenesisState): unknown { 69 | const obj: any = {}; 70 | message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); 71 | if (message.accounts) { 72 | obj.accounts = message.accounts.map((e) => (e ? Any.toJSON(e) : undefined)); 73 | } else { 74 | obj.accounts = []; 75 | } 76 | return obj; 77 | }, 78 | 79 | fromPartial(object: DeepPartial): GenesisState { 80 | const message = { ...baseGenesisState } as GenesisState; 81 | message.accounts = []; 82 | if (object.params !== undefined && object.params !== null) { 83 | message.params = Params.fromPartial(object.params); 84 | } else { 85 | message.params = undefined; 86 | } 87 | if (object.accounts !== undefined && object.accounts !== null) { 88 | for (const e of object.accounts) { 89 | message.accounts.push(Any.fromPartial(e)); 90 | } 91 | } 92 | return message; 93 | }, 94 | }; 95 | 96 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 97 | export type DeepPartial = T extends Builtin 98 | ? T 99 | : T extends Array 100 | ? Array> 101 | : T extends ReadonlyArray 102 | ? ReadonlyArray> 103 | : T extends {} 104 | ? { [K in keyof T]?: DeepPartial } 105 | : Partial; 106 | 107 | if (_m0.util.Long !== Long) { 108 | _m0.util.Long = Long as any; 109 | _m0.configure(); 110 | } 111 | -------------------------------------------------------------------------------- /src/cosmos/base/kv/v1beta1/kv.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.base.kv.v1beta1"; 6 | 7 | /** Pairs defines a repeated slice of Pair objects. */ 8 | export interface Pairs { 9 | pairs: Pair[]; 10 | } 11 | 12 | /** Pair defines a key/value bytes tuple. */ 13 | export interface Pair { 14 | key: Uint8Array; 15 | value: Uint8Array; 16 | } 17 | 18 | const basePairs: object = {}; 19 | 20 | export const Pairs = { 21 | encode(message: Pairs, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 22 | for (const v of message.pairs) { 23 | Pair.encode(v!, writer.uint32(10).fork()).ldelim(); 24 | } 25 | return writer; 26 | }, 27 | 28 | decode(input: _m0.Reader | Uint8Array, length?: number): Pairs { 29 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 30 | let end = length === undefined ? reader.len : reader.pos + length; 31 | const message = { ...basePairs } as Pairs; 32 | message.pairs = []; 33 | while (reader.pos < end) { 34 | const tag = reader.uint32(); 35 | switch (tag >>> 3) { 36 | case 1: 37 | message.pairs.push(Pair.decode(reader, reader.uint32())); 38 | break; 39 | default: 40 | reader.skipType(tag & 7); 41 | break; 42 | } 43 | } 44 | return message; 45 | }, 46 | 47 | fromJSON(object: any): Pairs { 48 | const message = { ...basePairs } as Pairs; 49 | message.pairs = []; 50 | if (object.pairs !== undefined && object.pairs !== null) { 51 | for (const e of object.pairs) { 52 | message.pairs.push(Pair.fromJSON(e)); 53 | } 54 | } 55 | return message; 56 | }, 57 | 58 | toJSON(message: Pairs): unknown { 59 | const obj: any = {}; 60 | if (message.pairs) { 61 | obj.pairs = message.pairs.map((e) => (e ? Pair.toJSON(e) : undefined)); 62 | } else { 63 | obj.pairs = []; 64 | } 65 | return obj; 66 | }, 67 | 68 | fromPartial(object: DeepPartial): Pairs { 69 | const message = { ...basePairs } as Pairs; 70 | message.pairs = []; 71 | if (object.pairs !== undefined && object.pairs !== null) { 72 | for (const e of object.pairs) { 73 | message.pairs.push(Pair.fromPartial(e)); 74 | } 75 | } 76 | return message; 77 | }, 78 | }; 79 | 80 | const basePair: object = {}; 81 | 82 | export const Pair = { 83 | encode(message: Pair, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 84 | if (message.key.length !== 0) { 85 | writer.uint32(10).bytes(message.key); 86 | } 87 | if (message.value.length !== 0) { 88 | writer.uint32(18).bytes(message.value); 89 | } 90 | return writer; 91 | }, 92 | 93 | decode(input: _m0.Reader | Uint8Array, length?: number): Pair { 94 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 95 | let end = length === undefined ? reader.len : reader.pos + length; 96 | const message = { ...basePair } as Pair; 97 | message.key = new Uint8Array(); 98 | message.value = new Uint8Array(); 99 | while (reader.pos < end) { 100 | const tag = reader.uint32(); 101 | switch (tag >>> 3) { 102 | case 1: 103 | message.key = reader.bytes(); 104 | break; 105 | case 2: 106 | message.value = reader.bytes(); 107 | break; 108 | default: 109 | reader.skipType(tag & 7); 110 | break; 111 | } 112 | } 113 | return message; 114 | }, 115 | 116 | fromJSON(object: any): Pair { 117 | const message = { ...basePair } as Pair; 118 | message.key = new Uint8Array(); 119 | message.value = new Uint8Array(); 120 | if (object.key !== undefined && object.key !== null) { 121 | message.key = bytesFromBase64(object.key); 122 | } 123 | if (object.value !== undefined && object.value !== null) { 124 | message.value = bytesFromBase64(object.value); 125 | } 126 | return message; 127 | }, 128 | 129 | toJSON(message: Pair): unknown { 130 | const obj: any = {}; 131 | message.key !== undefined && 132 | (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); 133 | message.value !== undefined && 134 | (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); 135 | return obj; 136 | }, 137 | 138 | fromPartial(object: DeepPartial): Pair { 139 | const message = { ...basePair } as Pair; 140 | if (object.key !== undefined && object.key !== null) { 141 | message.key = object.key; 142 | } else { 143 | message.key = new Uint8Array(); 144 | } 145 | if (object.value !== undefined && object.value !== null) { 146 | message.value = object.value; 147 | } else { 148 | message.value = new Uint8Array(); 149 | } 150 | return message; 151 | }, 152 | }; 153 | 154 | declare var self: any | undefined; 155 | declare var window: any | undefined; 156 | var globalThis: any = (() => { 157 | if (typeof globalThis !== "undefined") return globalThis; 158 | if (typeof self !== "undefined") return self; 159 | if (typeof window !== "undefined") return window; 160 | if (typeof global !== "undefined") return global; 161 | throw "Unable to locate global object"; 162 | })(); 163 | 164 | const atob: (b64: string) => string = 165 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 166 | function bytesFromBase64(b64: string): Uint8Array { 167 | const bin = atob(b64); 168 | const arr = new Uint8Array(bin.length); 169 | for (let i = 0; i < bin.length; ++i) { 170 | arr[i] = bin.charCodeAt(i); 171 | } 172 | return arr; 173 | } 174 | 175 | const btoa: (bin: string) => string = 176 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 177 | function base64FromBytes(arr: Uint8Array): string { 178 | const bin: string[] = []; 179 | for (let i = 0; i < arr.byteLength; ++i) { 180 | bin.push(String.fromCharCode(arr[i])); 181 | } 182 | return btoa(bin.join("")); 183 | } 184 | 185 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 186 | export type DeepPartial = T extends Builtin 187 | ? T 188 | : T extends Array 189 | ? Array> 190 | : T extends ReadonlyArray 191 | ? ReadonlyArray> 192 | : T extends {} 193 | ? { [K in keyof T]?: DeepPartial } 194 | : Partial; 195 | 196 | if (_m0.util.Long !== Long) { 197 | _m0.util.Long = Long as any; 198 | _m0.configure(); 199 | } 200 | -------------------------------------------------------------------------------- /src/cosmos/capability/v1beta1/capability.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.capability.v1beta1"; 6 | 7 | /** 8 | * Capability defines an implementation of an object capability. The index 9 | * provided to a Capability must be globally unique. 10 | */ 11 | export interface Capability { 12 | index: Long; 13 | } 14 | 15 | /** 16 | * Owner defines a single capability owner. An owner is defined by the name of 17 | * capability and the module name. 18 | */ 19 | export interface Owner { 20 | module: string; 21 | name: string; 22 | } 23 | 24 | /** 25 | * CapabilityOwners defines a set of owners of a single Capability. The set of 26 | * owners must be unique. 27 | */ 28 | export interface CapabilityOwners { 29 | owners: Owner[]; 30 | } 31 | 32 | const baseCapability: object = { index: Long.UZERO }; 33 | 34 | export const Capability = { 35 | encode(message: Capability, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 36 | if (!message.index.isZero()) { 37 | writer.uint32(8).uint64(message.index); 38 | } 39 | return writer; 40 | }, 41 | 42 | decode(input: _m0.Reader | Uint8Array, length?: number): Capability { 43 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 44 | let end = length === undefined ? reader.len : reader.pos + length; 45 | const message = { ...baseCapability } as Capability; 46 | while (reader.pos < end) { 47 | const tag = reader.uint32(); 48 | switch (tag >>> 3) { 49 | case 1: 50 | message.index = reader.uint64() as Long; 51 | break; 52 | default: 53 | reader.skipType(tag & 7); 54 | break; 55 | } 56 | } 57 | return message; 58 | }, 59 | 60 | fromJSON(object: any): Capability { 61 | const message = { ...baseCapability } as Capability; 62 | if (object.index !== undefined && object.index !== null) { 63 | message.index = Long.fromString(object.index); 64 | } else { 65 | message.index = Long.UZERO; 66 | } 67 | return message; 68 | }, 69 | 70 | toJSON(message: Capability): unknown { 71 | const obj: any = {}; 72 | message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); 73 | return obj; 74 | }, 75 | 76 | fromPartial(object: DeepPartial): Capability { 77 | const message = { ...baseCapability } as Capability; 78 | if (object.index !== undefined && object.index !== null) { 79 | message.index = object.index as Long; 80 | } else { 81 | message.index = Long.UZERO; 82 | } 83 | return message; 84 | }, 85 | }; 86 | 87 | const baseOwner: object = { module: "", name: "" }; 88 | 89 | export const Owner = { 90 | encode(message: Owner, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 91 | if (message.module !== "") { 92 | writer.uint32(10).string(message.module); 93 | } 94 | if (message.name !== "") { 95 | writer.uint32(18).string(message.name); 96 | } 97 | return writer; 98 | }, 99 | 100 | decode(input: _m0.Reader | Uint8Array, length?: number): Owner { 101 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 102 | let end = length === undefined ? reader.len : reader.pos + length; 103 | const message = { ...baseOwner } as Owner; 104 | while (reader.pos < end) { 105 | const tag = reader.uint32(); 106 | switch (tag >>> 3) { 107 | case 1: 108 | message.module = reader.string(); 109 | break; 110 | case 2: 111 | message.name = reader.string(); 112 | break; 113 | default: 114 | reader.skipType(tag & 7); 115 | break; 116 | } 117 | } 118 | return message; 119 | }, 120 | 121 | fromJSON(object: any): Owner { 122 | const message = { ...baseOwner } as Owner; 123 | if (object.module !== undefined && object.module !== null) { 124 | message.module = String(object.module); 125 | } else { 126 | message.module = ""; 127 | } 128 | if (object.name !== undefined && object.name !== null) { 129 | message.name = String(object.name); 130 | } else { 131 | message.name = ""; 132 | } 133 | return message; 134 | }, 135 | 136 | toJSON(message: Owner): unknown { 137 | const obj: any = {}; 138 | message.module !== undefined && (obj.module = message.module); 139 | message.name !== undefined && (obj.name = message.name); 140 | return obj; 141 | }, 142 | 143 | fromPartial(object: DeepPartial): Owner { 144 | const message = { ...baseOwner } as Owner; 145 | if (object.module !== undefined && object.module !== null) { 146 | message.module = object.module; 147 | } else { 148 | message.module = ""; 149 | } 150 | if (object.name !== undefined && object.name !== null) { 151 | message.name = object.name; 152 | } else { 153 | message.name = ""; 154 | } 155 | return message; 156 | }, 157 | }; 158 | 159 | const baseCapabilityOwners: object = {}; 160 | 161 | export const CapabilityOwners = { 162 | encode(message: CapabilityOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 163 | for (const v of message.owners) { 164 | Owner.encode(v!, writer.uint32(10).fork()).ldelim(); 165 | } 166 | return writer; 167 | }, 168 | 169 | decode(input: _m0.Reader | Uint8Array, length?: number): CapabilityOwners { 170 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 171 | let end = length === undefined ? reader.len : reader.pos + length; 172 | const message = { ...baseCapabilityOwners } as CapabilityOwners; 173 | message.owners = []; 174 | while (reader.pos < end) { 175 | const tag = reader.uint32(); 176 | switch (tag >>> 3) { 177 | case 1: 178 | message.owners.push(Owner.decode(reader, reader.uint32())); 179 | break; 180 | default: 181 | reader.skipType(tag & 7); 182 | break; 183 | } 184 | } 185 | return message; 186 | }, 187 | 188 | fromJSON(object: any): CapabilityOwners { 189 | const message = { ...baseCapabilityOwners } as CapabilityOwners; 190 | message.owners = []; 191 | if (object.owners !== undefined && object.owners !== null) { 192 | for (const e of object.owners) { 193 | message.owners.push(Owner.fromJSON(e)); 194 | } 195 | } 196 | return message; 197 | }, 198 | 199 | toJSON(message: CapabilityOwners): unknown { 200 | const obj: any = {}; 201 | if (message.owners) { 202 | obj.owners = message.owners.map((e) => (e ? Owner.toJSON(e) : undefined)); 203 | } else { 204 | obj.owners = []; 205 | } 206 | return obj; 207 | }, 208 | 209 | fromPartial(object: DeepPartial): CapabilityOwners { 210 | const message = { ...baseCapabilityOwners } as CapabilityOwners; 211 | message.owners = []; 212 | if (object.owners !== undefined && object.owners !== null) { 213 | for (const e of object.owners) { 214 | message.owners.push(Owner.fromPartial(e)); 215 | } 216 | } 217 | return message; 218 | }, 219 | }; 220 | 221 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 222 | export type DeepPartial = T extends Builtin 223 | ? T 224 | : T extends Array 225 | ? Array> 226 | : T extends ReadonlyArray 227 | ? ReadonlyArray> 228 | : T extends {} 229 | ? { [K in keyof T]?: DeepPartial } 230 | : Partial; 231 | 232 | if (_m0.util.Long !== Long) { 233 | _m0.util.Long = Long as any; 234 | _m0.configure(); 235 | } 236 | -------------------------------------------------------------------------------- /src/cosmos/capability/v1beta1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { CapabilityOwners } from "../../../cosmos/capability/v1beta1/capability"; 5 | 6 | export const protobufPackage = "cosmos.capability.v1beta1"; 7 | 8 | /** GenesisOwners defines the capability owners with their corresponding index. */ 9 | export interface GenesisOwners { 10 | /** index is the index of the capability owner. */ 11 | index: Long; 12 | /** index_owners are the owners at the given index. */ 13 | indexOwners?: CapabilityOwners; 14 | } 15 | 16 | /** GenesisState defines the capability module's genesis state. */ 17 | export interface GenesisState { 18 | /** index is the capability global index. */ 19 | index: Long; 20 | /** 21 | * owners represents a map from index to owners of the capability index 22 | * index key is string to allow amino marshalling. 23 | */ 24 | owners: GenesisOwners[]; 25 | } 26 | 27 | const baseGenesisOwners: object = { index: Long.UZERO }; 28 | 29 | export const GenesisOwners = { 30 | encode(message: GenesisOwners, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 31 | if (!message.index.isZero()) { 32 | writer.uint32(8).uint64(message.index); 33 | } 34 | if (message.indexOwners !== undefined) { 35 | CapabilityOwners.encode(message.indexOwners, writer.uint32(18).fork()).ldelim(); 36 | } 37 | return writer; 38 | }, 39 | 40 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisOwners { 41 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 42 | let end = length === undefined ? reader.len : reader.pos + length; 43 | const message = { ...baseGenesisOwners } as GenesisOwners; 44 | while (reader.pos < end) { 45 | const tag = reader.uint32(); 46 | switch (tag >>> 3) { 47 | case 1: 48 | message.index = reader.uint64() as Long; 49 | break; 50 | case 2: 51 | message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()); 52 | break; 53 | default: 54 | reader.skipType(tag & 7); 55 | break; 56 | } 57 | } 58 | return message; 59 | }, 60 | 61 | fromJSON(object: any): GenesisOwners { 62 | const message = { ...baseGenesisOwners } as GenesisOwners; 63 | if (object.index !== undefined && object.index !== null) { 64 | message.index = Long.fromString(object.index); 65 | } else { 66 | message.index = Long.UZERO; 67 | } 68 | if (object.indexOwners !== undefined && object.indexOwners !== null) { 69 | message.indexOwners = CapabilityOwners.fromJSON(object.indexOwners); 70 | } else { 71 | message.indexOwners = undefined; 72 | } 73 | return message; 74 | }, 75 | 76 | toJSON(message: GenesisOwners): unknown { 77 | const obj: any = {}; 78 | message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); 79 | message.indexOwners !== undefined && 80 | (obj.indexOwners = message.indexOwners ? CapabilityOwners.toJSON(message.indexOwners) : undefined); 81 | return obj; 82 | }, 83 | 84 | fromPartial(object: DeepPartial): GenesisOwners { 85 | const message = { ...baseGenesisOwners } as GenesisOwners; 86 | if (object.index !== undefined && object.index !== null) { 87 | message.index = object.index as Long; 88 | } else { 89 | message.index = Long.UZERO; 90 | } 91 | if (object.indexOwners !== undefined && object.indexOwners !== null) { 92 | message.indexOwners = CapabilityOwners.fromPartial(object.indexOwners); 93 | } else { 94 | message.indexOwners = undefined; 95 | } 96 | return message; 97 | }, 98 | }; 99 | 100 | const baseGenesisState: object = { index: Long.UZERO }; 101 | 102 | export const GenesisState = { 103 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 104 | if (!message.index.isZero()) { 105 | writer.uint32(8).uint64(message.index); 106 | } 107 | for (const v of message.owners) { 108 | GenesisOwners.encode(v!, writer.uint32(18).fork()).ldelim(); 109 | } 110 | return writer; 111 | }, 112 | 113 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 114 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 115 | let end = length === undefined ? reader.len : reader.pos + length; 116 | const message = { ...baseGenesisState } as GenesisState; 117 | message.owners = []; 118 | while (reader.pos < end) { 119 | const tag = reader.uint32(); 120 | switch (tag >>> 3) { 121 | case 1: 122 | message.index = reader.uint64() as Long; 123 | break; 124 | case 2: 125 | message.owners.push(GenesisOwners.decode(reader, reader.uint32())); 126 | break; 127 | default: 128 | reader.skipType(tag & 7); 129 | break; 130 | } 131 | } 132 | return message; 133 | }, 134 | 135 | fromJSON(object: any): GenesisState { 136 | const message = { ...baseGenesisState } as GenesisState; 137 | message.owners = []; 138 | if (object.index !== undefined && object.index !== null) { 139 | message.index = Long.fromString(object.index); 140 | } else { 141 | message.index = Long.UZERO; 142 | } 143 | if (object.owners !== undefined && object.owners !== null) { 144 | for (const e of object.owners) { 145 | message.owners.push(GenesisOwners.fromJSON(e)); 146 | } 147 | } 148 | return message; 149 | }, 150 | 151 | toJSON(message: GenesisState): unknown { 152 | const obj: any = {}; 153 | message.index !== undefined && (obj.index = (message.index || Long.UZERO).toString()); 154 | if (message.owners) { 155 | obj.owners = message.owners.map((e) => (e ? GenesisOwners.toJSON(e) : undefined)); 156 | } else { 157 | obj.owners = []; 158 | } 159 | return obj; 160 | }, 161 | 162 | fromPartial(object: DeepPartial): GenesisState { 163 | const message = { ...baseGenesisState } as GenesisState; 164 | message.owners = []; 165 | if (object.index !== undefined && object.index !== null) { 166 | message.index = object.index as Long; 167 | } else { 168 | message.index = Long.UZERO; 169 | } 170 | if (object.owners !== undefined && object.owners !== null) { 171 | for (const e of object.owners) { 172 | message.owners.push(GenesisOwners.fromPartial(e)); 173 | } 174 | } 175 | return message; 176 | }, 177 | }; 178 | 179 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 180 | export type DeepPartial = T extends Builtin 181 | ? T 182 | : T extends Array 183 | ? Array> 184 | : T extends ReadonlyArray 185 | ? ReadonlyArray> 186 | : T extends {} 187 | ? { [K in keyof T]?: DeepPartial } 188 | : Partial; 189 | 190 | if (_m0.util.Long !== Long) { 191 | _m0.util.Long = Long as any; 192 | _m0.configure(); 193 | } 194 | -------------------------------------------------------------------------------- /src/cosmos/crisis/v1beta1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Coin } from "../../../cosmos/base/v1beta1/coin"; 5 | 6 | export const protobufPackage = "cosmos.crisis.v1beta1"; 7 | 8 | /** GenesisState defines the crisis module's genesis state. */ 9 | export interface GenesisState { 10 | /** 11 | * constant_fee is the fee used to verify the invariant in the crisis 12 | * module. 13 | */ 14 | constantFee?: Coin; 15 | } 16 | 17 | const baseGenesisState: object = {}; 18 | 19 | export const GenesisState = { 20 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 21 | if (message.constantFee !== undefined) { 22 | Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim(); 23 | } 24 | return writer; 25 | }, 26 | 27 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 28 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 29 | let end = length === undefined ? reader.len : reader.pos + length; 30 | const message = { ...baseGenesisState } as GenesisState; 31 | while (reader.pos < end) { 32 | const tag = reader.uint32(); 33 | switch (tag >>> 3) { 34 | case 3: 35 | message.constantFee = Coin.decode(reader, reader.uint32()); 36 | break; 37 | default: 38 | reader.skipType(tag & 7); 39 | break; 40 | } 41 | } 42 | return message; 43 | }, 44 | 45 | fromJSON(object: any): GenesisState { 46 | const message = { ...baseGenesisState } as GenesisState; 47 | if (object.constantFee !== undefined && object.constantFee !== null) { 48 | message.constantFee = Coin.fromJSON(object.constantFee); 49 | } else { 50 | message.constantFee = undefined; 51 | } 52 | return message; 53 | }, 54 | 55 | toJSON(message: GenesisState): unknown { 56 | const obj: any = {}; 57 | message.constantFee !== undefined && 58 | (obj.constantFee = message.constantFee ? Coin.toJSON(message.constantFee) : undefined); 59 | return obj; 60 | }, 61 | 62 | fromPartial(object: DeepPartial): GenesisState { 63 | const message = { ...baseGenesisState } as GenesisState; 64 | if (object.constantFee !== undefined && object.constantFee !== null) { 65 | message.constantFee = Coin.fromPartial(object.constantFee); 66 | } else { 67 | message.constantFee = undefined; 68 | } 69 | return message; 70 | }, 71 | }; 72 | 73 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 74 | export type DeepPartial = T extends Builtin 75 | ? T 76 | : T extends Array 77 | ? Array> 78 | : T extends ReadonlyArray 79 | ? ReadonlyArray> 80 | : T extends {} 81 | ? { [K in keyof T]?: DeepPartial } 82 | : Partial; 83 | 84 | if (_m0.util.Long !== Long) { 85 | _m0.util.Long = Long as any; 86 | _m0.configure(); 87 | } 88 | -------------------------------------------------------------------------------- /src/cosmos/crisis/v1beta1/tx.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.crisis.v1beta1"; 6 | 7 | /** MsgVerifyInvariant represents a message to verify a particular invariance. */ 8 | export interface MsgVerifyInvariant { 9 | sender: string; 10 | invariantModuleName: string; 11 | invariantRoute: string; 12 | } 13 | 14 | /** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ 15 | export interface MsgVerifyInvariantResponse {} 16 | 17 | const baseMsgVerifyInvariant: object = { sender: "", invariantModuleName: "", invariantRoute: "" }; 18 | 19 | export const MsgVerifyInvariant = { 20 | encode(message: MsgVerifyInvariant, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 21 | if (message.sender !== "") { 22 | writer.uint32(10).string(message.sender); 23 | } 24 | if (message.invariantModuleName !== "") { 25 | writer.uint32(18).string(message.invariantModuleName); 26 | } 27 | if (message.invariantRoute !== "") { 28 | writer.uint32(26).string(message.invariantRoute); 29 | } 30 | return writer; 31 | }, 32 | 33 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariant { 34 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 35 | let end = length === undefined ? reader.len : reader.pos + length; 36 | const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; 37 | while (reader.pos < end) { 38 | const tag = reader.uint32(); 39 | switch (tag >>> 3) { 40 | case 1: 41 | message.sender = reader.string(); 42 | break; 43 | case 2: 44 | message.invariantModuleName = reader.string(); 45 | break; 46 | case 3: 47 | message.invariantRoute = reader.string(); 48 | break; 49 | default: 50 | reader.skipType(tag & 7); 51 | break; 52 | } 53 | } 54 | return message; 55 | }, 56 | 57 | fromJSON(object: any): MsgVerifyInvariant { 58 | const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; 59 | if (object.sender !== undefined && object.sender !== null) { 60 | message.sender = String(object.sender); 61 | } else { 62 | message.sender = ""; 63 | } 64 | if (object.invariantModuleName !== undefined && object.invariantModuleName !== null) { 65 | message.invariantModuleName = String(object.invariantModuleName); 66 | } else { 67 | message.invariantModuleName = ""; 68 | } 69 | if (object.invariantRoute !== undefined && object.invariantRoute !== null) { 70 | message.invariantRoute = String(object.invariantRoute); 71 | } else { 72 | message.invariantRoute = ""; 73 | } 74 | return message; 75 | }, 76 | 77 | toJSON(message: MsgVerifyInvariant): unknown { 78 | const obj: any = {}; 79 | message.sender !== undefined && (obj.sender = message.sender); 80 | message.invariantModuleName !== undefined && (obj.invariantModuleName = message.invariantModuleName); 81 | message.invariantRoute !== undefined && (obj.invariantRoute = message.invariantRoute); 82 | return obj; 83 | }, 84 | 85 | fromPartial(object: DeepPartial): MsgVerifyInvariant { 86 | const message = { ...baseMsgVerifyInvariant } as MsgVerifyInvariant; 87 | if (object.sender !== undefined && object.sender !== null) { 88 | message.sender = object.sender; 89 | } else { 90 | message.sender = ""; 91 | } 92 | if (object.invariantModuleName !== undefined && object.invariantModuleName !== null) { 93 | message.invariantModuleName = object.invariantModuleName; 94 | } else { 95 | message.invariantModuleName = ""; 96 | } 97 | if (object.invariantRoute !== undefined && object.invariantRoute !== null) { 98 | message.invariantRoute = object.invariantRoute; 99 | } else { 100 | message.invariantRoute = ""; 101 | } 102 | return message; 103 | }, 104 | }; 105 | 106 | const baseMsgVerifyInvariantResponse: object = {}; 107 | 108 | export const MsgVerifyInvariantResponse = { 109 | encode(_: MsgVerifyInvariantResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 110 | return writer; 111 | }, 112 | 113 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgVerifyInvariantResponse { 114 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 115 | let end = length === undefined ? reader.len : reader.pos + length; 116 | const message = { ...baseMsgVerifyInvariantResponse } as MsgVerifyInvariantResponse; 117 | while (reader.pos < end) { 118 | const tag = reader.uint32(); 119 | switch (tag >>> 3) { 120 | default: 121 | reader.skipType(tag & 7); 122 | break; 123 | } 124 | } 125 | return message; 126 | }, 127 | 128 | fromJSON(_: any): MsgVerifyInvariantResponse { 129 | const message = { ...baseMsgVerifyInvariantResponse } as MsgVerifyInvariantResponse; 130 | return message; 131 | }, 132 | 133 | toJSON(_: MsgVerifyInvariantResponse): unknown { 134 | const obj: any = {}; 135 | return obj; 136 | }, 137 | 138 | fromPartial(_: DeepPartial): MsgVerifyInvariantResponse { 139 | const message = { ...baseMsgVerifyInvariantResponse } as MsgVerifyInvariantResponse; 140 | return message; 141 | }, 142 | }; 143 | 144 | /** Msg defines the bank Msg service. */ 145 | export interface Msg { 146 | /** VerifyInvariant defines a method to verify a particular invariance. */ 147 | VerifyInvariant(request: MsgVerifyInvariant): Promise; 148 | } 149 | 150 | export class MsgClientImpl implements Msg { 151 | private readonly rpc: Rpc; 152 | constructor(rpc: Rpc) { 153 | this.rpc = rpc; 154 | this.VerifyInvariant = this.VerifyInvariant.bind(this); 155 | } 156 | VerifyInvariant(request: MsgVerifyInvariant): Promise { 157 | const data = MsgVerifyInvariant.encode(request).finish(); 158 | const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); 159 | return promise.then((data) => MsgVerifyInvariantResponse.decode(new _m0.Reader(data))); 160 | } 161 | } 162 | 163 | interface Rpc { 164 | request(service: string, method: string, data: Uint8Array): Promise; 165 | } 166 | 167 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 168 | export type DeepPartial = T extends Builtin 169 | ? T 170 | : T extends Array 171 | ? Array> 172 | : T extends ReadonlyArray 173 | ? ReadonlyArray> 174 | : T extends {} 175 | ? { [K in keyof T]?: DeepPartial } 176 | : Partial; 177 | 178 | if (_m0.util.Long !== Long) { 179 | _m0.util.Long = Long as any; 180 | _m0.configure(); 181 | } 182 | -------------------------------------------------------------------------------- /src/cosmos/crypto/ed25519/keys.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.crypto.ed25519"; 6 | 7 | /** 8 | * PubKey defines a ed25519 public key 9 | * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte 10 | * if the y-coordinate is the lexicographically largest of the two associated with 11 | * the x-coordinate. Otherwise the first byte is a 0x03. 12 | * This prefix is followed with the x-coordinate. 13 | */ 14 | export interface PubKey { 15 | key: Uint8Array; 16 | } 17 | 18 | /** PrivKey defines a ed25519 private key. */ 19 | export interface PrivKey { 20 | key: Uint8Array; 21 | } 22 | 23 | const basePubKey: object = {}; 24 | 25 | export const PubKey = { 26 | encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 27 | if (message.key.length !== 0) { 28 | writer.uint32(10).bytes(message.key); 29 | } 30 | return writer; 31 | }, 32 | 33 | decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { 34 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 35 | let end = length === undefined ? reader.len : reader.pos + length; 36 | const message = { ...basePubKey } as PubKey; 37 | message.key = new Uint8Array(); 38 | while (reader.pos < end) { 39 | const tag = reader.uint32(); 40 | switch (tag >>> 3) { 41 | case 1: 42 | message.key = reader.bytes(); 43 | break; 44 | default: 45 | reader.skipType(tag & 7); 46 | break; 47 | } 48 | } 49 | return message; 50 | }, 51 | 52 | fromJSON(object: any): PubKey { 53 | const message = { ...basePubKey } as PubKey; 54 | message.key = new Uint8Array(); 55 | if (object.key !== undefined && object.key !== null) { 56 | message.key = bytesFromBase64(object.key); 57 | } 58 | return message; 59 | }, 60 | 61 | toJSON(message: PubKey): unknown { 62 | const obj: any = {}; 63 | message.key !== undefined && 64 | (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); 65 | return obj; 66 | }, 67 | 68 | fromPartial(object: DeepPartial): PubKey { 69 | const message = { ...basePubKey } as PubKey; 70 | if (object.key !== undefined && object.key !== null) { 71 | message.key = object.key; 72 | } else { 73 | message.key = new Uint8Array(); 74 | } 75 | return message; 76 | }, 77 | }; 78 | 79 | const basePrivKey: object = {}; 80 | 81 | export const PrivKey = { 82 | encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 83 | if (message.key.length !== 0) { 84 | writer.uint32(10).bytes(message.key); 85 | } 86 | return writer; 87 | }, 88 | 89 | decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { 90 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 91 | let end = length === undefined ? reader.len : reader.pos + length; 92 | const message = { ...basePrivKey } as PrivKey; 93 | message.key = new Uint8Array(); 94 | while (reader.pos < end) { 95 | const tag = reader.uint32(); 96 | switch (tag >>> 3) { 97 | case 1: 98 | message.key = reader.bytes(); 99 | break; 100 | default: 101 | reader.skipType(tag & 7); 102 | break; 103 | } 104 | } 105 | return message; 106 | }, 107 | 108 | fromJSON(object: any): PrivKey { 109 | const message = { ...basePrivKey } as PrivKey; 110 | message.key = new Uint8Array(); 111 | if (object.key !== undefined && object.key !== null) { 112 | message.key = bytesFromBase64(object.key); 113 | } 114 | return message; 115 | }, 116 | 117 | toJSON(message: PrivKey): unknown { 118 | const obj: any = {}; 119 | message.key !== undefined && 120 | (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); 121 | return obj; 122 | }, 123 | 124 | fromPartial(object: DeepPartial): PrivKey { 125 | const message = { ...basePrivKey } as PrivKey; 126 | if (object.key !== undefined && object.key !== null) { 127 | message.key = object.key; 128 | } else { 129 | message.key = new Uint8Array(); 130 | } 131 | return message; 132 | }, 133 | }; 134 | 135 | declare var self: any | undefined; 136 | declare var window: any | undefined; 137 | var globalThis: any = (() => { 138 | if (typeof globalThis !== "undefined") return globalThis; 139 | if (typeof self !== "undefined") return self; 140 | if (typeof window !== "undefined") return window; 141 | if (typeof global !== "undefined") return global; 142 | throw "Unable to locate global object"; 143 | })(); 144 | 145 | const atob: (b64: string) => string = 146 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 147 | function bytesFromBase64(b64: string): Uint8Array { 148 | const bin = atob(b64); 149 | const arr = new Uint8Array(bin.length); 150 | for (let i = 0; i < bin.length; ++i) { 151 | arr[i] = bin.charCodeAt(i); 152 | } 153 | return arr; 154 | } 155 | 156 | const btoa: (bin: string) => string = 157 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 158 | function base64FromBytes(arr: Uint8Array): string { 159 | const bin: string[] = []; 160 | for (let i = 0; i < arr.byteLength; ++i) { 161 | bin.push(String.fromCharCode(arr[i])); 162 | } 163 | return btoa(bin.join("")); 164 | } 165 | 166 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 167 | export type DeepPartial = T extends Builtin 168 | ? T 169 | : T extends Array 170 | ? Array> 171 | : T extends ReadonlyArray 172 | ? ReadonlyArray> 173 | : T extends {} 174 | ? { [K in keyof T]?: DeepPartial } 175 | : Partial; 176 | 177 | if (_m0.util.Long !== Long) { 178 | _m0.util.Long = Long as any; 179 | _m0.configure(); 180 | } 181 | -------------------------------------------------------------------------------- /src/cosmos/crypto/multisig/keys.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Any } from "../../../google/protobuf/any"; 5 | 6 | export const protobufPackage = "cosmos.crypto.multisig"; 7 | 8 | /** 9 | * LegacyAminoPubKey specifies a public key type 10 | * which nests multiple public keys and a threshold, 11 | * it uses legacy amino address rules. 12 | */ 13 | export interface LegacyAminoPubKey { 14 | threshold: number; 15 | publicKeys: Any[]; 16 | } 17 | 18 | const baseLegacyAminoPubKey: object = { threshold: 0 }; 19 | 20 | export const LegacyAminoPubKey = { 21 | encode(message: LegacyAminoPubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 22 | if (message.threshold !== 0) { 23 | writer.uint32(8).uint32(message.threshold); 24 | } 25 | for (const v of message.publicKeys) { 26 | Any.encode(v!, writer.uint32(18).fork()).ldelim(); 27 | } 28 | return writer; 29 | }, 30 | 31 | decode(input: _m0.Reader | Uint8Array, length?: number): LegacyAminoPubKey { 32 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 33 | let end = length === undefined ? reader.len : reader.pos + length; 34 | const message = { ...baseLegacyAminoPubKey } as LegacyAminoPubKey; 35 | message.publicKeys = []; 36 | while (reader.pos < end) { 37 | const tag = reader.uint32(); 38 | switch (tag >>> 3) { 39 | case 1: 40 | message.threshold = reader.uint32(); 41 | break; 42 | case 2: 43 | message.publicKeys.push(Any.decode(reader, reader.uint32())); 44 | break; 45 | default: 46 | reader.skipType(tag & 7); 47 | break; 48 | } 49 | } 50 | return message; 51 | }, 52 | 53 | fromJSON(object: any): LegacyAminoPubKey { 54 | const message = { ...baseLegacyAminoPubKey } as LegacyAminoPubKey; 55 | message.publicKeys = []; 56 | if (object.threshold !== undefined && object.threshold !== null) { 57 | message.threshold = Number(object.threshold); 58 | } else { 59 | message.threshold = 0; 60 | } 61 | if (object.publicKeys !== undefined && object.publicKeys !== null) { 62 | for (const e of object.publicKeys) { 63 | message.publicKeys.push(Any.fromJSON(e)); 64 | } 65 | } 66 | return message; 67 | }, 68 | 69 | toJSON(message: LegacyAminoPubKey): unknown { 70 | const obj: any = {}; 71 | message.threshold !== undefined && (obj.threshold = message.threshold); 72 | if (message.publicKeys) { 73 | obj.publicKeys = message.publicKeys.map((e) => (e ? Any.toJSON(e) : undefined)); 74 | } else { 75 | obj.publicKeys = []; 76 | } 77 | return obj; 78 | }, 79 | 80 | fromPartial(object: DeepPartial): LegacyAminoPubKey { 81 | const message = { ...baseLegacyAminoPubKey } as LegacyAminoPubKey; 82 | message.publicKeys = []; 83 | if (object.threshold !== undefined && object.threshold !== null) { 84 | message.threshold = object.threshold; 85 | } else { 86 | message.threshold = 0; 87 | } 88 | if (object.publicKeys !== undefined && object.publicKeys !== null) { 89 | for (const e of object.publicKeys) { 90 | message.publicKeys.push(Any.fromPartial(e)); 91 | } 92 | } 93 | return message; 94 | }, 95 | }; 96 | 97 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 98 | export type DeepPartial = T extends Builtin 99 | ? T 100 | : T extends Array 101 | ? Array> 102 | : T extends ReadonlyArray 103 | ? ReadonlyArray> 104 | : T extends {} 105 | ? { [K in keyof T]?: DeepPartial } 106 | : Partial; 107 | 108 | if (_m0.util.Long !== Long) { 109 | _m0.util.Long = Long as any; 110 | _m0.configure(); 111 | } 112 | -------------------------------------------------------------------------------- /src/cosmos/crypto/multisig/v1beta1/multisig.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.crypto.multisig.v1beta1"; 6 | 7 | /** 8 | * MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. 9 | * See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers 10 | * signed and with which modes. 11 | */ 12 | export interface MultiSignature { 13 | signatures: Uint8Array[]; 14 | } 15 | 16 | /** 17 | * CompactBitArray is an implementation of a space efficient bit array. 18 | * This is used to ensure that the encoded data takes up a minimal amount of 19 | * space after proto encoding. 20 | * This is not thread safe, and is not intended for concurrent usage. 21 | */ 22 | export interface CompactBitArray { 23 | extraBitsStored: number; 24 | elems: Uint8Array; 25 | } 26 | 27 | const baseMultiSignature: object = {}; 28 | 29 | export const MultiSignature = { 30 | encode(message: MultiSignature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 31 | for (const v of message.signatures) { 32 | writer.uint32(10).bytes(v!); 33 | } 34 | return writer; 35 | }, 36 | 37 | decode(input: _m0.Reader | Uint8Array, length?: number): MultiSignature { 38 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 39 | let end = length === undefined ? reader.len : reader.pos + length; 40 | const message = { ...baseMultiSignature } as MultiSignature; 41 | message.signatures = []; 42 | while (reader.pos < end) { 43 | const tag = reader.uint32(); 44 | switch (tag >>> 3) { 45 | case 1: 46 | message.signatures.push(reader.bytes()); 47 | break; 48 | default: 49 | reader.skipType(tag & 7); 50 | break; 51 | } 52 | } 53 | return message; 54 | }, 55 | 56 | fromJSON(object: any): MultiSignature { 57 | const message = { ...baseMultiSignature } as MultiSignature; 58 | message.signatures = []; 59 | if (object.signatures !== undefined && object.signatures !== null) { 60 | for (const e of object.signatures) { 61 | message.signatures.push(bytesFromBase64(e)); 62 | } 63 | } 64 | return message; 65 | }, 66 | 67 | toJSON(message: MultiSignature): unknown { 68 | const obj: any = {}; 69 | if (message.signatures) { 70 | obj.signatures = message.signatures.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); 71 | } else { 72 | obj.signatures = []; 73 | } 74 | return obj; 75 | }, 76 | 77 | fromPartial(object: DeepPartial): MultiSignature { 78 | const message = { ...baseMultiSignature } as MultiSignature; 79 | message.signatures = []; 80 | if (object.signatures !== undefined && object.signatures !== null) { 81 | for (const e of object.signatures) { 82 | message.signatures.push(e); 83 | } 84 | } 85 | return message; 86 | }, 87 | }; 88 | 89 | const baseCompactBitArray: object = { extraBitsStored: 0 }; 90 | 91 | export const CompactBitArray = { 92 | encode(message: CompactBitArray, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 93 | if (message.extraBitsStored !== 0) { 94 | writer.uint32(8).uint32(message.extraBitsStored); 95 | } 96 | if (message.elems.length !== 0) { 97 | writer.uint32(18).bytes(message.elems); 98 | } 99 | return writer; 100 | }, 101 | 102 | decode(input: _m0.Reader | Uint8Array, length?: number): CompactBitArray { 103 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 104 | let end = length === undefined ? reader.len : reader.pos + length; 105 | const message = { ...baseCompactBitArray } as CompactBitArray; 106 | message.elems = new Uint8Array(); 107 | while (reader.pos < end) { 108 | const tag = reader.uint32(); 109 | switch (tag >>> 3) { 110 | case 1: 111 | message.extraBitsStored = reader.uint32(); 112 | break; 113 | case 2: 114 | message.elems = reader.bytes(); 115 | break; 116 | default: 117 | reader.skipType(tag & 7); 118 | break; 119 | } 120 | } 121 | return message; 122 | }, 123 | 124 | fromJSON(object: any): CompactBitArray { 125 | const message = { ...baseCompactBitArray } as CompactBitArray; 126 | message.elems = new Uint8Array(); 127 | if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { 128 | message.extraBitsStored = Number(object.extraBitsStored); 129 | } else { 130 | message.extraBitsStored = 0; 131 | } 132 | if (object.elems !== undefined && object.elems !== null) { 133 | message.elems = bytesFromBase64(object.elems); 134 | } 135 | return message; 136 | }, 137 | 138 | toJSON(message: CompactBitArray): unknown { 139 | const obj: any = {}; 140 | message.extraBitsStored !== undefined && (obj.extraBitsStored = message.extraBitsStored); 141 | message.elems !== undefined && 142 | (obj.elems = base64FromBytes(message.elems !== undefined ? message.elems : new Uint8Array())); 143 | return obj; 144 | }, 145 | 146 | fromPartial(object: DeepPartial): CompactBitArray { 147 | const message = { ...baseCompactBitArray } as CompactBitArray; 148 | if (object.extraBitsStored !== undefined && object.extraBitsStored !== null) { 149 | message.extraBitsStored = object.extraBitsStored; 150 | } else { 151 | message.extraBitsStored = 0; 152 | } 153 | if (object.elems !== undefined && object.elems !== null) { 154 | message.elems = object.elems; 155 | } else { 156 | message.elems = new Uint8Array(); 157 | } 158 | return message; 159 | }, 160 | }; 161 | 162 | declare var self: any | undefined; 163 | declare var window: any | undefined; 164 | var globalThis: any = (() => { 165 | if (typeof globalThis !== "undefined") return globalThis; 166 | if (typeof self !== "undefined") return self; 167 | if (typeof window !== "undefined") return window; 168 | if (typeof global !== "undefined") return global; 169 | throw "Unable to locate global object"; 170 | })(); 171 | 172 | const atob: (b64: string) => string = 173 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 174 | function bytesFromBase64(b64: string): Uint8Array { 175 | const bin = atob(b64); 176 | const arr = new Uint8Array(bin.length); 177 | for (let i = 0; i < bin.length; ++i) { 178 | arr[i] = bin.charCodeAt(i); 179 | } 180 | return arr; 181 | } 182 | 183 | const btoa: (bin: string) => string = 184 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 185 | function base64FromBytes(arr: Uint8Array): string { 186 | const bin: string[] = []; 187 | for (let i = 0; i < arr.byteLength; ++i) { 188 | bin.push(String.fromCharCode(arr[i])); 189 | } 190 | return btoa(bin.join("")); 191 | } 192 | 193 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 194 | export type DeepPartial = T extends Builtin 195 | ? T 196 | : T extends Array 197 | ? Array> 198 | : T extends ReadonlyArray 199 | ? ReadonlyArray> 200 | : T extends {} 201 | ? { [K in keyof T]?: DeepPartial } 202 | : Partial; 203 | 204 | if (_m0.util.Long !== Long) { 205 | _m0.util.Long = Long as any; 206 | _m0.configure(); 207 | } 208 | -------------------------------------------------------------------------------- /src/cosmos/crypto/secp256k1/keys.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.crypto.secp256k1"; 6 | 7 | /** 8 | * PubKey defines a secp256k1 public key 9 | * Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte 10 | * if the y-coordinate is the lexicographically largest of the two associated with 11 | * the x-coordinate. Otherwise the first byte is a 0x03. 12 | * This prefix is followed with the x-coordinate. 13 | */ 14 | export interface PubKey { 15 | key: Uint8Array; 16 | } 17 | 18 | /** PrivKey defines a secp256k1 private key. */ 19 | export interface PrivKey { 20 | key: Uint8Array; 21 | } 22 | 23 | const basePubKey: object = {}; 24 | 25 | export const PubKey = { 26 | encode(message: PubKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 27 | if (message.key.length !== 0) { 28 | writer.uint32(10).bytes(message.key); 29 | } 30 | return writer; 31 | }, 32 | 33 | decode(input: _m0.Reader | Uint8Array, length?: number): PubKey { 34 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 35 | let end = length === undefined ? reader.len : reader.pos + length; 36 | const message = { ...basePubKey } as PubKey; 37 | message.key = new Uint8Array(); 38 | while (reader.pos < end) { 39 | const tag = reader.uint32(); 40 | switch (tag >>> 3) { 41 | case 1: 42 | message.key = reader.bytes(); 43 | break; 44 | default: 45 | reader.skipType(tag & 7); 46 | break; 47 | } 48 | } 49 | return message; 50 | }, 51 | 52 | fromJSON(object: any): PubKey { 53 | const message = { ...basePubKey } as PubKey; 54 | message.key = new Uint8Array(); 55 | if (object.key !== undefined && object.key !== null) { 56 | message.key = bytesFromBase64(object.key); 57 | } 58 | return message; 59 | }, 60 | 61 | toJSON(message: PubKey): unknown { 62 | const obj: any = {}; 63 | message.key !== undefined && 64 | (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); 65 | return obj; 66 | }, 67 | 68 | fromPartial(object: DeepPartial): PubKey { 69 | const message = { ...basePubKey } as PubKey; 70 | if (object.key !== undefined && object.key !== null) { 71 | message.key = object.key; 72 | } else { 73 | message.key = new Uint8Array(); 74 | } 75 | return message; 76 | }, 77 | }; 78 | 79 | const basePrivKey: object = {}; 80 | 81 | export const PrivKey = { 82 | encode(message: PrivKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 83 | if (message.key.length !== 0) { 84 | writer.uint32(10).bytes(message.key); 85 | } 86 | return writer; 87 | }, 88 | 89 | decode(input: _m0.Reader | Uint8Array, length?: number): PrivKey { 90 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 91 | let end = length === undefined ? reader.len : reader.pos + length; 92 | const message = { ...basePrivKey } as PrivKey; 93 | message.key = new Uint8Array(); 94 | while (reader.pos < end) { 95 | const tag = reader.uint32(); 96 | switch (tag >>> 3) { 97 | case 1: 98 | message.key = reader.bytes(); 99 | break; 100 | default: 101 | reader.skipType(tag & 7); 102 | break; 103 | } 104 | } 105 | return message; 106 | }, 107 | 108 | fromJSON(object: any): PrivKey { 109 | const message = { ...basePrivKey } as PrivKey; 110 | message.key = new Uint8Array(); 111 | if (object.key !== undefined && object.key !== null) { 112 | message.key = bytesFromBase64(object.key); 113 | } 114 | return message; 115 | }, 116 | 117 | toJSON(message: PrivKey): unknown { 118 | const obj: any = {}; 119 | message.key !== undefined && 120 | (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); 121 | return obj; 122 | }, 123 | 124 | fromPartial(object: DeepPartial): PrivKey { 125 | const message = { ...basePrivKey } as PrivKey; 126 | if (object.key !== undefined && object.key !== null) { 127 | message.key = object.key; 128 | } else { 129 | message.key = new Uint8Array(); 130 | } 131 | return message; 132 | }, 133 | }; 134 | 135 | declare var self: any | undefined; 136 | declare var window: any | undefined; 137 | var globalThis: any = (() => { 138 | if (typeof globalThis !== "undefined") return globalThis; 139 | if (typeof self !== "undefined") return self; 140 | if (typeof window !== "undefined") return window; 141 | if (typeof global !== "undefined") return global; 142 | throw "Unable to locate global object"; 143 | })(); 144 | 145 | const atob: (b64: string) => string = 146 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 147 | function bytesFromBase64(b64: string): Uint8Array { 148 | const bin = atob(b64); 149 | const arr = new Uint8Array(bin.length); 150 | for (let i = 0; i < bin.length; ++i) { 151 | arr[i] = bin.charCodeAt(i); 152 | } 153 | return arr; 154 | } 155 | 156 | const btoa: (bin: string) => string = 157 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 158 | function base64FromBytes(arr: Uint8Array): string { 159 | const bin: string[] = []; 160 | for (let i = 0; i < arr.byteLength; ++i) { 161 | bin.push(String.fromCharCode(arr[i])); 162 | } 163 | return btoa(bin.join("")); 164 | } 165 | 166 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 167 | export type DeepPartial = T extends Builtin 168 | ? T 169 | : T extends Array 170 | ? Array> 171 | : T extends ReadonlyArray 172 | ? ReadonlyArray> 173 | : T extends {} 174 | ? { [K in keyof T]?: DeepPartial } 175 | : Partial; 176 | 177 | if (_m0.util.Long !== Long) { 178 | _m0.util.Long = Long as any; 179 | _m0.configure(); 180 | } 181 | -------------------------------------------------------------------------------- /src/cosmos/evidence/v1beta1/evidence.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Timestamp } from "../../../google/protobuf/timestamp"; 5 | 6 | export const protobufPackage = "cosmos.evidence.v1beta1"; 7 | 8 | /** 9 | * Equivocation implements the Evidence interface and defines evidence of double 10 | * signing misbehavior. 11 | */ 12 | export interface Equivocation { 13 | height: Long; 14 | time?: Date; 15 | power: Long; 16 | consensusAddress: string; 17 | } 18 | 19 | const baseEquivocation: object = { height: Long.ZERO, power: Long.ZERO, consensusAddress: "" }; 20 | 21 | export const Equivocation = { 22 | encode(message: Equivocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 23 | if (!message.height.isZero()) { 24 | writer.uint32(8).int64(message.height); 25 | } 26 | if (message.time !== undefined) { 27 | Timestamp.encode(toTimestamp(message.time), writer.uint32(18).fork()).ldelim(); 28 | } 29 | if (!message.power.isZero()) { 30 | writer.uint32(24).int64(message.power); 31 | } 32 | if (message.consensusAddress !== "") { 33 | writer.uint32(34).string(message.consensusAddress); 34 | } 35 | return writer; 36 | }, 37 | 38 | decode(input: _m0.Reader | Uint8Array, length?: number): Equivocation { 39 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 40 | let end = length === undefined ? reader.len : reader.pos + length; 41 | const message = { ...baseEquivocation } as Equivocation; 42 | while (reader.pos < end) { 43 | const tag = reader.uint32(); 44 | switch (tag >>> 3) { 45 | case 1: 46 | message.height = reader.int64() as Long; 47 | break; 48 | case 2: 49 | message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); 50 | break; 51 | case 3: 52 | message.power = reader.int64() as Long; 53 | break; 54 | case 4: 55 | message.consensusAddress = reader.string(); 56 | break; 57 | default: 58 | reader.skipType(tag & 7); 59 | break; 60 | } 61 | } 62 | return message; 63 | }, 64 | 65 | fromJSON(object: any): Equivocation { 66 | const message = { ...baseEquivocation } as Equivocation; 67 | if (object.height !== undefined && object.height !== null) { 68 | message.height = Long.fromString(object.height); 69 | } else { 70 | message.height = Long.ZERO; 71 | } 72 | if (object.time !== undefined && object.time !== null) { 73 | message.time = fromJsonTimestamp(object.time); 74 | } else { 75 | message.time = undefined; 76 | } 77 | if (object.power !== undefined && object.power !== null) { 78 | message.power = Long.fromString(object.power); 79 | } else { 80 | message.power = Long.ZERO; 81 | } 82 | if (object.consensusAddress !== undefined && object.consensusAddress !== null) { 83 | message.consensusAddress = String(object.consensusAddress); 84 | } else { 85 | message.consensusAddress = ""; 86 | } 87 | return message; 88 | }, 89 | 90 | toJSON(message: Equivocation): unknown { 91 | const obj: any = {}; 92 | message.height !== undefined && (obj.height = (message.height || Long.ZERO).toString()); 93 | message.time !== undefined && (obj.time = message.time.toISOString()); 94 | message.power !== undefined && (obj.power = (message.power || Long.ZERO).toString()); 95 | message.consensusAddress !== undefined && (obj.consensusAddress = message.consensusAddress); 96 | return obj; 97 | }, 98 | 99 | fromPartial(object: DeepPartial): Equivocation { 100 | const message = { ...baseEquivocation } as Equivocation; 101 | if (object.height !== undefined && object.height !== null) { 102 | message.height = object.height as Long; 103 | } else { 104 | message.height = Long.ZERO; 105 | } 106 | if (object.time !== undefined && object.time !== null) { 107 | message.time = object.time; 108 | } else { 109 | message.time = undefined; 110 | } 111 | if (object.power !== undefined && object.power !== null) { 112 | message.power = object.power as Long; 113 | } else { 114 | message.power = Long.ZERO; 115 | } 116 | if (object.consensusAddress !== undefined && object.consensusAddress !== null) { 117 | message.consensusAddress = object.consensusAddress; 118 | } else { 119 | message.consensusAddress = ""; 120 | } 121 | return message; 122 | }, 123 | }; 124 | 125 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 126 | export type DeepPartial = T extends Builtin 127 | ? T 128 | : T extends Array 129 | ? Array> 130 | : T extends ReadonlyArray 131 | ? ReadonlyArray> 132 | : T extends {} 133 | ? { [K in keyof T]?: DeepPartial } 134 | : Partial; 135 | 136 | function toTimestamp(date: Date): Timestamp { 137 | const seconds = numberToLong(date.getTime() / 1_000); 138 | const nanos = (date.getTime() % 1_000) * 1_000_000; 139 | return { seconds, nanos }; 140 | } 141 | 142 | function fromTimestamp(t: Timestamp): Date { 143 | let millis = t.seconds.toNumber() * 1_000; 144 | millis += t.nanos / 1_000_000; 145 | return new Date(millis); 146 | } 147 | 148 | function fromJsonTimestamp(o: any): Date { 149 | if (o instanceof Date) { 150 | return o; 151 | } else if (typeof o === "string") { 152 | return new Date(o); 153 | } else { 154 | return fromTimestamp(Timestamp.fromJSON(o)); 155 | } 156 | } 157 | 158 | function numberToLong(number: number) { 159 | return Long.fromNumber(number); 160 | } 161 | 162 | if (_m0.util.Long !== Long) { 163 | _m0.util.Long = Long as any; 164 | _m0.configure(); 165 | } 166 | -------------------------------------------------------------------------------- /src/cosmos/evidence/v1beta1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Any } from "../../../google/protobuf/any"; 5 | 6 | export const protobufPackage = "cosmos.evidence.v1beta1"; 7 | 8 | /** GenesisState defines the evidence module's genesis state. */ 9 | export interface GenesisState { 10 | /** evidence defines all the evidence at genesis. */ 11 | evidence: Any[]; 12 | } 13 | 14 | const baseGenesisState: object = {}; 15 | 16 | export const GenesisState = { 17 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 18 | for (const v of message.evidence) { 19 | Any.encode(v!, writer.uint32(10).fork()).ldelim(); 20 | } 21 | return writer; 22 | }, 23 | 24 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 25 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 26 | let end = length === undefined ? reader.len : reader.pos + length; 27 | const message = { ...baseGenesisState } as GenesisState; 28 | message.evidence = []; 29 | while (reader.pos < end) { 30 | const tag = reader.uint32(); 31 | switch (tag >>> 3) { 32 | case 1: 33 | message.evidence.push(Any.decode(reader, reader.uint32())); 34 | break; 35 | default: 36 | reader.skipType(tag & 7); 37 | break; 38 | } 39 | } 40 | return message; 41 | }, 42 | 43 | fromJSON(object: any): GenesisState { 44 | const message = { ...baseGenesisState } as GenesisState; 45 | message.evidence = []; 46 | if (object.evidence !== undefined && object.evidence !== null) { 47 | for (const e of object.evidence) { 48 | message.evidence.push(Any.fromJSON(e)); 49 | } 50 | } 51 | return message; 52 | }, 53 | 54 | toJSON(message: GenesisState): unknown { 55 | const obj: any = {}; 56 | if (message.evidence) { 57 | obj.evidence = message.evidence.map((e) => (e ? Any.toJSON(e) : undefined)); 58 | } else { 59 | obj.evidence = []; 60 | } 61 | return obj; 62 | }, 63 | 64 | fromPartial(object: DeepPartial): GenesisState { 65 | const message = { ...baseGenesisState } as GenesisState; 66 | message.evidence = []; 67 | if (object.evidence !== undefined && object.evidence !== null) { 68 | for (const e of object.evidence) { 69 | message.evidence.push(Any.fromPartial(e)); 70 | } 71 | } 72 | return message; 73 | }, 74 | }; 75 | 76 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 77 | export type DeepPartial = T extends Builtin 78 | ? T 79 | : T extends Array 80 | ? Array> 81 | : T extends ReadonlyArray 82 | ? ReadonlyArray> 83 | : T extends {} 84 | ? { [K in keyof T]?: DeepPartial } 85 | : Partial; 86 | 87 | if (_m0.util.Long !== Long) { 88 | _m0.util.Long = Long as any; 89 | _m0.configure(); 90 | } 91 | -------------------------------------------------------------------------------- /src/cosmos/evidence/v1beta1/tx.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Any } from "../../../google/protobuf/any"; 5 | 6 | export const protobufPackage = "cosmos.evidence.v1beta1"; 7 | 8 | /** 9 | * MsgSubmitEvidence represents a message that supports submitting arbitrary 10 | * Evidence of misbehavior such as equivocation or counterfactual signing. 11 | */ 12 | export interface MsgSubmitEvidence { 13 | submitter: string; 14 | evidence?: Any; 15 | } 16 | 17 | /** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ 18 | export interface MsgSubmitEvidenceResponse { 19 | /** hash defines the hash of the evidence. */ 20 | hash: Uint8Array; 21 | } 22 | 23 | const baseMsgSubmitEvidence: object = { submitter: "" }; 24 | 25 | export const MsgSubmitEvidence = { 26 | encode(message: MsgSubmitEvidence, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 27 | if (message.submitter !== "") { 28 | writer.uint32(10).string(message.submitter); 29 | } 30 | if (message.evidence !== undefined) { 31 | Any.encode(message.evidence, writer.uint32(18).fork()).ldelim(); 32 | } 33 | return writer; 34 | }, 35 | 36 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidence { 37 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 38 | let end = length === undefined ? reader.len : reader.pos + length; 39 | const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; 40 | while (reader.pos < end) { 41 | const tag = reader.uint32(); 42 | switch (tag >>> 3) { 43 | case 1: 44 | message.submitter = reader.string(); 45 | break; 46 | case 2: 47 | message.evidence = Any.decode(reader, reader.uint32()); 48 | break; 49 | default: 50 | reader.skipType(tag & 7); 51 | break; 52 | } 53 | } 54 | return message; 55 | }, 56 | 57 | fromJSON(object: any): MsgSubmitEvidence { 58 | const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; 59 | if (object.submitter !== undefined && object.submitter !== null) { 60 | message.submitter = String(object.submitter); 61 | } else { 62 | message.submitter = ""; 63 | } 64 | if (object.evidence !== undefined && object.evidence !== null) { 65 | message.evidence = Any.fromJSON(object.evidence); 66 | } else { 67 | message.evidence = undefined; 68 | } 69 | return message; 70 | }, 71 | 72 | toJSON(message: MsgSubmitEvidence): unknown { 73 | const obj: any = {}; 74 | message.submitter !== undefined && (obj.submitter = message.submitter); 75 | message.evidence !== undefined && 76 | (obj.evidence = message.evidence ? Any.toJSON(message.evidence) : undefined); 77 | return obj; 78 | }, 79 | 80 | fromPartial(object: DeepPartial): MsgSubmitEvidence { 81 | const message = { ...baseMsgSubmitEvidence } as MsgSubmitEvidence; 82 | if (object.submitter !== undefined && object.submitter !== null) { 83 | message.submitter = object.submitter; 84 | } else { 85 | message.submitter = ""; 86 | } 87 | if (object.evidence !== undefined && object.evidence !== null) { 88 | message.evidence = Any.fromPartial(object.evidence); 89 | } else { 90 | message.evidence = undefined; 91 | } 92 | return message; 93 | }, 94 | }; 95 | 96 | const baseMsgSubmitEvidenceResponse: object = {}; 97 | 98 | export const MsgSubmitEvidenceResponse = { 99 | encode(message: MsgSubmitEvidenceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 100 | if (message.hash.length !== 0) { 101 | writer.uint32(34).bytes(message.hash); 102 | } 103 | return writer; 104 | }, 105 | 106 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitEvidenceResponse { 107 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 108 | let end = length === undefined ? reader.len : reader.pos + length; 109 | const message = { ...baseMsgSubmitEvidenceResponse } as MsgSubmitEvidenceResponse; 110 | message.hash = new Uint8Array(); 111 | while (reader.pos < end) { 112 | const tag = reader.uint32(); 113 | switch (tag >>> 3) { 114 | case 4: 115 | message.hash = reader.bytes(); 116 | break; 117 | default: 118 | reader.skipType(tag & 7); 119 | break; 120 | } 121 | } 122 | return message; 123 | }, 124 | 125 | fromJSON(object: any): MsgSubmitEvidenceResponse { 126 | const message = { ...baseMsgSubmitEvidenceResponse } as MsgSubmitEvidenceResponse; 127 | message.hash = new Uint8Array(); 128 | if (object.hash !== undefined && object.hash !== null) { 129 | message.hash = bytesFromBase64(object.hash); 130 | } 131 | return message; 132 | }, 133 | 134 | toJSON(message: MsgSubmitEvidenceResponse): unknown { 135 | const obj: any = {}; 136 | message.hash !== undefined && 137 | (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array())); 138 | return obj; 139 | }, 140 | 141 | fromPartial(object: DeepPartial): MsgSubmitEvidenceResponse { 142 | const message = { ...baseMsgSubmitEvidenceResponse } as MsgSubmitEvidenceResponse; 143 | if (object.hash !== undefined && object.hash !== null) { 144 | message.hash = object.hash; 145 | } else { 146 | message.hash = new Uint8Array(); 147 | } 148 | return message; 149 | }, 150 | }; 151 | 152 | /** Msg defines the evidence Msg service. */ 153 | export interface Msg { 154 | /** 155 | * SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or 156 | * counterfactual signing. 157 | */ 158 | SubmitEvidence(request: MsgSubmitEvidence): Promise; 159 | } 160 | 161 | export class MsgClientImpl implements Msg { 162 | private readonly rpc: Rpc; 163 | constructor(rpc: Rpc) { 164 | this.rpc = rpc; 165 | this.SubmitEvidence = this.SubmitEvidence.bind(this); 166 | } 167 | SubmitEvidence(request: MsgSubmitEvidence): Promise { 168 | const data = MsgSubmitEvidence.encode(request).finish(); 169 | const promise = this.rpc.request("cosmos.evidence.v1beta1.Msg", "SubmitEvidence", data); 170 | return promise.then((data) => MsgSubmitEvidenceResponse.decode(new _m0.Reader(data))); 171 | } 172 | } 173 | 174 | interface Rpc { 175 | request(service: string, method: string, data: Uint8Array): Promise; 176 | } 177 | 178 | declare var self: any | undefined; 179 | declare var window: any | undefined; 180 | var globalThis: any = (() => { 181 | if (typeof globalThis !== "undefined") return globalThis; 182 | if (typeof self !== "undefined") return self; 183 | if (typeof window !== "undefined") return window; 184 | if (typeof global !== "undefined") return global; 185 | throw "Unable to locate global object"; 186 | })(); 187 | 188 | const atob: (b64: string) => string = 189 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 190 | function bytesFromBase64(b64: string): Uint8Array { 191 | const bin = atob(b64); 192 | const arr = new Uint8Array(bin.length); 193 | for (let i = 0; i < bin.length; ++i) { 194 | arr[i] = bin.charCodeAt(i); 195 | } 196 | return arr; 197 | } 198 | 199 | const btoa: (bin: string) => string = 200 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 201 | function base64FromBytes(arr: Uint8Array): string { 202 | const bin: string[] = []; 203 | for (let i = 0; i < arr.byteLength; ++i) { 204 | bin.push(String.fromCharCode(arr[i])); 205 | } 206 | return btoa(bin.join("")); 207 | } 208 | 209 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 210 | export type DeepPartial = T extends Builtin 211 | ? T 212 | : T extends Array 213 | ? Array> 214 | : T extends ReadonlyArray 215 | ? ReadonlyArray> 216 | : T extends {} 217 | ? { [K in keyof T]?: DeepPartial } 218 | : Partial; 219 | 220 | if (_m0.util.Long !== Long) { 221 | _m0.util.Long = Long as any; 222 | _m0.configure(); 223 | } 224 | -------------------------------------------------------------------------------- /src/cosmos/genutil/v1beta1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.genutil.v1beta1"; 6 | 7 | /** GenesisState defines the raw genesis transaction in JSON. */ 8 | export interface GenesisState { 9 | /** gen_txs defines the genesis transactions. */ 10 | genTxs: Uint8Array[]; 11 | } 12 | 13 | const baseGenesisState: object = {}; 14 | 15 | export const GenesisState = { 16 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 17 | for (const v of message.genTxs) { 18 | writer.uint32(10).bytes(v!); 19 | } 20 | return writer; 21 | }, 22 | 23 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 24 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 25 | let end = length === undefined ? reader.len : reader.pos + length; 26 | const message = { ...baseGenesisState } as GenesisState; 27 | message.genTxs = []; 28 | while (reader.pos < end) { 29 | const tag = reader.uint32(); 30 | switch (tag >>> 3) { 31 | case 1: 32 | message.genTxs.push(reader.bytes()); 33 | break; 34 | default: 35 | reader.skipType(tag & 7); 36 | break; 37 | } 38 | } 39 | return message; 40 | }, 41 | 42 | fromJSON(object: any): GenesisState { 43 | const message = { ...baseGenesisState } as GenesisState; 44 | message.genTxs = []; 45 | if (object.genTxs !== undefined && object.genTxs !== null) { 46 | for (const e of object.genTxs) { 47 | message.genTxs.push(bytesFromBase64(e)); 48 | } 49 | } 50 | return message; 51 | }, 52 | 53 | toJSON(message: GenesisState): unknown { 54 | const obj: any = {}; 55 | if (message.genTxs) { 56 | obj.genTxs = message.genTxs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); 57 | } else { 58 | obj.genTxs = []; 59 | } 60 | return obj; 61 | }, 62 | 63 | fromPartial(object: DeepPartial): GenesisState { 64 | const message = { ...baseGenesisState } as GenesisState; 65 | message.genTxs = []; 66 | if (object.genTxs !== undefined && object.genTxs !== null) { 67 | for (const e of object.genTxs) { 68 | message.genTxs.push(e); 69 | } 70 | } 71 | return message; 72 | }, 73 | }; 74 | 75 | declare var self: any | undefined; 76 | declare var window: any | undefined; 77 | var globalThis: any = (() => { 78 | if (typeof globalThis !== "undefined") return globalThis; 79 | if (typeof self !== "undefined") return self; 80 | if (typeof window !== "undefined") return window; 81 | if (typeof global !== "undefined") return global; 82 | throw "Unable to locate global object"; 83 | })(); 84 | 85 | const atob: (b64: string) => string = 86 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 87 | function bytesFromBase64(b64: string): Uint8Array { 88 | const bin = atob(b64); 89 | const arr = new Uint8Array(bin.length); 90 | for (let i = 0; i < bin.length; ++i) { 91 | arr[i] = bin.charCodeAt(i); 92 | } 93 | return arr; 94 | } 95 | 96 | const btoa: (bin: string) => string = 97 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 98 | function base64FromBytes(arr: Uint8Array): string { 99 | const bin: string[] = []; 100 | for (let i = 0; i < arr.byteLength; ++i) { 101 | bin.push(String.fromCharCode(arr[i])); 102 | } 103 | return btoa(bin.join("")); 104 | } 105 | 106 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 107 | export type DeepPartial = T extends Builtin 108 | ? T 109 | : T extends Array 110 | ? Array> 111 | : T extends ReadonlyArray 112 | ? ReadonlyArray> 113 | : T extends {} 114 | ? { [K in keyof T]?: DeepPartial } 115 | : Partial; 116 | 117 | if (_m0.util.Long !== Long) { 118 | _m0.util.Long = Long as any; 119 | _m0.configure(); 120 | } 121 | -------------------------------------------------------------------------------- /src/cosmos/mint/v1beta1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Minter, Params } from "../../../cosmos/mint/v1beta1/mint"; 5 | 6 | export const protobufPackage = "cosmos.mint.v1beta1"; 7 | 8 | /** GenesisState defines the mint module's genesis state. */ 9 | export interface GenesisState { 10 | /** minter is a space for holding current inflation information. */ 11 | minter?: Minter; 12 | /** params defines all the paramaters of the module. */ 13 | params?: Params; 14 | } 15 | 16 | const baseGenesisState: object = {}; 17 | 18 | export const GenesisState = { 19 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 20 | if (message.minter !== undefined) { 21 | Minter.encode(message.minter, writer.uint32(10).fork()).ldelim(); 22 | } 23 | if (message.params !== undefined) { 24 | Params.encode(message.params, writer.uint32(18).fork()).ldelim(); 25 | } 26 | return writer; 27 | }, 28 | 29 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 30 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 31 | let end = length === undefined ? reader.len : reader.pos + length; 32 | const message = { ...baseGenesisState } as GenesisState; 33 | while (reader.pos < end) { 34 | const tag = reader.uint32(); 35 | switch (tag >>> 3) { 36 | case 1: 37 | message.minter = Minter.decode(reader, reader.uint32()); 38 | break; 39 | case 2: 40 | message.params = Params.decode(reader, reader.uint32()); 41 | break; 42 | default: 43 | reader.skipType(tag & 7); 44 | break; 45 | } 46 | } 47 | return message; 48 | }, 49 | 50 | fromJSON(object: any): GenesisState { 51 | const message = { ...baseGenesisState } as GenesisState; 52 | if (object.minter !== undefined && object.minter !== null) { 53 | message.minter = Minter.fromJSON(object.minter); 54 | } else { 55 | message.minter = undefined; 56 | } 57 | if (object.params !== undefined && object.params !== null) { 58 | message.params = Params.fromJSON(object.params); 59 | } else { 60 | message.params = undefined; 61 | } 62 | return message; 63 | }, 64 | 65 | toJSON(message: GenesisState): unknown { 66 | const obj: any = {}; 67 | message.minter !== undefined && (obj.minter = message.minter ? Minter.toJSON(message.minter) : undefined); 68 | message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); 69 | return obj; 70 | }, 71 | 72 | fromPartial(object: DeepPartial): GenesisState { 73 | const message = { ...baseGenesisState } as GenesisState; 74 | if (object.minter !== undefined && object.minter !== null) { 75 | message.minter = Minter.fromPartial(object.minter); 76 | } else { 77 | message.minter = undefined; 78 | } 79 | if (object.params !== undefined && object.params !== null) { 80 | message.params = Params.fromPartial(object.params); 81 | } else { 82 | message.params = undefined; 83 | } 84 | return message; 85 | }, 86 | }; 87 | 88 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 89 | export type DeepPartial = T extends Builtin 90 | ? T 91 | : T extends Array 92 | ? Array> 93 | : T extends ReadonlyArray 94 | ? ReadonlyArray> 95 | : T extends {} 96 | ? { [K in keyof T]?: DeepPartial } 97 | : Partial; 98 | 99 | if (_m0.util.Long !== Long) { 100 | _m0.util.Long = Long as any; 101 | _m0.configure(); 102 | } 103 | -------------------------------------------------------------------------------- /src/cosmos/params/v1beta1/params.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.params.v1beta1"; 6 | 7 | /** ParameterChangeProposal defines a proposal to change one or more parameters. */ 8 | export interface ParameterChangeProposal { 9 | title: string; 10 | description: string; 11 | changes: ParamChange[]; 12 | } 13 | 14 | /** 15 | * ParamChange defines an individual parameter change, for use in 16 | * ParameterChangeProposal. 17 | */ 18 | export interface ParamChange { 19 | subspace: string; 20 | key: string; 21 | value: string; 22 | } 23 | 24 | const baseParameterChangeProposal: object = { title: "", description: "" }; 25 | 26 | export const ParameterChangeProposal = { 27 | encode(message: ParameterChangeProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 28 | if (message.title !== "") { 29 | writer.uint32(10).string(message.title); 30 | } 31 | if (message.description !== "") { 32 | writer.uint32(18).string(message.description); 33 | } 34 | for (const v of message.changes) { 35 | ParamChange.encode(v!, writer.uint32(26).fork()).ldelim(); 36 | } 37 | return writer; 38 | }, 39 | 40 | decode(input: _m0.Reader | Uint8Array, length?: number): ParameterChangeProposal { 41 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 42 | let end = length === undefined ? reader.len : reader.pos + length; 43 | const message = { ...baseParameterChangeProposal } as ParameterChangeProposal; 44 | message.changes = []; 45 | while (reader.pos < end) { 46 | const tag = reader.uint32(); 47 | switch (tag >>> 3) { 48 | case 1: 49 | message.title = reader.string(); 50 | break; 51 | case 2: 52 | message.description = reader.string(); 53 | break; 54 | case 3: 55 | message.changes.push(ParamChange.decode(reader, reader.uint32())); 56 | break; 57 | default: 58 | reader.skipType(tag & 7); 59 | break; 60 | } 61 | } 62 | return message; 63 | }, 64 | 65 | fromJSON(object: any): ParameterChangeProposal { 66 | const message = { ...baseParameterChangeProposal } as ParameterChangeProposal; 67 | message.changes = []; 68 | if (object.title !== undefined && object.title !== null) { 69 | message.title = String(object.title); 70 | } else { 71 | message.title = ""; 72 | } 73 | if (object.description !== undefined && object.description !== null) { 74 | message.description = String(object.description); 75 | } else { 76 | message.description = ""; 77 | } 78 | if (object.changes !== undefined && object.changes !== null) { 79 | for (const e of object.changes) { 80 | message.changes.push(ParamChange.fromJSON(e)); 81 | } 82 | } 83 | return message; 84 | }, 85 | 86 | toJSON(message: ParameterChangeProposal): unknown { 87 | const obj: any = {}; 88 | message.title !== undefined && (obj.title = message.title); 89 | message.description !== undefined && (obj.description = message.description); 90 | if (message.changes) { 91 | obj.changes = message.changes.map((e) => (e ? ParamChange.toJSON(e) : undefined)); 92 | } else { 93 | obj.changes = []; 94 | } 95 | return obj; 96 | }, 97 | 98 | fromPartial(object: DeepPartial): ParameterChangeProposal { 99 | const message = { ...baseParameterChangeProposal } as ParameterChangeProposal; 100 | message.changes = []; 101 | if (object.title !== undefined && object.title !== null) { 102 | message.title = object.title; 103 | } else { 104 | message.title = ""; 105 | } 106 | if (object.description !== undefined && object.description !== null) { 107 | message.description = object.description; 108 | } else { 109 | message.description = ""; 110 | } 111 | if (object.changes !== undefined && object.changes !== null) { 112 | for (const e of object.changes) { 113 | message.changes.push(ParamChange.fromPartial(e)); 114 | } 115 | } 116 | return message; 117 | }, 118 | }; 119 | 120 | const baseParamChange: object = { subspace: "", key: "", value: "" }; 121 | 122 | export const ParamChange = { 123 | encode(message: ParamChange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 124 | if (message.subspace !== "") { 125 | writer.uint32(10).string(message.subspace); 126 | } 127 | if (message.key !== "") { 128 | writer.uint32(18).string(message.key); 129 | } 130 | if (message.value !== "") { 131 | writer.uint32(26).string(message.value); 132 | } 133 | return writer; 134 | }, 135 | 136 | decode(input: _m0.Reader | Uint8Array, length?: number): ParamChange { 137 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 138 | let end = length === undefined ? reader.len : reader.pos + length; 139 | const message = { ...baseParamChange } as ParamChange; 140 | while (reader.pos < end) { 141 | const tag = reader.uint32(); 142 | switch (tag >>> 3) { 143 | case 1: 144 | message.subspace = reader.string(); 145 | break; 146 | case 2: 147 | message.key = reader.string(); 148 | break; 149 | case 3: 150 | message.value = reader.string(); 151 | break; 152 | default: 153 | reader.skipType(tag & 7); 154 | break; 155 | } 156 | } 157 | return message; 158 | }, 159 | 160 | fromJSON(object: any): ParamChange { 161 | const message = { ...baseParamChange } as ParamChange; 162 | if (object.subspace !== undefined && object.subspace !== null) { 163 | message.subspace = String(object.subspace); 164 | } else { 165 | message.subspace = ""; 166 | } 167 | if (object.key !== undefined && object.key !== null) { 168 | message.key = String(object.key); 169 | } else { 170 | message.key = ""; 171 | } 172 | if (object.value !== undefined && object.value !== null) { 173 | message.value = String(object.value); 174 | } else { 175 | message.value = ""; 176 | } 177 | return message; 178 | }, 179 | 180 | toJSON(message: ParamChange): unknown { 181 | const obj: any = {}; 182 | message.subspace !== undefined && (obj.subspace = message.subspace); 183 | message.key !== undefined && (obj.key = message.key); 184 | message.value !== undefined && (obj.value = message.value); 185 | return obj; 186 | }, 187 | 188 | fromPartial(object: DeepPartial): ParamChange { 189 | const message = { ...baseParamChange } as ParamChange; 190 | if (object.subspace !== undefined && object.subspace !== null) { 191 | message.subspace = object.subspace; 192 | } else { 193 | message.subspace = ""; 194 | } 195 | if (object.key !== undefined && object.key !== null) { 196 | message.key = object.key; 197 | } else { 198 | message.key = ""; 199 | } 200 | if (object.value !== undefined && object.value !== null) { 201 | message.value = object.value; 202 | } else { 203 | message.value = ""; 204 | } 205 | return message; 206 | }, 207 | }; 208 | 209 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 210 | export type DeepPartial = T extends Builtin 211 | ? T 212 | : T extends Array 213 | ? Array> 214 | : T extends ReadonlyArray 215 | ? ReadonlyArray> 216 | : T extends {} 217 | ? { [K in keyof T]?: DeepPartial } 218 | : Partial; 219 | 220 | if (_m0.util.Long !== Long) { 221 | _m0.util.Long = Long as any; 222 | _m0.configure(); 223 | } 224 | -------------------------------------------------------------------------------- /src/cosmos/params/v1beta1/query.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { ParamChange } from "../../../cosmos/params/v1beta1/params"; 5 | 6 | export const protobufPackage = "cosmos.params.v1beta1"; 7 | 8 | /** QueryParamsRequest is request type for the Query/Params RPC method. */ 9 | export interface QueryParamsRequest { 10 | /** subspace defines the module to query the parameter for. */ 11 | subspace: string; 12 | /** key defines the key of the parameter in the subspace. */ 13 | key: string; 14 | } 15 | 16 | /** QueryParamsResponse is response type for the Query/Params RPC method. */ 17 | export interface QueryParamsResponse { 18 | /** param defines the queried parameter. */ 19 | param?: ParamChange; 20 | } 21 | 22 | const baseQueryParamsRequest: object = { subspace: "", key: "" }; 23 | 24 | export const QueryParamsRequest = { 25 | encode(message: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 26 | if (message.subspace !== "") { 27 | writer.uint32(10).string(message.subspace); 28 | } 29 | if (message.key !== "") { 30 | writer.uint32(18).string(message.key); 31 | } 32 | return writer; 33 | }, 34 | 35 | decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { 36 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 37 | let end = length === undefined ? reader.len : reader.pos + length; 38 | const message = { ...baseQueryParamsRequest } as QueryParamsRequest; 39 | while (reader.pos < end) { 40 | const tag = reader.uint32(); 41 | switch (tag >>> 3) { 42 | case 1: 43 | message.subspace = reader.string(); 44 | break; 45 | case 2: 46 | message.key = reader.string(); 47 | break; 48 | default: 49 | reader.skipType(tag & 7); 50 | break; 51 | } 52 | } 53 | return message; 54 | }, 55 | 56 | fromJSON(object: any): QueryParamsRequest { 57 | const message = { ...baseQueryParamsRequest } as QueryParamsRequest; 58 | if (object.subspace !== undefined && object.subspace !== null) { 59 | message.subspace = String(object.subspace); 60 | } else { 61 | message.subspace = ""; 62 | } 63 | if (object.key !== undefined && object.key !== null) { 64 | message.key = String(object.key); 65 | } else { 66 | message.key = ""; 67 | } 68 | return message; 69 | }, 70 | 71 | toJSON(message: QueryParamsRequest): unknown { 72 | const obj: any = {}; 73 | message.subspace !== undefined && (obj.subspace = message.subspace); 74 | message.key !== undefined && (obj.key = message.key); 75 | return obj; 76 | }, 77 | 78 | fromPartial(object: DeepPartial): QueryParamsRequest { 79 | const message = { ...baseQueryParamsRequest } as QueryParamsRequest; 80 | if (object.subspace !== undefined && object.subspace !== null) { 81 | message.subspace = object.subspace; 82 | } else { 83 | message.subspace = ""; 84 | } 85 | if (object.key !== undefined && object.key !== null) { 86 | message.key = object.key; 87 | } else { 88 | message.key = ""; 89 | } 90 | return message; 91 | }, 92 | }; 93 | 94 | const baseQueryParamsResponse: object = {}; 95 | 96 | export const QueryParamsResponse = { 97 | encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 98 | if (message.param !== undefined) { 99 | ParamChange.encode(message.param, writer.uint32(10).fork()).ldelim(); 100 | } 101 | return writer; 102 | }, 103 | 104 | decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { 105 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 106 | let end = length === undefined ? reader.len : reader.pos + length; 107 | const message = { ...baseQueryParamsResponse } as QueryParamsResponse; 108 | while (reader.pos < end) { 109 | const tag = reader.uint32(); 110 | switch (tag >>> 3) { 111 | case 1: 112 | message.param = ParamChange.decode(reader, reader.uint32()); 113 | break; 114 | default: 115 | reader.skipType(tag & 7); 116 | break; 117 | } 118 | } 119 | return message; 120 | }, 121 | 122 | fromJSON(object: any): QueryParamsResponse { 123 | const message = { ...baseQueryParamsResponse } as QueryParamsResponse; 124 | if (object.param !== undefined && object.param !== null) { 125 | message.param = ParamChange.fromJSON(object.param); 126 | } else { 127 | message.param = undefined; 128 | } 129 | return message; 130 | }, 131 | 132 | toJSON(message: QueryParamsResponse): unknown { 133 | const obj: any = {}; 134 | message.param !== undefined && 135 | (obj.param = message.param ? ParamChange.toJSON(message.param) : undefined); 136 | return obj; 137 | }, 138 | 139 | fromPartial(object: DeepPartial): QueryParamsResponse { 140 | const message = { ...baseQueryParamsResponse } as QueryParamsResponse; 141 | if (object.param !== undefined && object.param !== null) { 142 | message.param = ParamChange.fromPartial(object.param); 143 | } else { 144 | message.param = undefined; 145 | } 146 | return message; 147 | }, 148 | }; 149 | 150 | /** Query defines the gRPC querier service. */ 151 | export interface Query { 152 | /** 153 | * Params queries a specific parameter of a module, given its subspace and 154 | * key. 155 | */ 156 | Params(request: QueryParamsRequest): Promise; 157 | } 158 | 159 | export class QueryClientImpl implements Query { 160 | private readonly rpc: Rpc; 161 | constructor(rpc: Rpc) { 162 | this.rpc = rpc; 163 | this.Params = this.Params.bind(this); 164 | } 165 | Params(request: QueryParamsRequest): Promise { 166 | const data = QueryParamsRequest.encode(request).finish(); 167 | const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); 168 | return promise.then((data) => QueryParamsResponse.decode(new _m0.Reader(data))); 169 | } 170 | } 171 | 172 | interface Rpc { 173 | request(service: string, method: string, data: Uint8Array): Promise; 174 | } 175 | 176 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 177 | export type DeepPartial = T extends Builtin 178 | ? T 179 | : T extends Array 180 | ? Array> 181 | : T extends ReadonlyArray 182 | ? ReadonlyArray> 183 | : T extends {} 184 | ? { [K in keyof T]?: DeepPartial } 185 | : Partial; 186 | 187 | if (_m0.util.Long !== Long) { 188 | _m0.util.Long = Long as any; 189 | _m0.configure(); 190 | } 191 | -------------------------------------------------------------------------------- /src/cosmos/slashing/v1beta1/tx.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos.slashing.v1beta1"; 6 | 7 | /** MsgUnjail defines the Msg/Unjail request type */ 8 | export interface MsgUnjail { 9 | validatorAddr: string; 10 | } 11 | 12 | /** MsgUnjailResponse defines the Msg/Unjail response type */ 13 | export interface MsgUnjailResponse {} 14 | 15 | const baseMsgUnjail: object = { validatorAddr: "" }; 16 | 17 | export const MsgUnjail = { 18 | encode(message: MsgUnjail, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 19 | if (message.validatorAddr !== "") { 20 | writer.uint32(10).string(message.validatorAddr); 21 | } 22 | return writer; 23 | }, 24 | 25 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjail { 26 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 27 | let end = length === undefined ? reader.len : reader.pos + length; 28 | const message = { ...baseMsgUnjail } as MsgUnjail; 29 | while (reader.pos < end) { 30 | const tag = reader.uint32(); 31 | switch (tag >>> 3) { 32 | case 1: 33 | message.validatorAddr = reader.string(); 34 | break; 35 | default: 36 | reader.skipType(tag & 7); 37 | break; 38 | } 39 | } 40 | return message; 41 | }, 42 | 43 | fromJSON(object: any): MsgUnjail { 44 | const message = { ...baseMsgUnjail } as MsgUnjail; 45 | if (object.validatorAddr !== undefined && object.validatorAddr !== null) { 46 | message.validatorAddr = String(object.validatorAddr); 47 | } else { 48 | message.validatorAddr = ""; 49 | } 50 | return message; 51 | }, 52 | 53 | toJSON(message: MsgUnjail): unknown { 54 | const obj: any = {}; 55 | message.validatorAddr !== undefined && (obj.validatorAddr = message.validatorAddr); 56 | return obj; 57 | }, 58 | 59 | fromPartial(object: DeepPartial): MsgUnjail { 60 | const message = { ...baseMsgUnjail } as MsgUnjail; 61 | if (object.validatorAddr !== undefined && object.validatorAddr !== null) { 62 | message.validatorAddr = object.validatorAddr; 63 | } else { 64 | message.validatorAddr = ""; 65 | } 66 | return message; 67 | }, 68 | }; 69 | 70 | const baseMsgUnjailResponse: object = {}; 71 | 72 | export const MsgUnjailResponse = { 73 | encode(_: MsgUnjailResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 74 | return writer; 75 | }, 76 | 77 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnjailResponse { 78 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 79 | let end = length === undefined ? reader.len : reader.pos + length; 80 | const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; 81 | while (reader.pos < end) { 82 | const tag = reader.uint32(); 83 | switch (tag >>> 3) { 84 | default: 85 | reader.skipType(tag & 7); 86 | break; 87 | } 88 | } 89 | return message; 90 | }, 91 | 92 | fromJSON(_: any): MsgUnjailResponse { 93 | const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; 94 | return message; 95 | }, 96 | 97 | toJSON(_: MsgUnjailResponse): unknown { 98 | const obj: any = {}; 99 | return obj; 100 | }, 101 | 102 | fromPartial(_: DeepPartial): MsgUnjailResponse { 103 | const message = { ...baseMsgUnjailResponse } as MsgUnjailResponse; 104 | return message; 105 | }, 106 | }; 107 | 108 | /** Msg defines the slashing Msg service. */ 109 | export interface Msg { 110 | /** 111 | * Unjail defines a method for unjailing a jailed validator, thus returning 112 | * them into the bonded validator set, so they can begin receiving provisions 113 | * and rewards again. 114 | */ 115 | Unjail(request: MsgUnjail): Promise; 116 | } 117 | 118 | export class MsgClientImpl implements Msg { 119 | private readonly rpc: Rpc; 120 | constructor(rpc: Rpc) { 121 | this.rpc = rpc; 122 | this.Unjail = this.Unjail.bind(this); 123 | } 124 | Unjail(request: MsgUnjail): Promise { 125 | const data = MsgUnjail.encode(request).finish(); 126 | const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); 127 | return promise.then((data) => MsgUnjailResponse.decode(new _m0.Reader(data))); 128 | } 129 | } 130 | 131 | interface Rpc { 132 | request(service: string, method: string, data: Uint8Array): Promise; 133 | } 134 | 135 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 136 | export type DeepPartial = T extends Builtin 137 | ? T 138 | : T extends Array 139 | ? Array> 140 | : T extends ReadonlyArray 141 | ? ReadonlyArray> 142 | : T extends {} 143 | ? { [K in keyof T]?: DeepPartial } 144 | : Partial; 145 | 146 | if (_m0.util.Long !== Long) { 147 | _m0.util.Long = Long as any; 148 | _m0.configure(); 149 | } 150 | -------------------------------------------------------------------------------- /src/cosmos/vesting/v1beta1/tx.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Coin } from "../../../cosmos/base/v1beta1/coin"; 5 | 6 | export const protobufPackage = "cosmos.vesting.v1beta1"; 7 | 8 | /** 9 | * MsgCreateVestingAccount defines a message that enables creating a vesting 10 | * account. 11 | */ 12 | export interface MsgCreateVestingAccount { 13 | fromAddress: string; 14 | toAddress: string; 15 | amount: Coin[]; 16 | endTime: Long; 17 | delayed: boolean; 18 | } 19 | 20 | /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ 21 | export interface MsgCreateVestingAccountResponse {} 22 | 23 | const baseMsgCreateVestingAccount: object = { 24 | fromAddress: "", 25 | toAddress: "", 26 | endTime: Long.ZERO, 27 | delayed: false, 28 | }; 29 | 30 | export const MsgCreateVestingAccount = { 31 | encode(message: MsgCreateVestingAccount, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 32 | if (message.fromAddress !== "") { 33 | writer.uint32(10).string(message.fromAddress); 34 | } 35 | if (message.toAddress !== "") { 36 | writer.uint32(18).string(message.toAddress); 37 | } 38 | for (const v of message.amount) { 39 | Coin.encode(v!, writer.uint32(26).fork()).ldelim(); 40 | } 41 | if (!message.endTime.isZero()) { 42 | writer.uint32(32).int64(message.endTime); 43 | } 44 | if (message.delayed === true) { 45 | writer.uint32(40).bool(message.delayed); 46 | } 47 | return writer; 48 | }, 49 | 50 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccount { 51 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 52 | let end = length === undefined ? reader.len : reader.pos + length; 53 | const message = { ...baseMsgCreateVestingAccount } as MsgCreateVestingAccount; 54 | message.amount = []; 55 | while (reader.pos < end) { 56 | const tag = reader.uint32(); 57 | switch (tag >>> 3) { 58 | case 1: 59 | message.fromAddress = reader.string(); 60 | break; 61 | case 2: 62 | message.toAddress = reader.string(); 63 | break; 64 | case 3: 65 | message.amount.push(Coin.decode(reader, reader.uint32())); 66 | break; 67 | case 4: 68 | message.endTime = reader.int64() as Long; 69 | break; 70 | case 5: 71 | message.delayed = reader.bool(); 72 | break; 73 | default: 74 | reader.skipType(tag & 7); 75 | break; 76 | } 77 | } 78 | return message; 79 | }, 80 | 81 | fromJSON(object: any): MsgCreateVestingAccount { 82 | const message = { ...baseMsgCreateVestingAccount } as MsgCreateVestingAccount; 83 | message.amount = []; 84 | if (object.fromAddress !== undefined && object.fromAddress !== null) { 85 | message.fromAddress = String(object.fromAddress); 86 | } else { 87 | message.fromAddress = ""; 88 | } 89 | if (object.toAddress !== undefined && object.toAddress !== null) { 90 | message.toAddress = String(object.toAddress); 91 | } else { 92 | message.toAddress = ""; 93 | } 94 | if (object.amount !== undefined && object.amount !== null) { 95 | for (const e of object.amount) { 96 | message.amount.push(Coin.fromJSON(e)); 97 | } 98 | } 99 | if (object.endTime !== undefined && object.endTime !== null) { 100 | message.endTime = Long.fromString(object.endTime); 101 | } else { 102 | message.endTime = Long.ZERO; 103 | } 104 | if (object.delayed !== undefined && object.delayed !== null) { 105 | message.delayed = Boolean(object.delayed); 106 | } else { 107 | message.delayed = false; 108 | } 109 | return message; 110 | }, 111 | 112 | toJSON(message: MsgCreateVestingAccount): unknown { 113 | const obj: any = {}; 114 | message.fromAddress !== undefined && (obj.fromAddress = message.fromAddress); 115 | message.toAddress !== undefined && (obj.toAddress = message.toAddress); 116 | if (message.amount) { 117 | obj.amount = message.amount.map((e) => (e ? Coin.toJSON(e) : undefined)); 118 | } else { 119 | obj.amount = []; 120 | } 121 | message.endTime !== undefined && (obj.endTime = (message.endTime || Long.ZERO).toString()); 122 | message.delayed !== undefined && (obj.delayed = message.delayed); 123 | return obj; 124 | }, 125 | 126 | fromPartial(object: DeepPartial): MsgCreateVestingAccount { 127 | const message = { ...baseMsgCreateVestingAccount } as MsgCreateVestingAccount; 128 | message.amount = []; 129 | if (object.fromAddress !== undefined && object.fromAddress !== null) { 130 | message.fromAddress = object.fromAddress; 131 | } else { 132 | message.fromAddress = ""; 133 | } 134 | if (object.toAddress !== undefined && object.toAddress !== null) { 135 | message.toAddress = object.toAddress; 136 | } else { 137 | message.toAddress = ""; 138 | } 139 | if (object.amount !== undefined && object.amount !== null) { 140 | for (const e of object.amount) { 141 | message.amount.push(Coin.fromPartial(e)); 142 | } 143 | } 144 | if (object.endTime !== undefined && object.endTime !== null) { 145 | message.endTime = object.endTime as Long; 146 | } else { 147 | message.endTime = Long.ZERO; 148 | } 149 | if (object.delayed !== undefined && object.delayed !== null) { 150 | message.delayed = object.delayed; 151 | } else { 152 | message.delayed = false; 153 | } 154 | return message; 155 | }, 156 | }; 157 | 158 | const baseMsgCreateVestingAccountResponse: object = {}; 159 | 160 | export const MsgCreateVestingAccountResponse = { 161 | encode(_: MsgCreateVestingAccountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 162 | return writer; 163 | }, 164 | 165 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateVestingAccountResponse { 166 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 167 | let end = length === undefined ? reader.len : reader.pos + length; 168 | const message = { ...baseMsgCreateVestingAccountResponse } as MsgCreateVestingAccountResponse; 169 | while (reader.pos < end) { 170 | const tag = reader.uint32(); 171 | switch (tag >>> 3) { 172 | default: 173 | reader.skipType(tag & 7); 174 | break; 175 | } 176 | } 177 | return message; 178 | }, 179 | 180 | fromJSON(_: any): MsgCreateVestingAccountResponse { 181 | const message = { ...baseMsgCreateVestingAccountResponse } as MsgCreateVestingAccountResponse; 182 | return message; 183 | }, 184 | 185 | toJSON(_: MsgCreateVestingAccountResponse): unknown { 186 | const obj: any = {}; 187 | return obj; 188 | }, 189 | 190 | fromPartial(_: DeepPartial): MsgCreateVestingAccountResponse { 191 | const message = { ...baseMsgCreateVestingAccountResponse } as MsgCreateVestingAccountResponse; 192 | return message; 193 | }, 194 | }; 195 | 196 | /** Msg defines the bank Msg service. */ 197 | export interface Msg { 198 | /** 199 | * CreateVestingAccount defines a method that enables creating a vesting 200 | * account. 201 | */ 202 | CreateVestingAccount(request: MsgCreateVestingAccount): Promise; 203 | } 204 | 205 | export class MsgClientImpl implements Msg { 206 | private readonly rpc: Rpc; 207 | constructor(rpc: Rpc) { 208 | this.rpc = rpc; 209 | this.CreateVestingAccount = this.CreateVestingAccount.bind(this); 210 | } 211 | CreateVestingAccount(request: MsgCreateVestingAccount): Promise { 212 | const data = MsgCreateVestingAccount.encode(request).finish(); 213 | const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); 214 | return promise.then((data) => MsgCreateVestingAccountResponse.decode(new _m0.Reader(data))); 215 | } 216 | } 217 | 218 | interface Rpc { 219 | request(service: string, method: string, data: Uint8Array): Promise; 220 | } 221 | 222 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 223 | export type DeepPartial = T extends Builtin 224 | ? T 225 | : T extends Array 226 | ? Array> 227 | : T extends ReadonlyArray 228 | ? ReadonlyArray> 229 | : T extends {} 230 | ? { [K in keyof T]?: DeepPartial } 231 | : Partial; 232 | 233 | if (_m0.util.Long !== Long) { 234 | _m0.util.Long = Long as any; 235 | _m0.configure(); 236 | } 237 | -------------------------------------------------------------------------------- /src/cosmos_proto/cosmos.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmos_proto"; 6 | 7 | if (_m0.util.Long !== Long) { 8 | _m0.util.Long = Long as any; 9 | _m0.configure(); 10 | } 11 | -------------------------------------------------------------------------------- /src/cosmwasm/wasm/v1/ibc.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmwasm.wasm.v1"; 6 | 7 | /** MsgIBCSend */ 8 | export interface MsgIBCSend { 9 | /** the channel by which the packet will be sent */ 10 | channel: string; 11 | /** 12 | * Timeout height relative to the current block height. 13 | * The timeout is disabled when set to 0. 14 | */ 15 | timeoutHeight: Long; 16 | /** 17 | * Timeout timestamp (in nanoseconds) relative to the current block timestamp. 18 | * The timeout is disabled when set to 0. 19 | */ 20 | timeoutTimestamp: Long; 21 | /** data is the payload to transfer */ 22 | data: Uint8Array; 23 | } 24 | 25 | /** MsgIBCCloseChannel port and channel need to be owned by the contract */ 26 | export interface MsgIBCCloseChannel { 27 | channel: string; 28 | } 29 | 30 | const baseMsgIBCSend: object = { channel: "", timeoutHeight: Long.UZERO, timeoutTimestamp: Long.UZERO }; 31 | 32 | export const MsgIBCSend = { 33 | encode(message: MsgIBCSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 34 | if (message.channel !== "") { 35 | writer.uint32(18).string(message.channel); 36 | } 37 | if (!message.timeoutHeight.isZero()) { 38 | writer.uint32(32).uint64(message.timeoutHeight); 39 | } 40 | if (!message.timeoutTimestamp.isZero()) { 41 | writer.uint32(40).uint64(message.timeoutTimestamp); 42 | } 43 | if (message.data.length !== 0) { 44 | writer.uint32(50).bytes(message.data); 45 | } 46 | return writer; 47 | }, 48 | 49 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSend { 50 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 51 | let end = length === undefined ? reader.len : reader.pos + length; 52 | const message = { ...baseMsgIBCSend } as MsgIBCSend; 53 | message.data = new Uint8Array(); 54 | while (reader.pos < end) { 55 | const tag = reader.uint32(); 56 | switch (tag >>> 3) { 57 | case 2: 58 | message.channel = reader.string(); 59 | break; 60 | case 4: 61 | message.timeoutHeight = reader.uint64() as Long; 62 | break; 63 | case 5: 64 | message.timeoutTimestamp = reader.uint64() as Long; 65 | break; 66 | case 6: 67 | message.data = reader.bytes(); 68 | break; 69 | default: 70 | reader.skipType(tag & 7); 71 | break; 72 | } 73 | } 74 | return message; 75 | }, 76 | 77 | fromJSON(object: any): MsgIBCSend { 78 | const message = { ...baseMsgIBCSend } as MsgIBCSend; 79 | message.data = new Uint8Array(); 80 | if (object.channel !== undefined && object.channel !== null) { 81 | message.channel = String(object.channel); 82 | } else { 83 | message.channel = ""; 84 | } 85 | if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { 86 | message.timeoutHeight = Long.fromString(object.timeoutHeight); 87 | } else { 88 | message.timeoutHeight = Long.UZERO; 89 | } 90 | if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { 91 | message.timeoutTimestamp = Long.fromString(object.timeoutTimestamp); 92 | } else { 93 | message.timeoutTimestamp = Long.UZERO; 94 | } 95 | if (object.data !== undefined && object.data !== null) { 96 | message.data = bytesFromBase64(object.data); 97 | } 98 | return message; 99 | }, 100 | 101 | toJSON(message: MsgIBCSend): unknown { 102 | const obj: any = {}; 103 | message.channel !== undefined && (obj.channel = message.channel); 104 | message.timeoutHeight !== undefined && 105 | (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); 106 | message.timeoutTimestamp !== undefined && 107 | (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); 108 | message.data !== undefined && 109 | (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); 110 | return obj; 111 | }, 112 | 113 | fromPartial(object: DeepPartial): MsgIBCSend { 114 | const message = { ...baseMsgIBCSend } as MsgIBCSend; 115 | if (object.channel !== undefined && object.channel !== null) { 116 | message.channel = object.channel; 117 | } else { 118 | message.channel = ""; 119 | } 120 | if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { 121 | message.timeoutHeight = object.timeoutHeight as Long; 122 | } else { 123 | message.timeoutHeight = Long.UZERO; 124 | } 125 | if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { 126 | message.timeoutTimestamp = object.timeoutTimestamp as Long; 127 | } else { 128 | message.timeoutTimestamp = Long.UZERO; 129 | } 130 | if (object.data !== undefined && object.data !== null) { 131 | message.data = object.data; 132 | } else { 133 | message.data = new Uint8Array(); 134 | } 135 | return message; 136 | }, 137 | }; 138 | 139 | const baseMsgIBCCloseChannel: object = { channel: "" }; 140 | 141 | export const MsgIBCCloseChannel = { 142 | encode(message: MsgIBCCloseChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 143 | if (message.channel !== "") { 144 | writer.uint32(18).string(message.channel); 145 | } 146 | return writer; 147 | }, 148 | 149 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCCloseChannel { 150 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 151 | let end = length === undefined ? reader.len : reader.pos + length; 152 | const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; 153 | while (reader.pos < end) { 154 | const tag = reader.uint32(); 155 | switch (tag >>> 3) { 156 | case 2: 157 | message.channel = reader.string(); 158 | break; 159 | default: 160 | reader.skipType(tag & 7); 161 | break; 162 | } 163 | } 164 | return message; 165 | }, 166 | 167 | fromJSON(object: any): MsgIBCCloseChannel { 168 | const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; 169 | if (object.channel !== undefined && object.channel !== null) { 170 | message.channel = String(object.channel); 171 | } else { 172 | message.channel = ""; 173 | } 174 | return message; 175 | }, 176 | 177 | toJSON(message: MsgIBCCloseChannel): unknown { 178 | const obj: any = {}; 179 | message.channel !== undefined && (obj.channel = message.channel); 180 | return obj; 181 | }, 182 | 183 | fromPartial(object: DeepPartial): MsgIBCCloseChannel { 184 | const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; 185 | if (object.channel !== undefined && object.channel !== null) { 186 | message.channel = object.channel; 187 | } else { 188 | message.channel = ""; 189 | } 190 | return message; 191 | }, 192 | }; 193 | 194 | declare var self: any | undefined; 195 | declare var window: any | undefined; 196 | var globalThis: any = (() => { 197 | if (typeof globalThis !== "undefined") return globalThis; 198 | if (typeof self !== "undefined") return self; 199 | if (typeof window !== "undefined") return window; 200 | if (typeof global !== "undefined") return global; 201 | throw "Unable to locate global object"; 202 | })(); 203 | 204 | const atob: (b64: string) => string = 205 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 206 | function bytesFromBase64(b64: string): Uint8Array { 207 | const bin = atob(b64); 208 | const arr = new Uint8Array(bin.length); 209 | for (let i = 0; i < bin.length; ++i) { 210 | arr[i] = bin.charCodeAt(i); 211 | } 212 | return arr; 213 | } 214 | 215 | const btoa: (bin: string) => string = 216 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 217 | function base64FromBytes(arr: Uint8Array): string { 218 | const bin: string[] = []; 219 | for (let i = 0; i < arr.byteLength; ++i) { 220 | bin.push(String.fromCharCode(arr[i])); 221 | } 222 | return btoa(bin.join("")); 223 | } 224 | 225 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 226 | export type DeepPartial = T extends Builtin 227 | ? T 228 | : T extends Array 229 | ? Array> 230 | : T extends ReadonlyArray 231 | ? ReadonlyArray> 232 | : T extends {} 233 | ? { [K in keyof T]?: DeepPartial } 234 | : Partial; 235 | 236 | if (_m0.util.Long !== Long) { 237 | _m0.util.Long = Long as any; 238 | _m0.configure(); 239 | } 240 | -------------------------------------------------------------------------------- /src/cosmwasm/wasm/v1beta1/ibc.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "cosmwasm.wasm.v1beta1"; 6 | 7 | /** MsgIBCSend */ 8 | export interface MsgIBCSend { 9 | /** the channel by which the packet will be sent */ 10 | channel: string; 11 | /** 12 | * Timeout height relative to the current block height. 13 | * The timeout is disabled when set to 0. 14 | */ 15 | timeoutHeight: Long; 16 | /** 17 | * Timeout timestamp (in nanoseconds) relative to the current block timestamp. 18 | * The timeout is disabled when set to 0. 19 | */ 20 | timeoutTimestamp: Long; 21 | /** data is the payload to transfer */ 22 | data: Uint8Array; 23 | } 24 | 25 | /** MsgIBCCloseChannel port and channel need to be owned by the contract */ 26 | export interface MsgIBCCloseChannel { 27 | channel: string; 28 | } 29 | 30 | const baseMsgIBCSend: object = { channel: "", timeoutHeight: Long.UZERO, timeoutTimestamp: Long.UZERO }; 31 | 32 | export const MsgIBCSend = { 33 | encode(message: MsgIBCSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 34 | if (message.channel !== "") { 35 | writer.uint32(18).string(message.channel); 36 | } 37 | if (!message.timeoutHeight.isZero()) { 38 | writer.uint32(32).uint64(message.timeoutHeight); 39 | } 40 | if (!message.timeoutTimestamp.isZero()) { 41 | writer.uint32(40).uint64(message.timeoutTimestamp); 42 | } 43 | if (message.data.length !== 0) { 44 | writer.uint32(50).bytes(message.data); 45 | } 46 | return writer; 47 | }, 48 | 49 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCSend { 50 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 51 | let end = length === undefined ? reader.len : reader.pos + length; 52 | const message = { ...baseMsgIBCSend } as MsgIBCSend; 53 | message.data = new Uint8Array(); 54 | while (reader.pos < end) { 55 | const tag = reader.uint32(); 56 | switch (tag >>> 3) { 57 | case 2: 58 | message.channel = reader.string(); 59 | break; 60 | case 4: 61 | message.timeoutHeight = reader.uint64() as Long; 62 | break; 63 | case 5: 64 | message.timeoutTimestamp = reader.uint64() as Long; 65 | break; 66 | case 6: 67 | message.data = reader.bytes(); 68 | break; 69 | default: 70 | reader.skipType(tag & 7); 71 | break; 72 | } 73 | } 74 | return message; 75 | }, 76 | 77 | fromJSON(object: any): MsgIBCSend { 78 | const message = { ...baseMsgIBCSend } as MsgIBCSend; 79 | message.data = new Uint8Array(); 80 | if (object.channel !== undefined && object.channel !== null) { 81 | message.channel = String(object.channel); 82 | } else { 83 | message.channel = ""; 84 | } 85 | if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { 86 | message.timeoutHeight = Long.fromString(object.timeoutHeight); 87 | } else { 88 | message.timeoutHeight = Long.UZERO; 89 | } 90 | if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { 91 | message.timeoutTimestamp = Long.fromString(object.timeoutTimestamp); 92 | } else { 93 | message.timeoutTimestamp = Long.UZERO; 94 | } 95 | if (object.data !== undefined && object.data !== null) { 96 | message.data = bytesFromBase64(object.data); 97 | } 98 | return message; 99 | }, 100 | 101 | toJSON(message: MsgIBCSend): unknown { 102 | const obj: any = {}; 103 | message.channel !== undefined && (obj.channel = message.channel); 104 | message.timeoutHeight !== undefined && 105 | (obj.timeoutHeight = (message.timeoutHeight || Long.UZERO).toString()); 106 | message.timeoutTimestamp !== undefined && 107 | (obj.timeoutTimestamp = (message.timeoutTimestamp || Long.UZERO).toString()); 108 | message.data !== undefined && 109 | (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); 110 | return obj; 111 | }, 112 | 113 | fromPartial(object: DeepPartial): MsgIBCSend { 114 | const message = { ...baseMsgIBCSend } as MsgIBCSend; 115 | if (object.channel !== undefined && object.channel !== null) { 116 | message.channel = object.channel; 117 | } else { 118 | message.channel = ""; 119 | } 120 | if (object.timeoutHeight !== undefined && object.timeoutHeight !== null) { 121 | message.timeoutHeight = object.timeoutHeight as Long; 122 | } else { 123 | message.timeoutHeight = Long.UZERO; 124 | } 125 | if (object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null) { 126 | message.timeoutTimestamp = object.timeoutTimestamp as Long; 127 | } else { 128 | message.timeoutTimestamp = Long.UZERO; 129 | } 130 | if (object.data !== undefined && object.data !== null) { 131 | message.data = object.data; 132 | } else { 133 | message.data = new Uint8Array(); 134 | } 135 | return message; 136 | }, 137 | }; 138 | 139 | const baseMsgIBCCloseChannel: object = { channel: "" }; 140 | 141 | export const MsgIBCCloseChannel = { 142 | encode(message: MsgIBCCloseChannel, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 143 | if (message.channel !== "") { 144 | writer.uint32(18).string(message.channel); 145 | } 146 | return writer; 147 | }, 148 | 149 | decode(input: _m0.Reader | Uint8Array, length?: number): MsgIBCCloseChannel { 150 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 151 | let end = length === undefined ? reader.len : reader.pos + length; 152 | const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; 153 | while (reader.pos < end) { 154 | const tag = reader.uint32(); 155 | switch (tag >>> 3) { 156 | case 2: 157 | message.channel = reader.string(); 158 | break; 159 | default: 160 | reader.skipType(tag & 7); 161 | break; 162 | } 163 | } 164 | return message; 165 | }, 166 | 167 | fromJSON(object: any): MsgIBCCloseChannel { 168 | const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; 169 | if (object.channel !== undefined && object.channel !== null) { 170 | message.channel = String(object.channel); 171 | } else { 172 | message.channel = ""; 173 | } 174 | return message; 175 | }, 176 | 177 | toJSON(message: MsgIBCCloseChannel): unknown { 178 | const obj: any = {}; 179 | message.channel !== undefined && (obj.channel = message.channel); 180 | return obj; 181 | }, 182 | 183 | fromPartial(object: DeepPartial): MsgIBCCloseChannel { 184 | const message = { ...baseMsgIBCCloseChannel } as MsgIBCCloseChannel; 185 | if (object.channel !== undefined && object.channel !== null) { 186 | message.channel = object.channel; 187 | } else { 188 | message.channel = ""; 189 | } 190 | return message; 191 | }, 192 | }; 193 | 194 | declare var self: any | undefined; 195 | declare var window: any | undefined; 196 | var globalThis: any = (() => { 197 | if (typeof globalThis !== "undefined") return globalThis; 198 | if (typeof self !== "undefined") return self; 199 | if (typeof window !== "undefined") return window; 200 | if (typeof global !== "undefined") return global; 201 | throw "Unable to locate global object"; 202 | })(); 203 | 204 | const atob: (b64: string) => string = 205 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 206 | function bytesFromBase64(b64: string): Uint8Array { 207 | const bin = atob(b64); 208 | const arr = new Uint8Array(bin.length); 209 | for (let i = 0; i < bin.length; ++i) { 210 | arr[i] = bin.charCodeAt(i); 211 | } 212 | return arr; 213 | } 214 | 215 | const btoa: (bin: string) => string = 216 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 217 | function base64FromBytes(arr: Uint8Array): string { 218 | const bin: string[] = []; 219 | for (let i = 0; i < arr.byteLength; ++i) { 220 | bin.push(String.fromCharCode(arr[i])); 221 | } 222 | return btoa(bin.join("")); 223 | } 224 | 225 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 226 | export type DeepPartial = T extends Builtin 227 | ? T 228 | : T extends Array 229 | ? Array> 230 | : T extends ReadonlyArray 231 | ? ReadonlyArray> 232 | : T extends {} 233 | ? { [K in keyof T]?: DeepPartial } 234 | : Partial; 235 | 236 | if (_m0.util.Long !== Long) { 237 | _m0.util.Long = Long as any; 238 | _m0.configure(); 239 | } 240 | -------------------------------------------------------------------------------- /src/gogoproto/gogo.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "gogoproto"; 6 | 7 | if (_m0.util.Long !== Long) { 8 | _m0.util.Long = Long as any; 9 | _m0.configure(); 10 | } 11 | -------------------------------------------------------------------------------- /src/google/api/annotations.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "google.api"; 6 | 7 | if (_m0.util.Long !== Long) { 8 | _m0.util.Long = Long as any; 9 | _m0.configure(); 10 | } 11 | -------------------------------------------------------------------------------- /src/google/protobuf/any.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "google.protobuf"; 6 | 7 | /** 8 | * `Any` contains an arbitrary serialized protocol buffer message along with a 9 | * URL that describes the type of the serialized message. 10 | * 11 | * Protobuf library provides support to pack/unpack Any values in the form 12 | * of utility functions or additional generated methods of the Any type. 13 | * 14 | * Example 1: Pack and unpack a message in C++. 15 | * 16 | * Foo foo = ...; 17 | * Any any; 18 | * any.PackFrom(foo); 19 | * ... 20 | * if (any.UnpackTo(&foo)) { 21 | * ... 22 | * } 23 | * 24 | * Example 2: Pack and unpack a message in Java. 25 | * 26 | * Foo foo = ...; 27 | * Any any = Any.pack(foo); 28 | * ... 29 | * if (any.is(Foo.class)) { 30 | * foo = any.unpack(Foo.class); 31 | * } 32 | * 33 | * Example 3: Pack and unpack a message in Python. 34 | * 35 | * foo = Foo(...) 36 | * any = Any() 37 | * any.Pack(foo) 38 | * ... 39 | * if any.Is(Foo.DESCRIPTOR): 40 | * any.Unpack(foo) 41 | * ... 42 | * 43 | * Example 4: Pack and unpack a message in Go 44 | * 45 | * foo := &pb.Foo{...} 46 | * any, err := ptypes.MarshalAny(foo) 47 | * ... 48 | * foo := &pb.Foo{} 49 | * if err := ptypes.UnmarshalAny(any, foo); err != nil { 50 | * ... 51 | * } 52 | * 53 | * The pack methods provided by protobuf library will by default use 54 | * 'type.googleapis.com/full.type.name' as the type URL and the unpack 55 | * methods only use the fully qualified type name after the last '/' 56 | * in the type URL, for example "foo.bar.com/x/y.z" will yield type 57 | * name "y.z". 58 | * 59 | * 60 | * JSON 61 | * ==== 62 | * The JSON representation of an `Any` value uses the regular 63 | * representation of the deserialized, embedded message, with an 64 | * additional field `@type` which contains the type URL. Example: 65 | * 66 | * package google.profile; 67 | * message Person { 68 | * string first_name = 1; 69 | * string last_name = 2; 70 | * } 71 | * 72 | * { 73 | * "@type": "type.googleapis.com/google.profile.Person", 74 | * "firstName": , 75 | * "lastName": 76 | * } 77 | * 78 | * If the embedded message type is well-known and has a custom JSON 79 | * representation, that representation will be embedded adding a field 80 | * `value` which holds the custom JSON in addition to the `@type` 81 | * field. Example (for message [google.protobuf.Duration][]): 82 | * 83 | * { 84 | * "@type": "type.googleapis.com/google.protobuf.Duration", 85 | * "value": "1.212s" 86 | * } 87 | */ 88 | export interface Any { 89 | /** 90 | * A URL/resource name that uniquely identifies the type of the serialized 91 | * protocol buffer message. This string must contain at least 92 | * one "/" character. The last segment of the URL's path must represent 93 | * the fully qualified name of the type (as in 94 | * `path/google.protobuf.Duration`). The name should be in a canonical form 95 | * (e.g., leading "." is not accepted). 96 | * 97 | * In practice, teams usually precompile into the binary all types that they 98 | * expect it to use in the context of Any. However, for URLs which use the 99 | * scheme `http`, `https`, or no scheme, one can optionally set up a type 100 | * server that maps type URLs to message definitions as follows: 101 | * 102 | * * If no scheme is provided, `https` is assumed. 103 | * * An HTTP GET on the URL must yield a [google.protobuf.Type][] 104 | * value in binary format, or produce an error. 105 | * * Applications are allowed to cache lookup results based on the 106 | * URL, or have them precompiled into a binary to avoid any 107 | * lookup. Therefore, binary compatibility needs to be preserved 108 | * on changes to types. (Use versioned type names to manage 109 | * breaking changes.) 110 | * 111 | * Note: this functionality is not currently available in the official 112 | * protobuf release, and it is not used for type URLs beginning with 113 | * type.googleapis.com. 114 | * 115 | * Schemes other than `http`, `https` (or the empty scheme) might be 116 | * used with implementation specific semantics. 117 | */ 118 | typeUrl: string; 119 | /** Must be a valid serialized protocol buffer of the above specified type. */ 120 | value: Uint8Array; 121 | } 122 | 123 | const baseAny: object = { typeUrl: "" }; 124 | 125 | export const Any = { 126 | encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 127 | if (message.typeUrl !== "") { 128 | writer.uint32(10).string(message.typeUrl); 129 | } 130 | if (message.value.length !== 0) { 131 | writer.uint32(18).bytes(message.value); 132 | } 133 | return writer; 134 | }, 135 | 136 | decode(input: _m0.Reader | Uint8Array, length?: number): Any { 137 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 138 | let end = length === undefined ? reader.len : reader.pos + length; 139 | const message = { ...baseAny } as Any; 140 | message.value = new Uint8Array(); 141 | while (reader.pos < end) { 142 | const tag = reader.uint32(); 143 | switch (tag >>> 3) { 144 | case 1: 145 | message.typeUrl = reader.string(); 146 | break; 147 | case 2: 148 | message.value = reader.bytes(); 149 | break; 150 | default: 151 | reader.skipType(tag & 7); 152 | break; 153 | } 154 | } 155 | return message; 156 | }, 157 | 158 | fromJSON(object: any): Any { 159 | const message = { ...baseAny } as Any; 160 | message.value = new Uint8Array(); 161 | if (object.typeUrl !== undefined && object.typeUrl !== null) { 162 | message.typeUrl = String(object.typeUrl); 163 | } else { 164 | message.typeUrl = ""; 165 | } 166 | if (object.value !== undefined && object.value !== null) { 167 | message.value = bytesFromBase64(object.value); 168 | } 169 | return message; 170 | }, 171 | 172 | toJSON(message: Any): unknown { 173 | const obj: any = {}; 174 | message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); 175 | message.value !== undefined && 176 | (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); 177 | return obj; 178 | }, 179 | 180 | fromPartial(object: DeepPartial): Any { 181 | const message = { ...baseAny } as Any; 182 | if (object.typeUrl !== undefined && object.typeUrl !== null) { 183 | message.typeUrl = object.typeUrl; 184 | } else { 185 | message.typeUrl = ""; 186 | } 187 | if (object.value !== undefined && object.value !== null) { 188 | message.value = object.value; 189 | } else { 190 | message.value = new Uint8Array(); 191 | } 192 | return message; 193 | }, 194 | }; 195 | 196 | declare var self: any | undefined; 197 | declare var window: any | undefined; 198 | var globalThis: any = (() => { 199 | if (typeof globalThis !== "undefined") return globalThis; 200 | if (typeof self !== "undefined") return self; 201 | if (typeof window !== "undefined") return window; 202 | if (typeof global !== "undefined") return global; 203 | throw "Unable to locate global object"; 204 | })(); 205 | 206 | const atob: (b64: string) => string = 207 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 208 | function bytesFromBase64(b64: string): Uint8Array { 209 | const bin = atob(b64); 210 | const arr = new Uint8Array(bin.length); 211 | for (let i = 0; i < bin.length; ++i) { 212 | arr[i] = bin.charCodeAt(i); 213 | } 214 | return arr; 215 | } 216 | 217 | const btoa: (bin: string) => string = 218 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 219 | function base64FromBytes(arr: Uint8Array): string { 220 | const bin: string[] = []; 221 | for (let i = 0; i < arr.byteLength; ++i) { 222 | bin.push(String.fromCharCode(arr[i])); 223 | } 224 | return btoa(bin.join("")); 225 | } 226 | 227 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 228 | export type DeepPartial = T extends Builtin 229 | ? T 230 | : T extends Array 231 | ? Array> 232 | : T extends ReadonlyArray 233 | ? ReadonlyArray> 234 | : T extends {} 235 | ? { [K in keyof T]?: DeepPartial } 236 | : Partial; 237 | 238 | if (_m0.util.Long !== Long) { 239 | _m0.util.Long = Long as any; 240 | _m0.configure(); 241 | } 242 | -------------------------------------------------------------------------------- /src/google/protobuf/duration.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "google.protobuf"; 6 | 7 | /** 8 | * A Duration represents a signed, fixed-length span of time represented 9 | * as a count of seconds and fractions of seconds at nanosecond 10 | * resolution. It is independent of any calendar and concepts like "day" 11 | * or "month". It is related to Timestamp in that the difference between 12 | * two Timestamp values is a Duration and it can be added or subtracted 13 | * from a Timestamp. Range is approximately +-10,000 years. 14 | * 15 | * # Examples 16 | * 17 | * Example 1: Compute Duration from two Timestamps in pseudo code. 18 | * 19 | * Timestamp start = ...; 20 | * Timestamp end = ...; 21 | * Duration duration = ...; 22 | * 23 | * duration.seconds = end.seconds - start.seconds; 24 | * duration.nanos = end.nanos - start.nanos; 25 | * 26 | * if (duration.seconds < 0 && duration.nanos > 0) { 27 | * duration.seconds += 1; 28 | * duration.nanos -= 1000000000; 29 | * } else if (duration.seconds > 0 && duration.nanos < 0) { 30 | * duration.seconds -= 1; 31 | * duration.nanos += 1000000000; 32 | * } 33 | * 34 | * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. 35 | * 36 | * Timestamp start = ...; 37 | * Duration duration = ...; 38 | * Timestamp end = ...; 39 | * 40 | * end.seconds = start.seconds + duration.seconds; 41 | * end.nanos = start.nanos + duration.nanos; 42 | * 43 | * if (end.nanos < 0) { 44 | * end.seconds -= 1; 45 | * end.nanos += 1000000000; 46 | * } else if (end.nanos >= 1000000000) { 47 | * end.seconds += 1; 48 | * end.nanos -= 1000000000; 49 | * } 50 | * 51 | * Example 3: Compute Duration from datetime.timedelta in Python. 52 | * 53 | * td = datetime.timedelta(days=3, minutes=10) 54 | * duration = Duration() 55 | * duration.FromTimedelta(td) 56 | * 57 | * # JSON Mapping 58 | * 59 | * In JSON format, the Duration type is encoded as a string rather than an 60 | * object, where the string ends in the suffix "s" (indicating seconds) and 61 | * is preceded by the number of seconds, with nanoseconds expressed as 62 | * fractional seconds. For example, 3 seconds with 0 nanoseconds should be 63 | * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should 64 | * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 65 | * microsecond should be expressed in JSON format as "3.000001s". 66 | */ 67 | export interface Duration { 68 | /** 69 | * Signed seconds of the span of time. Must be from -315,576,000,000 70 | * to +315,576,000,000 inclusive. Note: these bounds are computed from: 71 | * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years 72 | */ 73 | seconds: Long; 74 | /** 75 | * Signed fractions of a second at nanosecond resolution of the span 76 | * of time. Durations less than one second are represented with a 0 77 | * `seconds` field and a positive or negative `nanos` field. For durations 78 | * of one second or more, a non-zero value for the `nanos` field must be 79 | * of the same sign as the `seconds` field. Must be from -999,999,999 80 | * to +999,999,999 inclusive. 81 | */ 82 | nanos: number; 83 | } 84 | 85 | const baseDuration: object = { seconds: Long.ZERO, nanos: 0 }; 86 | 87 | export const Duration = { 88 | encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 89 | if (!message.seconds.isZero()) { 90 | writer.uint32(8).int64(message.seconds); 91 | } 92 | if (message.nanos !== 0) { 93 | writer.uint32(16).int32(message.nanos); 94 | } 95 | return writer; 96 | }, 97 | 98 | decode(input: _m0.Reader | Uint8Array, length?: number): Duration { 99 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 100 | let end = length === undefined ? reader.len : reader.pos + length; 101 | const message = { ...baseDuration } as Duration; 102 | while (reader.pos < end) { 103 | const tag = reader.uint32(); 104 | switch (tag >>> 3) { 105 | case 1: 106 | message.seconds = reader.int64() as Long; 107 | break; 108 | case 2: 109 | message.nanos = reader.int32(); 110 | break; 111 | default: 112 | reader.skipType(tag & 7); 113 | break; 114 | } 115 | } 116 | return message; 117 | }, 118 | 119 | fromJSON(object: any): Duration { 120 | const message = { ...baseDuration } as Duration; 121 | if (object.seconds !== undefined && object.seconds !== null) { 122 | message.seconds = Long.fromString(object.seconds); 123 | } else { 124 | message.seconds = Long.ZERO; 125 | } 126 | if (object.nanos !== undefined && object.nanos !== null) { 127 | message.nanos = Number(object.nanos); 128 | } else { 129 | message.nanos = 0; 130 | } 131 | return message; 132 | }, 133 | 134 | toJSON(message: Duration): unknown { 135 | const obj: any = {}; 136 | message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); 137 | message.nanos !== undefined && (obj.nanos = message.nanos); 138 | return obj; 139 | }, 140 | 141 | fromPartial(object: DeepPartial): Duration { 142 | const message = { ...baseDuration } as Duration; 143 | if (object.seconds !== undefined && object.seconds !== null) { 144 | message.seconds = object.seconds as Long; 145 | } else { 146 | message.seconds = Long.ZERO; 147 | } 148 | if (object.nanos !== undefined && object.nanos !== null) { 149 | message.nanos = object.nanos; 150 | } else { 151 | message.nanos = 0; 152 | } 153 | return message; 154 | }, 155 | }; 156 | 157 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 158 | export type DeepPartial = T extends Builtin 159 | ? T 160 | : T extends Array 161 | ? Array> 162 | : T extends ReadonlyArray 163 | ? ReadonlyArray> 164 | : T extends {} 165 | ? { [K in keyof T]?: DeepPartial } 166 | : Partial; 167 | 168 | if (_m0.util.Long !== Long) { 169 | _m0.util.Long = Long as any; 170 | _m0.configure(); 171 | } 172 | -------------------------------------------------------------------------------- /src/google/protobuf/timestamp.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "google.protobuf"; 6 | 7 | /** 8 | * A Timestamp represents a point in time independent of any time zone or local 9 | * calendar, encoded as a count of seconds and fractions of seconds at 10 | * nanosecond resolution. The count is relative to an epoch at UTC midnight on 11 | * January 1, 1970, in the proleptic Gregorian calendar which extends the 12 | * Gregorian calendar backwards to year one. 13 | * 14 | * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap 15 | * second table is needed for interpretation, using a [24-hour linear 16 | * smear](https://developers.google.com/time/smear). 17 | * 18 | * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By 19 | * restricting to that range, we ensure that we can convert to and from [RFC 20 | * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. 21 | * 22 | * # Examples 23 | * 24 | * Example 1: Compute Timestamp from POSIX `time()`. 25 | * 26 | * Timestamp timestamp; 27 | * timestamp.set_seconds(time(NULL)); 28 | * timestamp.set_nanos(0); 29 | * 30 | * Example 2: Compute Timestamp from POSIX `gettimeofday()`. 31 | * 32 | * struct timeval tv; 33 | * gettimeofday(&tv, NULL); 34 | * 35 | * Timestamp timestamp; 36 | * timestamp.set_seconds(tv.tv_sec); 37 | * timestamp.set_nanos(tv.tv_usec * 1000); 38 | * 39 | * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. 40 | * 41 | * FILETIME ft; 42 | * GetSystemTimeAsFileTime(&ft); 43 | * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; 44 | * 45 | * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z 46 | * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. 47 | * Timestamp timestamp; 48 | * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); 49 | * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); 50 | * 51 | * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. 52 | * 53 | * long millis = System.currentTimeMillis(); 54 | * 55 | * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) 56 | * .setNanos((int) ((millis % 1000) * 1000000)).build(); 57 | * 58 | * 59 | * Example 5: Compute Timestamp from Java `Instant.now()`. 60 | * 61 | * Instant now = Instant.now(); 62 | * 63 | * Timestamp timestamp = 64 | * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) 65 | * .setNanos(now.getNano()).build(); 66 | * 67 | * 68 | * Example 6: Compute Timestamp from current time in Python. 69 | * 70 | * timestamp = Timestamp() 71 | * timestamp.GetCurrentTime() 72 | * 73 | * # JSON Mapping 74 | * 75 | * In JSON format, the Timestamp type is encoded as a string in the 76 | * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the 77 | * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" 78 | * where {year} is always expressed using four digits while {month}, {day}, 79 | * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional 80 | * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), 81 | * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone 82 | * is required. A proto3 JSON serializer should always use UTC (as indicated by 83 | * "Z") when printing the Timestamp type and a proto3 JSON parser should be 84 | * able to accept both UTC and other timezones (as indicated by an offset). 85 | * 86 | * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 87 | * 01:30 UTC on January 15, 2017. 88 | * 89 | * In JavaScript, one can convert a Date object to this format using the 90 | * standard 91 | * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) 92 | * method. In Python, a standard `datetime.datetime` object can be converted 93 | * to this format using 94 | * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with 95 | * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use 96 | * the Joda Time's [`ISODateTimeFormat.dateTime()`]( 97 | * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D 98 | * ) to obtain a formatter capable of generating timestamps in this format. 99 | */ 100 | export interface Timestamp { 101 | /** 102 | * Represents seconds of UTC time since Unix epoch 103 | * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 104 | * 9999-12-31T23:59:59Z inclusive. 105 | */ 106 | seconds: Long; 107 | /** 108 | * Non-negative fractions of a second at nanosecond resolution. Negative 109 | * second values with fractions must still have non-negative nanos values 110 | * that count forward in time. Must be from 0 to 999,999,999 111 | * inclusive. 112 | */ 113 | nanos: number; 114 | } 115 | 116 | const baseTimestamp: object = { seconds: Long.ZERO, nanos: 0 }; 117 | 118 | export const Timestamp = { 119 | encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 120 | if (!message.seconds.isZero()) { 121 | writer.uint32(8).int64(message.seconds); 122 | } 123 | if (message.nanos !== 0) { 124 | writer.uint32(16).int32(message.nanos); 125 | } 126 | return writer; 127 | }, 128 | 129 | decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { 130 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 131 | let end = length === undefined ? reader.len : reader.pos + length; 132 | const message = { ...baseTimestamp } as Timestamp; 133 | while (reader.pos < end) { 134 | const tag = reader.uint32(); 135 | switch (tag >>> 3) { 136 | case 1: 137 | message.seconds = reader.int64() as Long; 138 | break; 139 | case 2: 140 | message.nanos = reader.int32(); 141 | break; 142 | default: 143 | reader.skipType(tag & 7); 144 | break; 145 | } 146 | } 147 | return message; 148 | }, 149 | 150 | fromJSON(object: any): Timestamp { 151 | const message = { ...baseTimestamp } as Timestamp; 152 | if (object.seconds !== undefined && object.seconds !== null) { 153 | message.seconds = Long.fromString(object.seconds); 154 | } else { 155 | message.seconds = Long.ZERO; 156 | } 157 | if (object.nanos !== undefined && object.nanos !== null) { 158 | message.nanos = Number(object.nanos); 159 | } else { 160 | message.nanos = 0; 161 | } 162 | return message; 163 | }, 164 | 165 | toJSON(message: Timestamp): unknown { 166 | const obj: any = {}; 167 | message.seconds !== undefined && (obj.seconds = (message.seconds || Long.ZERO).toString()); 168 | message.nanos !== undefined && (obj.nanos = message.nanos); 169 | return obj; 170 | }, 171 | 172 | fromPartial(object: DeepPartial): Timestamp { 173 | const message = { ...baseTimestamp } as Timestamp; 174 | if (object.seconds !== undefined && object.seconds !== null) { 175 | message.seconds = object.seconds as Long; 176 | } else { 177 | message.seconds = Long.ZERO; 178 | } 179 | if (object.nanos !== undefined && object.nanos !== null) { 180 | message.nanos = object.nanos; 181 | } else { 182 | message.nanos = 0; 183 | } 184 | return message; 185 | }, 186 | }; 187 | 188 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 189 | export type DeepPartial = T extends Builtin 190 | ? T 191 | : T extends Array 192 | ? Array> 193 | : T extends ReadonlyArray 194 | ? ReadonlyArray> 195 | : T extends {} 196 | ? { [K in keyof T]?: DeepPartial } 197 | : Partial; 198 | 199 | if (_m0.util.Long !== Long) { 200 | _m0.util.Long = Long as any; 201 | _m0.configure(); 202 | } 203 | -------------------------------------------------------------------------------- /src/ibc/applications/transfer/v1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Params, DenomTrace } from "../../../../ibc/applications/transfer/v1/transfer"; 5 | 6 | export const protobufPackage = "ibc.applications.transfer.v1"; 7 | 8 | /** GenesisState defines the ibc-transfer genesis state */ 9 | export interface GenesisState { 10 | portId: string; 11 | denomTraces: DenomTrace[]; 12 | params?: Params; 13 | } 14 | 15 | const baseGenesisState: object = { portId: "" }; 16 | 17 | export const GenesisState = { 18 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 19 | if (message.portId !== "") { 20 | writer.uint32(10).string(message.portId); 21 | } 22 | for (const v of message.denomTraces) { 23 | DenomTrace.encode(v!, writer.uint32(18).fork()).ldelim(); 24 | } 25 | if (message.params !== undefined) { 26 | Params.encode(message.params, writer.uint32(26).fork()).ldelim(); 27 | } 28 | return writer; 29 | }, 30 | 31 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 32 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 33 | let end = length === undefined ? reader.len : reader.pos + length; 34 | const message = { ...baseGenesisState } as GenesisState; 35 | message.denomTraces = []; 36 | while (reader.pos < end) { 37 | const tag = reader.uint32(); 38 | switch (tag >>> 3) { 39 | case 1: 40 | message.portId = reader.string(); 41 | break; 42 | case 2: 43 | message.denomTraces.push(DenomTrace.decode(reader, reader.uint32())); 44 | break; 45 | case 3: 46 | message.params = Params.decode(reader, reader.uint32()); 47 | break; 48 | default: 49 | reader.skipType(tag & 7); 50 | break; 51 | } 52 | } 53 | return message; 54 | }, 55 | 56 | fromJSON(object: any): GenesisState { 57 | const message = { ...baseGenesisState } as GenesisState; 58 | message.denomTraces = []; 59 | if (object.portId !== undefined && object.portId !== null) { 60 | message.portId = String(object.portId); 61 | } else { 62 | message.portId = ""; 63 | } 64 | if (object.denomTraces !== undefined && object.denomTraces !== null) { 65 | for (const e of object.denomTraces) { 66 | message.denomTraces.push(DenomTrace.fromJSON(e)); 67 | } 68 | } 69 | if (object.params !== undefined && object.params !== null) { 70 | message.params = Params.fromJSON(object.params); 71 | } else { 72 | message.params = undefined; 73 | } 74 | return message; 75 | }, 76 | 77 | toJSON(message: GenesisState): unknown { 78 | const obj: any = {}; 79 | message.portId !== undefined && (obj.portId = message.portId); 80 | if (message.denomTraces) { 81 | obj.denomTraces = message.denomTraces.map((e) => (e ? DenomTrace.toJSON(e) : undefined)); 82 | } else { 83 | obj.denomTraces = []; 84 | } 85 | message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); 86 | return obj; 87 | }, 88 | 89 | fromPartial(object: DeepPartial): GenesisState { 90 | const message = { ...baseGenesisState } as GenesisState; 91 | message.denomTraces = []; 92 | if (object.portId !== undefined && object.portId !== null) { 93 | message.portId = object.portId; 94 | } else { 95 | message.portId = ""; 96 | } 97 | if (object.denomTraces !== undefined && object.denomTraces !== null) { 98 | for (const e of object.denomTraces) { 99 | message.denomTraces.push(DenomTrace.fromPartial(e)); 100 | } 101 | } 102 | if (object.params !== undefined && object.params !== null) { 103 | message.params = Params.fromPartial(object.params); 104 | } else { 105 | message.params = undefined; 106 | } 107 | return message; 108 | }, 109 | }; 110 | 111 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 112 | export type DeepPartial = T extends Builtin 113 | ? T 114 | : T extends Array 115 | ? Array> 116 | : T extends ReadonlyArray 117 | ? ReadonlyArray> 118 | : T extends {} 119 | ? { [K in keyof T]?: DeepPartial } 120 | : Partial; 121 | 122 | if (_m0.util.Long !== Long) { 123 | _m0.util.Long = Long as any; 124 | _m0.configure(); 125 | } 126 | -------------------------------------------------------------------------------- /src/ibc/core/connection/v1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { IdentifiedConnection, ConnectionPaths } from "../../../../ibc/core/connection/v1/connection"; 5 | 6 | export const protobufPackage = "ibc.core.connection.v1"; 7 | 8 | /** GenesisState defines the ibc connection submodule's genesis state. */ 9 | export interface GenesisState { 10 | connections: IdentifiedConnection[]; 11 | clientConnectionPaths: ConnectionPaths[]; 12 | /** the sequence for the next generated connection identifier */ 13 | nextConnectionSequence: Long; 14 | } 15 | 16 | const baseGenesisState: object = { nextConnectionSequence: Long.UZERO }; 17 | 18 | export const GenesisState = { 19 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 20 | for (const v of message.connections) { 21 | IdentifiedConnection.encode(v!, writer.uint32(10).fork()).ldelim(); 22 | } 23 | for (const v of message.clientConnectionPaths) { 24 | ConnectionPaths.encode(v!, writer.uint32(18).fork()).ldelim(); 25 | } 26 | if (!message.nextConnectionSequence.isZero()) { 27 | writer.uint32(24).uint64(message.nextConnectionSequence); 28 | } 29 | return writer; 30 | }, 31 | 32 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 33 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 34 | let end = length === undefined ? reader.len : reader.pos + length; 35 | const message = { ...baseGenesisState } as GenesisState; 36 | message.connections = []; 37 | message.clientConnectionPaths = []; 38 | while (reader.pos < end) { 39 | const tag = reader.uint32(); 40 | switch (tag >>> 3) { 41 | case 1: 42 | message.connections.push(IdentifiedConnection.decode(reader, reader.uint32())); 43 | break; 44 | case 2: 45 | message.clientConnectionPaths.push(ConnectionPaths.decode(reader, reader.uint32())); 46 | break; 47 | case 3: 48 | message.nextConnectionSequence = reader.uint64() as Long; 49 | break; 50 | default: 51 | reader.skipType(tag & 7); 52 | break; 53 | } 54 | } 55 | return message; 56 | }, 57 | 58 | fromJSON(object: any): GenesisState { 59 | const message = { ...baseGenesisState } as GenesisState; 60 | message.connections = []; 61 | message.clientConnectionPaths = []; 62 | if (object.connections !== undefined && object.connections !== null) { 63 | for (const e of object.connections) { 64 | message.connections.push(IdentifiedConnection.fromJSON(e)); 65 | } 66 | } 67 | if (object.clientConnectionPaths !== undefined && object.clientConnectionPaths !== null) { 68 | for (const e of object.clientConnectionPaths) { 69 | message.clientConnectionPaths.push(ConnectionPaths.fromJSON(e)); 70 | } 71 | } 72 | if (object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null) { 73 | message.nextConnectionSequence = Long.fromString(object.nextConnectionSequence); 74 | } else { 75 | message.nextConnectionSequence = Long.UZERO; 76 | } 77 | return message; 78 | }, 79 | 80 | toJSON(message: GenesisState): unknown { 81 | const obj: any = {}; 82 | if (message.connections) { 83 | obj.connections = message.connections.map((e) => (e ? IdentifiedConnection.toJSON(e) : undefined)); 84 | } else { 85 | obj.connections = []; 86 | } 87 | if (message.clientConnectionPaths) { 88 | obj.clientConnectionPaths = message.clientConnectionPaths.map((e) => 89 | e ? ConnectionPaths.toJSON(e) : undefined, 90 | ); 91 | } else { 92 | obj.clientConnectionPaths = []; 93 | } 94 | message.nextConnectionSequence !== undefined && 95 | (obj.nextConnectionSequence = (message.nextConnectionSequence || Long.UZERO).toString()); 96 | return obj; 97 | }, 98 | 99 | fromPartial(object: DeepPartial): GenesisState { 100 | const message = { ...baseGenesisState } as GenesisState; 101 | message.connections = []; 102 | message.clientConnectionPaths = []; 103 | if (object.connections !== undefined && object.connections !== null) { 104 | for (const e of object.connections) { 105 | message.connections.push(IdentifiedConnection.fromPartial(e)); 106 | } 107 | } 108 | if (object.clientConnectionPaths !== undefined && object.clientConnectionPaths !== null) { 109 | for (const e of object.clientConnectionPaths) { 110 | message.clientConnectionPaths.push(ConnectionPaths.fromPartial(e)); 111 | } 112 | } 113 | if (object.nextConnectionSequence !== undefined && object.nextConnectionSequence !== null) { 114 | message.nextConnectionSequence = object.nextConnectionSequence as Long; 115 | } else { 116 | message.nextConnectionSequence = Long.UZERO; 117 | } 118 | return message; 119 | }, 120 | }; 121 | 122 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 123 | export type DeepPartial = T extends Builtin 124 | ? T 125 | : T extends Array 126 | ? Array> 127 | : T extends ReadonlyArray 128 | ? ReadonlyArray> 129 | : T extends {} 130 | ? { [K in keyof T]?: DeepPartial } 131 | : Partial; 132 | 133 | if (_m0.util.Long !== Long) { 134 | _m0.util.Long = Long as any; 135 | _m0.configure(); 136 | } 137 | -------------------------------------------------------------------------------- /src/ibc/core/types/v1/genesis.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { GenesisState as GenesisState1 } from "../../../../ibc/core/client/v1/genesis"; 5 | import { GenesisState as GenesisState2 } from "../../../../ibc/core/connection/v1/genesis"; 6 | import { GenesisState as GenesisState3 } from "../../../../ibc/core/channel/v1/genesis"; 7 | 8 | export const protobufPackage = "ibc.core.types.v1"; 9 | 10 | /** GenesisState defines the ibc module's genesis state. */ 11 | export interface GenesisState { 12 | /** ICS002 - Clients genesis state */ 13 | clientGenesis?: GenesisState1; 14 | /** ICS003 - Connections genesis state */ 15 | connectionGenesis?: GenesisState2; 16 | /** ICS004 - Channel genesis state */ 17 | channelGenesis?: GenesisState3; 18 | } 19 | 20 | const baseGenesisState: object = {}; 21 | 22 | export const GenesisState = { 23 | encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 24 | if (message.clientGenesis !== undefined) { 25 | GenesisState1.encode(message.clientGenesis, writer.uint32(10).fork()).ldelim(); 26 | } 27 | if (message.connectionGenesis !== undefined) { 28 | GenesisState2.encode(message.connectionGenesis, writer.uint32(18).fork()).ldelim(); 29 | } 30 | if (message.channelGenesis !== undefined) { 31 | GenesisState3.encode(message.channelGenesis, writer.uint32(26).fork()).ldelim(); 32 | } 33 | return writer; 34 | }, 35 | 36 | decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { 37 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 38 | let end = length === undefined ? reader.len : reader.pos + length; 39 | const message = { ...baseGenesisState } as GenesisState; 40 | while (reader.pos < end) { 41 | const tag = reader.uint32(); 42 | switch (tag >>> 3) { 43 | case 1: 44 | message.clientGenesis = GenesisState1.decode(reader, reader.uint32()); 45 | break; 46 | case 2: 47 | message.connectionGenesis = GenesisState2.decode(reader, reader.uint32()); 48 | break; 49 | case 3: 50 | message.channelGenesis = GenesisState3.decode(reader, reader.uint32()); 51 | break; 52 | default: 53 | reader.skipType(tag & 7); 54 | break; 55 | } 56 | } 57 | return message; 58 | }, 59 | 60 | fromJSON(object: any): GenesisState { 61 | const message = { ...baseGenesisState } as GenesisState; 62 | if (object.clientGenesis !== undefined && object.clientGenesis !== null) { 63 | message.clientGenesis = GenesisState1.fromJSON(object.clientGenesis); 64 | } else { 65 | message.clientGenesis = undefined; 66 | } 67 | if (object.connectionGenesis !== undefined && object.connectionGenesis !== null) { 68 | message.connectionGenesis = GenesisState2.fromJSON(object.connectionGenesis); 69 | } else { 70 | message.connectionGenesis = undefined; 71 | } 72 | if (object.channelGenesis !== undefined && object.channelGenesis !== null) { 73 | message.channelGenesis = GenesisState3.fromJSON(object.channelGenesis); 74 | } else { 75 | message.channelGenesis = undefined; 76 | } 77 | return message; 78 | }, 79 | 80 | toJSON(message: GenesisState): unknown { 81 | const obj: any = {}; 82 | message.clientGenesis !== undefined && 83 | (obj.clientGenesis = message.clientGenesis ? GenesisState1.toJSON(message.clientGenesis) : undefined); 84 | message.connectionGenesis !== undefined && 85 | (obj.connectionGenesis = message.connectionGenesis 86 | ? GenesisState2.toJSON(message.connectionGenesis) 87 | : undefined); 88 | message.channelGenesis !== undefined && 89 | (obj.channelGenesis = message.channelGenesis 90 | ? GenesisState3.toJSON(message.channelGenesis) 91 | : undefined); 92 | return obj; 93 | }, 94 | 95 | fromPartial(object: DeepPartial): GenesisState { 96 | const message = { ...baseGenesisState } as GenesisState; 97 | if (object.clientGenesis !== undefined && object.clientGenesis !== null) { 98 | message.clientGenesis = GenesisState1.fromPartial(object.clientGenesis); 99 | } else { 100 | message.clientGenesis = undefined; 101 | } 102 | if (object.connectionGenesis !== undefined && object.connectionGenesis !== null) { 103 | message.connectionGenesis = GenesisState2.fromPartial(object.connectionGenesis); 104 | } else { 105 | message.connectionGenesis = undefined; 106 | } 107 | if (object.channelGenesis !== undefined && object.channelGenesis !== null) { 108 | message.channelGenesis = GenesisState3.fromPartial(object.channelGenesis); 109 | } else { 110 | message.channelGenesis = undefined; 111 | } 112 | return message; 113 | }, 114 | }; 115 | 116 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 117 | export type DeepPartial = T extends Builtin 118 | ? T 119 | : T extends Array 120 | ? Array> 121 | : T extends ReadonlyArray 122 | ? ReadonlyArray> 123 | : T extends {} 124 | ? { [K in keyof T]?: DeepPartial } 125 | : Partial; 126 | 127 | if (_m0.util.Long !== Long) { 128 | _m0.util.Long = Long as any; 129 | _m0.configure(); 130 | } 131 | -------------------------------------------------------------------------------- /src/ibc/lightclients/localhost/v1/localhost.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Height } from "../../../../ibc/core/client/v1/client"; 5 | 6 | export const protobufPackage = "ibc.lightclients.localhost.v1"; 7 | 8 | /** 9 | * ClientState defines a loopback (localhost) client. It requires (read-only) 10 | * access to keys outside the client prefix. 11 | */ 12 | export interface ClientState { 13 | /** self chain ID */ 14 | chainId: string; 15 | /** self latest block height */ 16 | height?: Height; 17 | } 18 | 19 | const baseClientState: object = { chainId: "" }; 20 | 21 | export const ClientState = { 22 | encode(message: ClientState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 23 | if (message.chainId !== "") { 24 | writer.uint32(10).string(message.chainId); 25 | } 26 | if (message.height !== undefined) { 27 | Height.encode(message.height, writer.uint32(18).fork()).ldelim(); 28 | } 29 | return writer; 30 | }, 31 | 32 | decode(input: _m0.Reader | Uint8Array, length?: number): ClientState { 33 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 34 | let end = length === undefined ? reader.len : reader.pos + length; 35 | const message = { ...baseClientState } as ClientState; 36 | while (reader.pos < end) { 37 | const tag = reader.uint32(); 38 | switch (tag >>> 3) { 39 | case 1: 40 | message.chainId = reader.string(); 41 | break; 42 | case 2: 43 | message.height = Height.decode(reader, reader.uint32()); 44 | break; 45 | default: 46 | reader.skipType(tag & 7); 47 | break; 48 | } 49 | } 50 | return message; 51 | }, 52 | 53 | fromJSON(object: any): ClientState { 54 | const message = { ...baseClientState } as ClientState; 55 | if (object.chainId !== undefined && object.chainId !== null) { 56 | message.chainId = String(object.chainId); 57 | } else { 58 | message.chainId = ""; 59 | } 60 | if (object.height !== undefined && object.height !== null) { 61 | message.height = Height.fromJSON(object.height); 62 | } else { 63 | message.height = undefined; 64 | } 65 | return message; 66 | }, 67 | 68 | toJSON(message: ClientState): unknown { 69 | const obj: any = {}; 70 | message.chainId !== undefined && (obj.chainId = message.chainId); 71 | message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); 72 | return obj; 73 | }, 74 | 75 | fromPartial(object: DeepPartial): ClientState { 76 | const message = { ...baseClientState } as ClientState; 77 | if (object.chainId !== undefined && object.chainId !== null) { 78 | message.chainId = object.chainId; 79 | } else { 80 | message.chainId = ""; 81 | } 82 | if (object.height !== undefined && object.height !== null) { 83 | message.height = Height.fromPartial(object.height); 84 | } else { 85 | message.height = undefined; 86 | } 87 | return message; 88 | }, 89 | }; 90 | 91 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 92 | export type DeepPartial = T extends Builtin 93 | ? T 94 | : T extends Array 95 | ? Array> 96 | : T extends ReadonlyArray 97 | ? ReadonlyArray> 98 | : T extends {} 99 | ? { [K in keyof T]?: DeepPartial } 100 | : Partial; 101 | 102 | if (_m0.util.Long !== Long) { 103 | _m0.util.Long = Long as any; 104 | _m0.configure(); 105 | } 106 | -------------------------------------------------------------------------------- /src/tendermint/crypto/keys.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "tendermint.crypto"; 6 | 7 | /** PublicKey defines the keys available for use with Tendermint Validators */ 8 | export interface PublicKey { 9 | ed25519: Uint8Array | undefined; 10 | secp256k1: Uint8Array | undefined; 11 | } 12 | 13 | const basePublicKey: object = {}; 14 | 15 | export const PublicKey = { 16 | encode(message: PublicKey, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 17 | if (message.ed25519 !== undefined) { 18 | writer.uint32(10).bytes(message.ed25519); 19 | } 20 | if (message.secp256k1 !== undefined) { 21 | writer.uint32(18).bytes(message.secp256k1); 22 | } 23 | return writer; 24 | }, 25 | 26 | decode(input: _m0.Reader | Uint8Array, length?: number): PublicKey { 27 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 28 | let end = length === undefined ? reader.len : reader.pos + length; 29 | const message = { ...basePublicKey } as PublicKey; 30 | while (reader.pos < end) { 31 | const tag = reader.uint32(); 32 | switch (tag >>> 3) { 33 | case 1: 34 | message.ed25519 = reader.bytes(); 35 | break; 36 | case 2: 37 | message.secp256k1 = reader.bytes(); 38 | break; 39 | default: 40 | reader.skipType(tag & 7); 41 | break; 42 | } 43 | } 44 | return message; 45 | }, 46 | 47 | fromJSON(object: any): PublicKey { 48 | const message = { ...basePublicKey } as PublicKey; 49 | if (object.ed25519 !== undefined && object.ed25519 !== null) { 50 | message.ed25519 = bytesFromBase64(object.ed25519); 51 | } 52 | if (object.secp256k1 !== undefined && object.secp256k1 !== null) { 53 | message.secp256k1 = bytesFromBase64(object.secp256k1); 54 | } 55 | return message; 56 | }, 57 | 58 | toJSON(message: PublicKey): unknown { 59 | const obj: any = {}; 60 | message.ed25519 !== undefined && 61 | (obj.ed25519 = message.ed25519 !== undefined ? base64FromBytes(message.ed25519) : undefined); 62 | message.secp256k1 !== undefined && 63 | (obj.secp256k1 = message.secp256k1 !== undefined ? base64FromBytes(message.secp256k1) : undefined); 64 | return obj; 65 | }, 66 | 67 | fromPartial(object: DeepPartial): PublicKey { 68 | const message = { ...basePublicKey } as PublicKey; 69 | if (object.ed25519 !== undefined && object.ed25519 !== null) { 70 | message.ed25519 = object.ed25519; 71 | } else { 72 | message.ed25519 = undefined; 73 | } 74 | if (object.secp256k1 !== undefined && object.secp256k1 !== null) { 75 | message.secp256k1 = object.secp256k1; 76 | } else { 77 | message.secp256k1 = undefined; 78 | } 79 | return message; 80 | }, 81 | }; 82 | 83 | declare var self: any | undefined; 84 | declare var window: any | undefined; 85 | var globalThis: any = (() => { 86 | if (typeof globalThis !== "undefined") return globalThis; 87 | if (typeof self !== "undefined") return self; 88 | if (typeof window !== "undefined") return window; 89 | if (typeof global !== "undefined") return global; 90 | throw "Unable to locate global object"; 91 | })(); 92 | 93 | const atob: (b64: string) => string = 94 | globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); 95 | function bytesFromBase64(b64: string): Uint8Array { 96 | const bin = atob(b64); 97 | const arr = new Uint8Array(bin.length); 98 | for (let i = 0; i < bin.length; ++i) { 99 | arr[i] = bin.charCodeAt(i); 100 | } 101 | return arr; 102 | } 103 | 104 | const btoa: (bin: string) => string = 105 | globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); 106 | function base64FromBytes(arr: Uint8Array): string { 107 | const bin: string[] = []; 108 | for (let i = 0; i < arr.byteLength; ++i) { 109 | bin.push(String.fromCharCode(arr[i])); 110 | } 111 | return btoa(bin.join("")); 112 | } 113 | 114 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 115 | export type DeepPartial = T extends Builtin 116 | ? T 117 | : T extends Array 118 | ? Array> 119 | : T extends ReadonlyArray 120 | ? ReadonlyArray> 121 | : T extends {} 122 | ? { [K in keyof T]?: DeepPartial } 123 | : Partial; 124 | 125 | if (_m0.util.Long !== Long) { 126 | _m0.util.Long = Long as any; 127 | _m0.configure(); 128 | } 129 | -------------------------------------------------------------------------------- /src/tendermint/types/block.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | import { Header, Data, Commit } from "../../tendermint/types/types"; 5 | import { EvidenceList } from "../../tendermint/types/evidence"; 6 | 7 | export const protobufPackage = "tendermint.types"; 8 | 9 | export interface Block { 10 | header?: Header; 11 | data?: Data; 12 | evidence?: EvidenceList; 13 | lastCommit?: Commit; 14 | } 15 | 16 | const baseBlock: object = {}; 17 | 18 | export const Block = { 19 | encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 20 | if (message.header !== undefined) { 21 | Header.encode(message.header, writer.uint32(10).fork()).ldelim(); 22 | } 23 | if (message.data !== undefined) { 24 | Data.encode(message.data, writer.uint32(18).fork()).ldelim(); 25 | } 26 | if (message.evidence !== undefined) { 27 | EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); 28 | } 29 | if (message.lastCommit !== undefined) { 30 | Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); 31 | } 32 | return writer; 33 | }, 34 | 35 | decode(input: _m0.Reader | Uint8Array, length?: number): Block { 36 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 37 | let end = length === undefined ? reader.len : reader.pos + length; 38 | const message = { ...baseBlock } as Block; 39 | while (reader.pos < end) { 40 | const tag = reader.uint32(); 41 | switch (tag >>> 3) { 42 | case 1: 43 | message.header = Header.decode(reader, reader.uint32()); 44 | break; 45 | case 2: 46 | message.data = Data.decode(reader, reader.uint32()); 47 | break; 48 | case 3: 49 | message.evidence = EvidenceList.decode(reader, reader.uint32()); 50 | break; 51 | case 4: 52 | message.lastCommit = Commit.decode(reader, reader.uint32()); 53 | break; 54 | default: 55 | reader.skipType(tag & 7); 56 | break; 57 | } 58 | } 59 | return message; 60 | }, 61 | 62 | fromJSON(object: any): Block { 63 | const message = { ...baseBlock } as Block; 64 | if (object.header !== undefined && object.header !== null) { 65 | message.header = Header.fromJSON(object.header); 66 | } else { 67 | message.header = undefined; 68 | } 69 | if (object.data !== undefined && object.data !== null) { 70 | message.data = Data.fromJSON(object.data); 71 | } else { 72 | message.data = undefined; 73 | } 74 | if (object.evidence !== undefined && object.evidence !== null) { 75 | message.evidence = EvidenceList.fromJSON(object.evidence); 76 | } else { 77 | message.evidence = undefined; 78 | } 79 | if (object.lastCommit !== undefined && object.lastCommit !== null) { 80 | message.lastCommit = Commit.fromJSON(object.lastCommit); 81 | } else { 82 | message.lastCommit = undefined; 83 | } 84 | return message; 85 | }, 86 | 87 | toJSON(message: Block): unknown { 88 | const obj: any = {}; 89 | message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined); 90 | message.data !== undefined && (obj.data = message.data ? Data.toJSON(message.data) : undefined); 91 | message.evidence !== undefined && 92 | (obj.evidence = message.evidence ? EvidenceList.toJSON(message.evidence) : undefined); 93 | message.lastCommit !== undefined && 94 | (obj.lastCommit = message.lastCommit ? Commit.toJSON(message.lastCommit) : undefined); 95 | return obj; 96 | }, 97 | 98 | fromPartial(object: DeepPartial): Block { 99 | const message = { ...baseBlock } as Block; 100 | if (object.header !== undefined && object.header !== null) { 101 | message.header = Header.fromPartial(object.header); 102 | } else { 103 | message.header = undefined; 104 | } 105 | if (object.data !== undefined && object.data !== null) { 106 | message.data = Data.fromPartial(object.data); 107 | } else { 108 | message.data = undefined; 109 | } 110 | if (object.evidence !== undefined && object.evidence !== null) { 111 | message.evidence = EvidenceList.fromPartial(object.evidence); 112 | } else { 113 | message.evidence = undefined; 114 | } 115 | if (object.lastCommit !== undefined && object.lastCommit !== null) { 116 | message.lastCommit = Commit.fromPartial(object.lastCommit); 117 | } else { 118 | message.lastCommit = undefined; 119 | } 120 | return message; 121 | }, 122 | }; 123 | 124 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 125 | export type DeepPartial = T extends Builtin 126 | ? T 127 | : T extends Array 128 | ? Array> 129 | : T extends ReadonlyArray 130 | ? ReadonlyArray> 131 | : T extends {} 132 | ? { [K in keyof T]?: DeepPartial } 133 | : Partial; 134 | 135 | if (_m0.util.Long !== Long) { 136 | _m0.util.Long = Long as any; 137 | _m0.configure(); 138 | } 139 | -------------------------------------------------------------------------------- /src/tendermint/version/types.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import Long from "long"; 3 | import _m0 from "protobufjs/minimal"; 4 | 5 | export const protobufPackage = "tendermint.version"; 6 | 7 | /** 8 | * App includes the protocol and software version for the application. 9 | * This information is included in ResponseInfo. The App.Protocol can be 10 | * updated in ResponseEndBlock. 11 | */ 12 | export interface App { 13 | protocol: Long; 14 | software: string; 15 | } 16 | 17 | /** 18 | * Consensus captures the consensus rules for processing a block in the blockchain, 19 | * including all blockchain data structures and the rules of the application's 20 | * state transition machine. 21 | */ 22 | export interface Consensus { 23 | block: Long; 24 | app: Long; 25 | } 26 | 27 | const baseApp: object = { protocol: Long.UZERO, software: "" }; 28 | 29 | export const App = { 30 | encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 31 | if (!message.protocol.isZero()) { 32 | writer.uint32(8).uint64(message.protocol); 33 | } 34 | if (message.software !== "") { 35 | writer.uint32(18).string(message.software); 36 | } 37 | return writer; 38 | }, 39 | 40 | decode(input: _m0.Reader | Uint8Array, length?: number): App { 41 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 42 | let end = length === undefined ? reader.len : reader.pos + length; 43 | const message = { ...baseApp } as App; 44 | while (reader.pos < end) { 45 | const tag = reader.uint32(); 46 | switch (tag >>> 3) { 47 | case 1: 48 | message.protocol = reader.uint64() as Long; 49 | break; 50 | case 2: 51 | message.software = reader.string(); 52 | break; 53 | default: 54 | reader.skipType(tag & 7); 55 | break; 56 | } 57 | } 58 | return message; 59 | }, 60 | 61 | fromJSON(object: any): App { 62 | const message = { ...baseApp } as App; 63 | if (object.protocol !== undefined && object.protocol !== null) { 64 | message.protocol = Long.fromString(object.protocol); 65 | } else { 66 | message.protocol = Long.UZERO; 67 | } 68 | if (object.software !== undefined && object.software !== null) { 69 | message.software = String(object.software); 70 | } else { 71 | message.software = ""; 72 | } 73 | return message; 74 | }, 75 | 76 | toJSON(message: App): unknown { 77 | const obj: any = {}; 78 | message.protocol !== undefined && (obj.protocol = (message.protocol || Long.UZERO).toString()); 79 | message.software !== undefined && (obj.software = message.software); 80 | return obj; 81 | }, 82 | 83 | fromPartial(object: DeepPartial): App { 84 | const message = { ...baseApp } as App; 85 | if (object.protocol !== undefined && object.protocol !== null) { 86 | message.protocol = object.protocol as Long; 87 | } else { 88 | message.protocol = Long.UZERO; 89 | } 90 | if (object.software !== undefined && object.software !== null) { 91 | message.software = object.software; 92 | } else { 93 | message.software = ""; 94 | } 95 | return message; 96 | }, 97 | }; 98 | 99 | const baseConsensus: object = { block: Long.UZERO, app: Long.UZERO }; 100 | 101 | export const Consensus = { 102 | encode(message: Consensus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { 103 | if (!message.block.isZero()) { 104 | writer.uint32(8).uint64(message.block); 105 | } 106 | if (!message.app.isZero()) { 107 | writer.uint32(16).uint64(message.app); 108 | } 109 | return writer; 110 | }, 111 | 112 | decode(input: _m0.Reader | Uint8Array, length?: number): Consensus { 113 | const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); 114 | let end = length === undefined ? reader.len : reader.pos + length; 115 | const message = { ...baseConsensus } as Consensus; 116 | while (reader.pos < end) { 117 | const tag = reader.uint32(); 118 | switch (tag >>> 3) { 119 | case 1: 120 | message.block = reader.uint64() as Long; 121 | break; 122 | case 2: 123 | message.app = reader.uint64() as Long; 124 | break; 125 | default: 126 | reader.skipType(tag & 7); 127 | break; 128 | } 129 | } 130 | return message; 131 | }, 132 | 133 | fromJSON(object: any): Consensus { 134 | const message = { ...baseConsensus } as Consensus; 135 | if (object.block !== undefined && object.block !== null) { 136 | message.block = Long.fromString(object.block); 137 | } else { 138 | message.block = Long.UZERO; 139 | } 140 | if (object.app !== undefined && object.app !== null) { 141 | message.app = Long.fromString(object.app); 142 | } else { 143 | message.app = Long.UZERO; 144 | } 145 | return message; 146 | }, 147 | 148 | toJSON(message: Consensus): unknown { 149 | const obj: any = {}; 150 | message.block !== undefined && (obj.block = (message.block || Long.UZERO).toString()); 151 | message.app !== undefined && (obj.app = (message.app || Long.UZERO).toString()); 152 | return obj; 153 | }, 154 | 155 | fromPartial(object: DeepPartial): Consensus { 156 | const message = { ...baseConsensus } as Consensus; 157 | if (object.block !== undefined && object.block !== null) { 158 | message.block = object.block as Long; 159 | } else { 160 | message.block = Long.UZERO; 161 | } 162 | if (object.app !== undefined && object.app !== null) { 163 | message.app = object.app as Long; 164 | } else { 165 | message.app = Long.UZERO; 166 | } 167 | return message; 168 | }, 169 | }; 170 | 171 | type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long; 172 | export type DeepPartial = T extends Builtin 173 | ? T 174 | : T extends Array 175 | ? Array> 176 | : T extends ReadonlyArray 177 | ? ReadonlyArray> 178 | : T extends {} 179 | ? { [K in keyof T]?: DeepPartial } 180 | : Partial; 181 | 182 | if (_m0.util.Long !== Long) { 183 | _m0.util.Long = Long as any; 184 | _m0.configure(); 185 | } 186 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "forceConsistentCasingInFileNames": true, 7 | "lib": ["es2017"], 8 | "module": "commonjs", 9 | "moduleResolution": "node", 10 | "newLine": "LF", 11 | "noEmitOnError": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "noImplicitReturns": true, 14 | "noUnusedLocals": false, 15 | "noUnusedParameters": false, 16 | "outDir": "build", 17 | "pretty": true, 18 | "removeComments": false, 19 | "resolveJsonModule": true, 20 | "rootDir": "src", 21 | "sourceMap": true, 22 | "strict": true, 23 | "target": "es2017" 24 | }, 25 | "include": ["src/**/*"] 26 | } 27 | --------------------------------------------------------------------------------