From aa682aeaaaa039cccaee44d82bf1fc5de871cf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20Elesb=C3=A3o?= Date: Thu, 12 Sep 2024 11:15:38 +0200 Subject: [PATCH 1/3] build(deps): bump `cosmjs` to `0.32.4` --- package.json | 12 +- packages/arch3-core/package.json | 16 +-- packages/arch3-proto/package.json | 8 +- yarn.lock | 192 +++++++++++++++--------------- 4 files changed, 114 insertions(+), 114 deletions(-) diff --git a/package.json b/package.json index c39e9ef..f2fe4de 100644 --- a/package.json +++ b/package.json @@ -71,12 +71,12 @@ ] }, "resolutions": { - "@cosmjs/amino": "^0.32.2", - "@cosmjs/cosmwasm-stargate": "^0.32.2", - "@cosmjs/math": "^0.32.2", - "@cosmjs/proto-signing": "^0.32.2", - "@cosmjs/stargate": "^0.32.2", - "@cosmjs/tendermint-rpc": "^0.32.2" + "@cosmjs/amino": "^0.32.4", + "@cosmjs/cosmwasm-stargate": "^0.32.4", + "@cosmjs/math": "^0.32.4", + "@cosmjs/proto-signing": "^0.32.4", + "@cosmjs/stargate": "^0.32.4", + "@cosmjs/tendermint-rpc": "^0.32.4" }, "dependencies": { "@archwayhq/arch3-core": "workspace:^", diff --git a/packages/arch3-core/package.json b/packages/arch3-core/package.json index e6a3b74..51a9111 100644 --- a/packages/arch3-core/package.json +++ b/packages/arch3-core/package.json @@ -54,14 +54,14 @@ }, "dependencies": { "@archwayhq/arch3-proto": "workspace:^", - "@cosmjs/amino": "^0.32.2", - "@cosmjs/cosmwasm-stargate": "^0.32.2", - "@cosmjs/encoding": "^0.32.2", - "@cosmjs/math": "^0.32.2", - "@cosmjs/proto-signing": "^0.32.2", - "@cosmjs/stargate": "^0.32.2", - "@cosmjs/tendermint-rpc": "^0.32.2", - "@cosmjs/utils": "^0.32.2", + "@cosmjs/amino": "^0.32.4", + "@cosmjs/cosmwasm-stargate": "^0.32.4", + "@cosmjs/encoding": "^0.32.4", + "@cosmjs/math": "^0.32.4", + "@cosmjs/proto-signing": "^0.32.4", + "@cosmjs/stargate": "^0.32.4", + "@cosmjs/tendermint-rpc": "^0.32.4", + "@cosmjs/utils": "^0.32.4", "cosmjs-types": "^0.9.0", "lodash": "^4.17.21" }, diff --git a/packages/arch3-proto/package.json b/packages/arch3-proto/package.json index 69ea179..f5808d7 100644 --- a/packages/arch3-proto/package.json +++ b/packages/arch3-proto/package.json @@ -54,10 +54,10 @@ "docs": "typedoc" }, "dependencies": { - "@cosmjs/amino": "^0.32.2", - "@cosmjs/proto-signing": "^0.32.2", - "@cosmjs/stargate": "^0.32.2", - "@cosmjs/tendermint-rpc": "^0.32.2", + "@cosmjs/amino": "^0.32.4", + "@cosmjs/proto-signing": "^0.32.4", + "@cosmjs/stargate": "^0.32.4", + "@cosmjs/tendermint-rpc": "^0.32.4", "protobufjs": "^7.2.5" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index c853329..14a29db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -36,14 +36,14 @@ __metadata: resolution: "@archwayhq/arch3-core@workspace:packages/arch3-core" dependencies: "@archwayhq/arch3-proto": "workspace:^" - "@cosmjs/amino": "npm:^0.32.2" - "@cosmjs/cosmwasm-stargate": "npm:^0.32.2" - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/proto-signing": "npm:^0.32.2" - "@cosmjs/stargate": "npm:^0.32.2" - "@cosmjs/tendermint-rpc": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/cosmwasm-stargate": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/proto-signing": "npm:^0.32.4" + "@cosmjs/stargate": "npm:^0.32.4" + "@cosmjs/tendermint-rpc": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" "@microsoft/eslint-formatter-sarif": "npm:^3.0.0" "@types/jest": "npm:^29.5.7" "@types/node": "npm:^20.8.10" @@ -75,10 +75,10 @@ __metadata: version: 0.0.0-use.local resolution: "@archwayhq/arch3-proto@workspace:packages/arch3-proto" dependencies: - "@cosmjs/amino": "npm:^0.32.2" - "@cosmjs/proto-signing": "npm:^0.32.2" - "@cosmjs/stargate": "npm:^0.32.2" - "@cosmjs/tendermint-rpc": "npm:^0.32.2" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/proto-signing": "npm:^0.32.4" + "@cosmjs/stargate": "npm:^0.32.4" + "@cosmjs/tendermint-rpc": "npm:^0.32.4" "@cosmology/telescope": "npm:^1.4.12" "@types/jest": "npm:^29.5.7" "@types/node": "npm:^20.8.10" @@ -1918,156 +1918,156 @@ __metadata: languageName: node linkType: hard -"@cosmjs/amino@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/amino@npm:0.32.2" +"@cosmjs/amino@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/amino@npm:0.32.4" dependencies: - "@cosmjs/crypto": "npm:^0.32.2" - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" - checksum: 5bc230f628d409c7e318df21f69fc1ae3f7d7e87204f2891388f4fc7468aa0090de2a7d02467a39a7f1ac112c6e4c4509c40230d380d00af9094b1b3de3899c5 + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" + checksum: 2644d268c10990ad3c6509f241c3b789064d1e38046ad80aed306c3cc17c70ffb7198f3fd19b515b5e22cea483062d0f5bf74bc1963a840534dfc495a3233827 languageName: node linkType: hard -"@cosmjs/cosmwasm-stargate@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/cosmwasm-stargate@npm:0.32.2" +"@cosmjs/cosmwasm-stargate@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/cosmwasm-stargate@npm:0.32.4" dependencies: - "@cosmjs/amino": "npm:^0.32.2" - "@cosmjs/crypto": "npm:^0.32.2" - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/proto-signing": "npm:^0.32.2" - "@cosmjs/stargate": "npm:^0.32.2" - "@cosmjs/tendermint-rpc": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/proto-signing": "npm:^0.32.4" + "@cosmjs/stargate": "npm:^0.32.4" + "@cosmjs/tendermint-rpc": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" cosmjs-types: "npm:^0.9.0" pako: "npm:^2.0.2" - checksum: f7ac842f217eb8bfbc51c5baaa6053a780aed6cc7a820bdcf60f90e31cc55dfa0276baf421de032b8f39667411ab9e659b489309e37ae9cb98f363af85391094 + checksum: d3c0f771409dc7079864e3357f9999cc85e2a2af825075910bb52d643024363ecbe19f516634fc9b8e3fac7a94e68eb96b32c362d000ff30369e7442778cc2d4 languageName: node linkType: hard -"@cosmjs/crypto@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/crypto@npm:0.32.2" +"@cosmjs/crypto@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/crypto@npm:0.32.4" dependencies: - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" "@noble/hashes": "npm:^1" bn.js: "npm:^5.2.0" elliptic: "npm:^6.5.4" libsodium-wrappers-sumo: "npm:^0.7.11" - checksum: 24c652c3c55e46950ddfabfdd6e08d6fee309febe86d8396d1dc372028c920c4d7d6c720fdd70128b2cbe804419bb667ecceaefb23cdcd1f9bce8d9b6b9deeef + checksum: 68b78aa5c91bdd81cefdd629d2574bdd2e41bcd27b38b18b86a38fa768b1096930313bcea5bb8479f32358ac4465d6e583f4cc253b942af428cf98cf4e84d4b1 languageName: node linkType: hard -"@cosmjs/encoding@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/encoding@npm:0.32.2" +"@cosmjs/encoding@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/encoding@npm:0.32.4" dependencies: base64-js: "npm:^1.3.0" bech32: "npm:^1.1.4" readonly-date: "npm:^1.0.0" - checksum: 9fd4d6f118aea84005aa2d892aa4872b20d5d64dd2dd111eb3bb6af0b243b135f8f7b3fd253ef8047a3d46063409dcabbb7dabc7987b6a13032627539f633b8a + checksum: 592f1ec81f9a4216fa047f65b6f8f5c00b3dc41f19f22e590d98954810f22b247137e7a8de62e7c93bcc7a557fd2c8d87cefee5b39a951a848790259b8e95db7 languageName: node linkType: hard -"@cosmjs/json-rpc@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/json-rpc@npm:0.32.2" +"@cosmjs/json-rpc@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/json-rpc@npm:0.32.4" dependencies: - "@cosmjs/stream": "npm:^0.32.2" + "@cosmjs/stream": "npm:^0.32.4" xstream: "npm:^11.14.0" - checksum: 4594de072331a141b4a1a374bd05c3fc5b2012825f2d0c70650ff370119350c15da195e28b6d9e0636fa2bc4740f6fe6a3355fa79ed545343b4386ccfe5d5c56 + checksum: a837c8954ed3f1457e8359233b3242915d822a2691b4ec7d194d9145bade39a7bf2f02c70c4785d106c0b27e2af40435f93da4a5b4462e31ce05fc341496e56f languageName: node linkType: hard -"@cosmjs/math@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/math@npm:0.32.2" +"@cosmjs/math@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/math@npm:0.32.4" dependencies: bn.js: "npm:^5.2.0" - checksum: f2b620ad62e84ecbbfc31c3635199e94c065dbf1eef5ad064dd371567463b2a90a9f1a97156823341fff2c8b414e04c74fa1901be17b7ab35a8cc31e2232f37d + checksum: 1b67f46cb8ace0dcd01bc4a63bc935d48624de5a342144944d1c45d7b49fa3f83f052dc70be20b39314611c6b31a6b6ad0ff1c7d655cf5f6a4dc28e22759588f languageName: node linkType: hard -"@cosmjs/proto-signing@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/proto-signing@npm:0.32.2" +"@cosmjs/proto-signing@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/proto-signing@npm:0.32.4" dependencies: - "@cosmjs/amino": "npm:^0.32.2" - "@cosmjs/crypto": "npm:^0.32.2" - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" cosmjs-types: "npm:^0.9.0" - checksum: 9f8e603c5590610675c37e25c3ef3ca381f91fb007d81c689be69e44013a46ae5fd0ce11a1c7a83a2f70c4ecb591c9ff03754ceeb20343a25e84a4bb3a1c5881 + checksum: 6369d26a2949236a525162358fdd78ffefc13710db279be764d22f79e103941f7681e86dd4a770b87c41b9bfb0fa162ccb629c70b6b7b8de49e7e7393f7353da languageName: node linkType: hard -"@cosmjs/socket@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/socket@npm:0.32.2" +"@cosmjs/socket@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/socket@npm:0.32.4" dependencies: - "@cosmjs/stream": "npm:^0.32.2" + "@cosmjs/stream": "npm:^0.32.4" isomorphic-ws: "npm:^4.0.1" ws: "npm:^7" xstream: "npm:^11.14.0" - checksum: ed1b510072f7e35b71ceb02219ff85df882a25c338269ebdd2af9236639f2ce018fd98ece990292ec1329cddd7028026f8aefe538d08b87d15fce22b4dd6fd49 + checksum: 37a4dfb6a03c4caa0227770933d933a5a7225ce9d1de3a78c66ff90299c7869779c17f039710938d6e9ffc819ee2f09c6413197ab6e95e7151635606b290c0cb languageName: node linkType: hard -"@cosmjs/stargate@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/stargate@npm:0.32.2" +"@cosmjs/stargate@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/stargate@npm:0.32.4" dependencies: "@confio/ics23": "npm:^0.6.8" - "@cosmjs/amino": "npm:^0.32.2" - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/proto-signing": "npm:^0.32.2" - "@cosmjs/stream": "npm:^0.32.2" - "@cosmjs/tendermint-rpc": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" + "@cosmjs/amino": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/proto-signing": "npm:^0.32.4" + "@cosmjs/stream": "npm:^0.32.4" + "@cosmjs/tendermint-rpc": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" cosmjs-types: "npm:^0.9.0" xstream: "npm:^11.14.0" - checksum: f846bb2f6e336d7c144b5532ceeda8715ed534c47fcb500c3fc025f32994dd8b4f2a77bda3e71dd7bd9b73d5cb3d75c4f969f4a28703c0bebd761442f67070a6 + checksum: fc65de1cbd8f381d804c4d8cd277eb089ec9239b3acbc008d83933dd8b61102481d5b69346e17e24f3296f08f27c06c34b7666462a704b75563b1e5974b7a258 languageName: node linkType: hard -"@cosmjs/stream@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/stream@npm:0.32.2" +"@cosmjs/stream@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/stream@npm:0.32.4" dependencies: xstream: "npm:^11.14.0" - checksum: c712d1c2b205e2211f0aa6fa28a482192e60153078a3d1176e8c1e3773e9987a973f50392d1ad58da64feb75ba504c8232158d7a23eb01dc3e565ae1be555eec + checksum: fa55d3f29e8a7c56d5da4128989709f0b02fcee5319efa2504f62e4f2b0c64725ccb603d88f435f6fbe308dc6ef76b1fd3ea5aecfcb877a871c111366ddd3489 languageName: node linkType: hard -"@cosmjs/tendermint-rpc@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/tendermint-rpc@npm:0.32.2" +"@cosmjs/tendermint-rpc@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/tendermint-rpc@npm:0.32.4" dependencies: - "@cosmjs/crypto": "npm:^0.32.2" - "@cosmjs/encoding": "npm:^0.32.2" - "@cosmjs/json-rpc": "npm:^0.32.2" - "@cosmjs/math": "npm:^0.32.2" - "@cosmjs/socket": "npm:^0.32.2" - "@cosmjs/stream": "npm:^0.32.2" - "@cosmjs/utils": "npm:^0.32.2" + "@cosmjs/crypto": "npm:^0.32.4" + "@cosmjs/encoding": "npm:^0.32.4" + "@cosmjs/json-rpc": "npm:^0.32.4" + "@cosmjs/math": "npm:^0.32.4" + "@cosmjs/socket": "npm:^0.32.4" + "@cosmjs/stream": "npm:^0.32.4" + "@cosmjs/utils": "npm:^0.32.4" axios: "npm:^1.6.0" readonly-date: "npm:^1.0.0" xstream: "npm:^11.14.0" - checksum: 1ab1d39875a4185d6874f13b67f2159051e8c4dce10561aba8f1d0d0133c62ce42d695874b93a75dad5abadbe20cc2a13791cb8a84fe7dde342d2dfe0f3b4813 + checksum: e82f4e340ad592bc9c957e6bd664d5ac18344baacdac9892fd05aa1e3701f947fbdbde9e0f57616b6c7e61cd1129cf29a3eb387f44169ff970a339793c22446c languageName: node linkType: hard -"@cosmjs/utils@npm:^0.32.2": - version: 0.32.2 - resolution: "@cosmjs/utils@npm:0.32.2" - checksum: 71d757eb6da243af9b4f7a64bfa1f64e3253d1a012518aa152b43115fb93b8af8ec60cda469dbc1e847a77cec0f126a64fa681b5b407ee396cbd96f30f4ae480 +"@cosmjs/utils@npm:^0.32.4": + version: 0.32.4 + resolution: "@cosmjs/utils@npm:0.32.4" + checksum: 92f4d0878bedda53d113894ebadd31a6d189fdd45f2f884049ee99c2d7f907703b6dc40c8bc9b88b912443c38f3dbf77a9474183f41b85dec1f9ef3bec9d86c4 languageName: node linkType: hard From 71ac2604a5747869666698b292145f8e8c31aad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20Elesb=C3=A3o?= Date: Thu, 12 Sep 2024 11:18:17 +0200 Subject: [PATCH 2/3] build(arch3-proto): update and generate files --- .../arch3-proto/generated/archway/bundle.ts | 124 +- .../generated/archway/callback/v1/callback.ts | 495 +++++++ .../generated/archway/callback/v1/errors.ts | 42 + .../generated/archway/callback/v1/events.ts | 640 ++++++++ .../generated/archway/callback/v1/genesis.ts | 120 ++ .../archway/callback/v1/query.rpc.Query.ts | 53 + .../generated/archway/callback/v1/query.ts | 554 +++++++ .../generated/archway/callback/v1/tx.amino.ts | 19 + .../archway/callback/v1/tx.registry.ts | 112 ++ .../archway/callback/v1/tx.rpc.msg.ts | 40 + .../generated/archway/callback/v1/tx.ts | 660 +++++++++ .../arch3-proto/generated/archway/client.ts | 14 +- .../generated/archway/cwerrors/v1/cwerrors.ts | 207 +++ .../generated/archway/cwerrors/v1/events.ts | 515 +++++++ .../generated/archway/cwerrors/v1/genesis.ts | 121 ++ .../generated/archway/cwerrors/v1/params.ts | 132 ++ .../archway/cwerrors/v1/query.rpc.Query.ts | 53 + .../generated/archway/cwerrors/v1/query.ts | 560 +++++++ .../generated/archway/cwerrors/v1/tx.amino.ts | 14 + .../archway/cwerrors/v1/tx.registry.ts | 82 ++ .../archway/cwerrors/v1/tx.rpc.msg.ts | 35 + .../generated/archway/cwerrors/v1/tx.ts | 446 ++++++ .../archway/cwfees/v1/cwfees.amino.ts | 14 + .../archway/cwfees/v1/cwfees.registry.ts | 82 ++ .../archway/cwfees/v1/cwfees.rpc.Query.ts | 30 + .../archway/cwfees/v1/cwfees.rpc.msg.ts | 28 + .../generated/archway/cwfees/v1/cwfees.ts | 603 ++++++++ .../generated/archway/cwica/v1/errors.ts | 42 + .../generated/archway/cwica/v1/genesis.ts | 96 ++ .../generated/archway/cwica/v1/params.ts | 95 ++ .../archway/cwica/v1/query.rpc.Query.ts | 31 + .../generated/archway/cwica/v1/query.ts | 165 +++ .../generated/archway/cwica/v1/sudo.ts | 435 ++++++ .../generated/archway/cwica/v1/tx.amino.ts | 19 + .../generated/archway/cwica/v1/tx.registry.ts | 112 ++ .../generated/archway/cwica/v1/tx.rpc.msg.ts | 37 + .../generated/archway/cwica/v1/tx.ts | 688 +++++++++ .../generated/archway/rewards/v1/events.ts | 25 +- .../generated/archway/rewards/v1/genesis.ts | 15 +- .../generated/archway/rewards/v1/query.ts | 61 +- .../generated/archway/rewards/v1/rewards.ts | 47 +- .../generated/archway/rewards/v1/tx.ts | 39 +- .../generated/archway/tracking/v1/genesis.ts | 11 +- .../generated/archway/tracking/v1/query.ts | 5 +- .../generated/archway/tracking/v1/tracking.ts | 33 +- packages/arch3-proto/generated/binary.ts | 4 +- .../cosmos/base/query/v1beta1/pagination.ts | 15 +- .../generated/cosmos/base/v1beta1/coin.ts | 48 +- .../arch3-proto/generated/cosmos/bundle.ts | 12 +- .../cosmos/upgrade/v1beta1/upgrade.ts | 616 ++++++++ .../arch3-proto/generated/gogoproto/bundle.ts | 4 +- .../arch3-proto/generated/google/api/http.ts | 33 +- .../arch3-proto/generated/google/bundle.ts | 12 +- .../generated/google/protobuf/any.ts | 3 +- .../generated/google/protobuf/descriptor.ts | 303 ++-- .../generated/google/protobuf/timestamp.ts | 3 +- packages/arch3-proto/generated/helpers.ts | 10 +- packages/arch3-proto/generated/ibc/bundle.ts | 17 + .../generated/ibc/core/channel/v1/channel.ts | 1300 +++++++++++++++++ .../generated/ibc/core/client/v1/client.ts | 955 ++++++++++++ packages/arch3-proto/generated/index.ts | 6 +- packages/arch3-proto/generated/json-safe.ts | 11 + packages/arch3-proto/generated/types.ts | 4 +- packages/arch3-proto/generated/utf8.ts | 4 +- packages/arch3-proto/generated/varint.ts | 4 +- packages/arch3-proto/package.json | 6 +- packages/arch3-proto/proto/amino/amino.proto | 7 +- .../proto/archway/callback/v1/callback.proto | 51 + .../proto/archway/callback/v1/errors.proto | 16 + .../proto/archway/callback/v1/events.proto | 63 + .../proto/archway/callback/v1/genesis.proto | 16 + .../proto/archway/callback/v1/query.proto | 60 + .../proto/archway/callback/v1/tx.proto | 76 + .../proto/archway/cwerrors/v1/cwerrors.proto | 29 + .../proto/archway/cwerrors/v1/events.proto | 51 + .../proto/archway/cwerrors/v1/genesis.proto | 16 + .../proto/archway/cwerrors/v1/params.proto | 18 + .../proto/archway/cwerrors/v1/query.proto | 65 + .../proto/archway/cwerrors/v1/tx.proto | 61 + .../proto/archway/cwfees/v1/cwfees.proto | 58 + .../proto/archway/cwica/v1/errors.proto | 16 + .../proto/archway/cwica/v1/genesis.proto | 13 + .../proto/archway/cwica/v1/params.proto | 13 + .../proto/archway/cwica/v1/query.proto | 26 + .../proto/archway/cwica/v1/sudo.proto | 40 + .../proto/archway/cwica/v1/tx.proto | 90 ++ .../proto/archway/rewards/v1/query.proto | 2 - .../proto/archway/rewards/v1/rewards.proto | 19 +- .../proto/archway/rewards/v1/tx.proto | 1 + .../proto/archway/tracking/v1/tracking.proto | 8 - .../proto/cosmos/base/v1beta1/coin.proto | 23 +- .../cosmos/upgrade/v1beta1/upgrade.proto | 94 ++ .../proto/ibc/core/channel/v1/channel.proto | 161 ++ .../proto/ibc/core/client/v1/client.proto | 104 ++ yarn.lock | 161 +- 95 files changed, 12023 insertions(+), 456 deletions(-) create mode 100644 packages/arch3-proto/generated/archway/callback/v1/callback.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/errors.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/events.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/genesis.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/query.rpc.Query.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/query.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/tx.amino.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/tx.registry.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/tx.rpc.msg.ts create mode 100644 packages/arch3-proto/generated/archway/callback/v1/tx.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/cwerrors.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/events.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/genesis.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/params.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/query.rpc.Query.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/query.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/tx.amino.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/tx.registry.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/tx.rpc.msg.ts create mode 100644 packages/arch3-proto/generated/archway/cwerrors/v1/tx.ts create mode 100644 packages/arch3-proto/generated/archway/cwfees/v1/cwfees.amino.ts create mode 100644 packages/arch3-proto/generated/archway/cwfees/v1/cwfees.registry.ts create mode 100644 packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.Query.ts create mode 100644 packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.msg.ts create mode 100644 packages/arch3-proto/generated/archway/cwfees/v1/cwfees.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/errors.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/genesis.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/params.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/query.rpc.Query.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/query.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/sudo.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/tx.amino.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/tx.registry.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/tx.rpc.msg.ts create mode 100644 packages/arch3-proto/generated/archway/cwica/v1/tx.ts create mode 100644 packages/arch3-proto/generated/cosmos/upgrade/v1beta1/upgrade.ts create mode 100644 packages/arch3-proto/generated/ibc/bundle.ts create mode 100644 packages/arch3-proto/generated/ibc/core/channel/v1/channel.ts create mode 100644 packages/arch3-proto/generated/ibc/core/client/v1/client.ts create mode 100644 packages/arch3-proto/generated/json-safe.ts create mode 100644 packages/arch3-proto/proto/archway/callback/v1/callback.proto create mode 100644 packages/arch3-proto/proto/archway/callback/v1/errors.proto create mode 100644 packages/arch3-proto/proto/archway/callback/v1/events.proto create mode 100644 packages/arch3-proto/proto/archway/callback/v1/genesis.proto create mode 100644 packages/arch3-proto/proto/archway/callback/v1/query.proto create mode 100644 packages/arch3-proto/proto/archway/callback/v1/tx.proto create mode 100644 packages/arch3-proto/proto/archway/cwerrors/v1/cwerrors.proto create mode 100644 packages/arch3-proto/proto/archway/cwerrors/v1/events.proto create mode 100644 packages/arch3-proto/proto/archway/cwerrors/v1/genesis.proto create mode 100644 packages/arch3-proto/proto/archway/cwerrors/v1/params.proto create mode 100644 packages/arch3-proto/proto/archway/cwerrors/v1/query.proto create mode 100644 packages/arch3-proto/proto/archway/cwerrors/v1/tx.proto create mode 100644 packages/arch3-proto/proto/archway/cwfees/v1/cwfees.proto create mode 100644 packages/arch3-proto/proto/archway/cwica/v1/errors.proto create mode 100644 packages/arch3-proto/proto/archway/cwica/v1/genesis.proto create mode 100644 packages/arch3-proto/proto/archway/cwica/v1/params.proto create mode 100644 packages/arch3-proto/proto/archway/cwica/v1/query.proto create mode 100644 packages/arch3-proto/proto/archway/cwica/v1/sudo.proto create mode 100644 packages/arch3-proto/proto/archway/cwica/v1/tx.proto create mode 100644 packages/arch3-proto/proto/cosmos/upgrade/v1beta1/upgrade.proto create mode 100644 packages/arch3-proto/proto/ibc/core/channel/v1/channel.proto create mode 100644 packages/arch3-proto/proto/ibc/core/client/v1/client.proto diff --git a/packages/arch3-proto/generated/archway/bundle.ts b/packages/arch3-proto/generated/archway/bundle.ts index 05080ad..eca8846 100644 --- a/packages/arch3-proto/generated/archway/bundle.ts +++ b/packages/arch3-proto/generated/archway/bundle.ts @@ -1,37 +1,123 @@ /* eslint-disable */ -import * as _1 from "./rewards/v1/events"; -import * as _2 from "./rewards/v1/genesis"; -import * as _3 from "./rewards/v1/query"; -import * as _4 from "./rewards/v1/rewards"; -import * as _5 from "./rewards/v1/tx"; -import * as _6 from "./tracking/v1/genesis"; -import * as _7 from "./tracking/v1/query"; -import * as _8 from "./tracking/v1/tracking"; -import * as _16 from "./rewards/v1/tx.amino"; -import * as _17 from "./rewards/v1/tx.registry"; -import * as _18 from "./rewards/v1/query.rpc.Query"; -import * as _19 from "./tracking/v1/query.rpc.Query"; -import * as _20 from "./rewards/v1/tx.rpc.msg"; +import * as _1 from "./callback/v1/callback"; +import * as _2 from "./callback/v1/errors"; +import * as _3 from "./callback/v1/events"; +import * as _4 from "./callback/v1/genesis"; +import * as _5 from "./callback/v1/query"; +import * as _6 from "./callback/v1/tx"; +import * as _7 from "./cwerrors/v1/cwerrors"; +import * as _8 from "./cwerrors/v1/events"; +import * as _9 from "./cwerrors/v1/genesis"; +import * as _10 from "./cwerrors/v1/params"; +import * as _11 from "./cwerrors/v1/query"; +import * as _12 from "./cwerrors/v1/tx"; +import * as _13 from "./cwfees/v1/cwfees"; +import * as _14 from "./cwica/v1/errors"; +import * as _15 from "./cwica/v1/genesis"; +import * as _16 from "./cwica/v1/params"; +import * as _17 from "./cwica/v1/query"; +import * as _18 from "./cwica/v1/sudo"; +import * as _19 from "./cwica/v1/tx"; +import * as _20 from "./rewards/v1/events"; +import * as _21 from "./rewards/v1/genesis"; +import * as _22 from "./rewards/v1/query"; +import * as _23 from "./rewards/v1/rewards"; +import * as _24 from "./rewards/v1/tx"; +import * as _25 from "./tracking/v1/genesis"; +import * as _26 from "./tracking/v1/query"; +import * as _27 from "./tracking/v1/tracking"; +import * as _37 from "./callback/v1/tx.amino"; +import * as _38 from "./cwerrors/v1/tx.amino"; +import * as _39 from "./cwfees/v1/cwfees.amino"; +import * as _40 from "./cwica/v1/tx.amino"; +import * as _41 from "./rewards/v1/tx.amino"; +import * as _42 from "./callback/v1/tx.registry"; +import * as _43 from "./cwerrors/v1/tx.registry"; +import * as _44 from "./cwfees/v1/cwfees.registry"; +import * as _45 from "./cwica/v1/tx.registry"; +import * as _46 from "./rewards/v1/tx.registry"; +import * as _47 from "./callback/v1/query.rpc.Query"; +import * as _48 from "./cwerrors/v1/query.rpc.Query"; +import * as _49 from "./cwfees/v1/cwfees.rpc.Query"; +import * as _50 from "./cwica/v1/query.rpc.Query"; +import * as _51 from "./rewards/v1/query.rpc.Query"; +import * as _52 from "./tracking/v1/query.rpc.Query"; +import * as _53 from "./callback/v1/tx.rpc.msg"; +import * as _54 from "./cwerrors/v1/tx.rpc.msg"; +import * as _55 from "./cwfees/v1/cwfees.rpc.msg"; +import * as _56 from "./cwica/v1/tx.rpc.msg"; +import * as _57 from "./rewards/v1/tx.rpc.msg"; export namespace archway { - export namespace rewards { + export namespace callback { export const v1 = { ..._1, ..._2, ..._3, ..._4, ..._5, + ..._6, + ..._37, + ..._42, + ..._47, + ..._53 + }; + } + export namespace cwerrors { + export const v1 = { + ..._7, + ..._8, + ..._9, + ..._10, + ..._11, + ..._12, + ..._38, + ..._43, + ..._48, + ..._54 + }; + } + export namespace cwfees { + export const v1 = { + ..._13, + ..._39, + ..._44, + ..._49, + ..._55 + }; + } + export namespace cwica { + export const v1 = { + ..._14, + ..._15, ..._16, ..._17, ..._18, - ..._20 + ..._19, + ..._40, + ..._45, + ..._50, + ..._56 + }; + } + export namespace rewards { + export const v1 = { + ..._20, + ..._21, + ..._22, + ..._23, + ..._24, + ..._41, + ..._46, + ..._51, + ..._57 }; } export namespace tracking { export const v1 = { - ..._6, - ..._7, - ..._8, - ..._19 + ..._25, + ..._26, + ..._27, + ..._52 }; } } \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/callback.ts b/packages/arch3-proto/generated/archway/callback/v1/callback.ts new file mode 100644 index 0000000..ba2241e --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/callback.ts @@ -0,0 +1,495 @@ +/* eslint-disable */ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +import { Decimal } from "@cosmjs/math"; +/** Callback defines the callback structure. */ +export interface Callback { + /** contract_address is the address of the contract which is requesting the callback (bech32 encoded). */ + contractAddress: string; + /** job_id is an identifier the callback requestor can pass in to identify the callback when it happens. */ + jobId: bigint; + /** callback_height is the height at which the callback is executed. */ + callbackHeight: bigint; + /** fee_split is the breakdown of the fees paid by the contract to reserve the callback */ + feeSplit?: CallbackFeesFeeSplit; + /** reserved_by is the address which reserved the callback (bech32 encoded). */ + reservedBy: string; + /** callback_gas_limit is the maximum gas that can be consumed by this callback. */ + maxGasLimit: bigint; +} +export interface CallbackProtoMsg { + typeUrl: "/archway.callback.v1.Callback"; + value: Uint8Array; +} +/** Callback defines the callback structure. */ +export interface CallbackAmino { + /** contract_address is the address of the contract which is requesting the callback (bech32 encoded). */ + contract_address?: string; + /** job_id is an identifier the callback requestor can pass in to identify the callback when it happens. */ + job_id?: string; + /** callback_height is the height at which the callback is executed. */ + callback_height?: string; + /** fee_split is the breakdown of the fees paid by the contract to reserve the callback */ + fee_split?: CallbackFeesFeeSplitAmino; + /** reserved_by is the address which reserved the callback (bech32 encoded). */ + reserved_by?: string; + /** callback_gas_limit is the maximum gas that can be consumed by this callback. */ + max_gas_limit?: string; +} +export interface CallbackAminoMsg { + type: "/archway.callback.v1.Callback"; + value: CallbackAmino; +} +/** CallbackFeesFeeSplit is the breakdown of all the fees that need to be paid by the contract to reserve a callback */ +export interface CallbackFeesFeeSplit { + /** transaction_fees is the transaction fees for the callback based on its gas consumption */ + transactionFees?: Coin; + /** block_reservation_fees is the block reservation fees portion of the callback reservation fees */ + blockReservationFees?: Coin; + /** future_reservation_fees is the future reservation fees portion of the callback reservation fees */ + futureReservationFees?: Coin; + /** surplus_fees is any extra fees passed in for the registration of the callback */ + surplusFees?: Coin; +} +export interface CallbackFeesFeeSplitProtoMsg { + typeUrl: "/archway.callback.v1.CallbackFeesFeeSplit"; + value: Uint8Array; +} +/** CallbackFeesFeeSplit is the breakdown of all the fees that need to be paid by the contract to reserve a callback */ +export interface CallbackFeesFeeSplitAmino { + /** transaction_fees is the transaction fees for the callback based on its gas consumption */ + transaction_fees?: CoinAmino; + /** block_reservation_fees is the block reservation fees portion of the callback reservation fees */ + block_reservation_fees?: CoinAmino; + /** future_reservation_fees is the future reservation fees portion of the callback reservation fees */ + future_reservation_fees?: CoinAmino; + /** surplus_fees is any extra fees passed in for the registration of the callback */ + surplus_fees?: CoinAmino; +} +export interface CallbackFeesFeeSplitAminoMsg { + type: "/archway.callback.v1.CallbackFeesFeeSplit"; + value: CallbackFeesFeeSplitAmino; +} +/** Params defines the module parameters. */ +export interface Params { + /** callback_gas_limit is the maximum gas that can be consumed by a callback. */ + callbackGasLimit: bigint; + /** max_block_reservation_limit is the maximum number of callbacks which can be registered in a given block. */ + maxBlockReservationLimit: bigint; + /** max_future_reservation_limit is the maximum number of blocks in the future that a contract can request a callback in. */ + maxFutureReservationLimit: bigint; + /** block_reservation_fee_multiplier is used to calculate a part of the reservation fees which will need to be paid when requesting the callback. */ + blockReservationFeeMultiplier: string; + /** future_reservation_fee_multiplier is used to calculate a part of the reservation fees which will need to be paid while requesting the callback. */ + futureReservationFeeMultiplier: string; +} +export interface ParamsProtoMsg { + typeUrl: "/archway.callback.v1.Params"; + value: Uint8Array; +} +/** Params defines the module parameters. */ +export interface ParamsAmino { + /** callback_gas_limit is the maximum gas that can be consumed by a callback. */ + callback_gas_limit?: string; + /** max_block_reservation_limit is the maximum number of callbacks which can be registered in a given block. */ + max_block_reservation_limit?: string; + /** max_future_reservation_limit is the maximum number of blocks in the future that a contract can request a callback in. */ + max_future_reservation_limit?: string; + /** block_reservation_fee_multiplier is used to calculate a part of the reservation fees which will need to be paid when requesting the callback. */ + block_reservation_fee_multiplier?: string; + /** future_reservation_fee_multiplier is used to calculate a part of the reservation fees which will need to be paid while requesting the callback. */ + future_reservation_fee_multiplier?: string; +} +export interface ParamsAminoMsg { + type: "/archway.callback.v1.Params"; + value: ParamsAmino; +} +function createBaseCallback(): Callback { + return { + contractAddress: "", + jobId: BigInt(0), + callbackHeight: BigInt(0), + feeSplit: undefined, + reservedBy: "", + maxGasLimit: BigInt(0) + }; +} +export const Callback = { + typeUrl: "/archway.callback.v1.Callback", + encode(message: Callback, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(16).uint64(message.jobId); + } + if (message.callbackHeight !== BigInt(0)) { + writer.uint32(24).int64(message.callbackHeight); + } + if (message.feeSplit !== undefined) { + CallbackFeesFeeSplit.encode(message.feeSplit, writer.uint32(34).fork()).ldelim(); + } + if (message.reservedBy !== "") { + writer.uint32(42).string(message.reservedBy); + } + if (message.maxGasLimit !== BigInt(0)) { + writer.uint32(48).uint64(message.maxGasLimit); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Callback { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCallback(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.jobId = reader.uint64(); + break; + case 3: + message.callbackHeight = reader.int64(); + break; + case 4: + message.feeSplit = CallbackFeesFeeSplit.decode(reader, reader.uint32()); + break; + case 5: + message.reservedBy = reader.string(); + break; + case 6: + message.maxGasLimit = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Callback { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + callbackHeight: isSet(object.callbackHeight) ? BigInt(object.callbackHeight.toString()) : BigInt(0), + feeSplit: isSet(object.feeSplit) ? CallbackFeesFeeSplit.fromJSON(object.feeSplit) : undefined, + reservedBy: isSet(object.reservedBy) ? String(object.reservedBy) : "", + maxGasLimit: isSet(object.maxGasLimit) ? BigInt(object.maxGasLimit.toString()) : BigInt(0) + }; + }, + toJSON(message: Callback): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.callbackHeight !== undefined && (obj.callbackHeight = (message.callbackHeight || BigInt(0)).toString()); + message.feeSplit !== undefined && (obj.feeSplit = message.feeSplit ? CallbackFeesFeeSplit.toJSON(message.feeSplit) : undefined); + message.reservedBy !== undefined && (obj.reservedBy = message.reservedBy); + message.maxGasLimit !== undefined && (obj.maxGasLimit = (message.maxGasLimit || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Callback { + const message = createBaseCallback(); + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.callbackHeight = object.callbackHeight !== undefined && object.callbackHeight !== null ? BigInt(object.callbackHeight.toString()) : BigInt(0); + message.feeSplit = object.feeSplit !== undefined && object.feeSplit !== null ? CallbackFeesFeeSplit.fromPartial(object.feeSplit) : undefined; + message.reservedBy = object.reservedBy ?? ""; + message.maxGasLimit = object.maxGasLimit !== undefined && object.maxGasLimit !== null ? BigInt(object.maxGasLimit.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CallbackAmino): Callback { + const message = createBaseCallback(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.callback_height !== undefined && object.callback_height !== null) { + message.callbackHeight = BigInt(object.callback_height); + } + if (object.fee_split !== undefined && object.fee_split !== null) { + message.feeSplit = CallbackFeesFeeSplit.fromAmino(object.fee_split); + } + if (object.reserved_by !== undefined && object.reserved_by !== null) { + message.reservedBy = object.reserved_by; + } + if (object.max_gas_limit !== undefined && object.max_gas_limit !== null) { + message.maxGasLimit = BigInt(object.max_gas_limit); + } + return message; + }, + toAmino(message: Callback): CallbackAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.callback_height = message.callbackHeight !== BigInt(0) ? message.callbackHeight.toString() : undefined; + obj.fee_split = message.feeSplit ? CallbackFeesFeeSplit.toAmino(message.feeSplit) : undefined; + obj.reserved_by = message.reservedBy === "" ? undefined : message.reservedBy; + obj.max_gas_limit = message.maxGasLimit !== BigInt(0) ? message.maxGasLimit.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CallbackAminoMsg): Callback { + return Callback.fromAmino(object.value); + }, + fromProtoMsg(message: CallbackProtoMsg): Callback { + return Callback.decode(message.value); + }, + toProto(message: Callback): Uint8Array { + return Callback.encode(message).finish(); + }, + toProtoMsg(message: Callback): CallbackProtoMsg { + return { + typeUrl: "/archway.callback.v1.Callback", + value: Callback.encode(message).finish() + }; + } +}; +function createBaseCallbackFeesFeeSplit(): CallbackFeesFeeSplit { + return { + transactionFees: undefined, + blockReservationFees: undefined, + futureReservationFees: undefined, + surplusFees: undefined + }; +} +export const CallbackFeesFeeSplit = { + typeUrl: "/archway.callback.v1.CallbackFeesFeeSplit", + encode(message: CallbackFeesFeeSplit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.transactionFees !== undefined) { + Coin.encode(message.transactionFees, writer.uint32(10).fork()).ldelim(); + } + if (message.blockReservationFees !== undefined) { + Coin.encode(message.blockReservationFees, writer.uint32(18).fork()).ldelim(); + } + if (message.futureReservationFees !== undefined) { + Coin.encode(message.futureReservationFees, writer.uint32(26).fork()).ldelim(); + } + if (message.surplusFees !== undefined) { + Coin.encode(message.surplusFees, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CallbackFeesFeeSplit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCallbackFeesFeeSplit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transactionFees = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.blockReservationFees = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.futureReservationFees = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.surplusFees = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CallbackFeesFeeSplit { + return { + transactionFees: isSet(object.transactionFees) ? Coin.fromJSON(object.transactionFees) : undefined, + blockReservationFees: isSet(object.blockReservationFees) ? Coin.fromJSON(object.blockReservationFees) : undefined, + futureReservationFees: isSet(object.futureReservationFees) ? Coin.fromJSON(object.futureReservationFees) : undefined, + surplusFees: isSet(object.surplusFees) ? Coin.fromJSON(object.surplusFees) : undefined + }; + }, + toJSON(message: CallbackFeesFeeSplit): JsonSafe { + const obj: any = {}; + message.transactionFees !== undefined && (obj.transactionFees = message.transactionFees ? Coin.toJSON(message.transactionFees) : undefined); + message.blockReservationFees !== undefined && (obj.blockReservationFees = message.blockReservationFees ? Coin.toJSON(message.blockReservationFees) : undefined); + message.futureReservationFees !== undefined && (obj.futureReservationFees = message.futureReservationFees ? Coin.toJSON(message.futureReservationFees) : undefined); + message.surplusFees !== undefined && (obj.surplusFees = message.surplusFees ? Coin.toJSON(message.surplusFees) : undefined); + return obj; + }, + fromPartial(object: Partial): CallbackFeesFeeSplit { + const message = createBaseCallbackFeesFeeSplit(); + message.transactionFees = object.transactionFees !== undefined && object.transactionFees !== null ? Coin.fromPartial(object.transactionFees) : undefined; + message.blockReservationFees = object.blockReservationFees !== undefined && object.blockReservationFees !== null ? Coin.fromPartial(object.blockReservationFees) : undefined; + message.futureReservationFees = object.futureReservationFees !== undefined && object.futureReservationFees !== null ? Coin.fromPartial(object.futureReservationFees) : undefined; + message.surplusFees = object.surplusFees !== undefined && object.surplusFees !== null ? Coin.fromPartial(object.surplusFees) : undefined; + return message; + }, + fromAmino(object: CallbackFeesFeeSplitAmino): CallbackFeesFeeSplit { + const message = createBaseCallbackFeesFeeSplit(); + if (object.transaction_fees !== undefined && object.transaction_fees !== null) { + message.transactionFees = Coin.fromAmino(object.transaction_fees); + } + if (object.block_reservation_fees !== undefined && object.block_reservation_fees !== null) { + message.blockReservationFees = Coin.fromAmino(object.block_reservation_fees); + } + if (object.future_reservation_fees !== undefined && object.future_reservation_fees !== null) { + message.futureReservationFees = Coin.fromAmino(object.future_reservation_fees); + } + if (object.surplus_fees !== undefined && object.surplus_fees !== null) { + message.surplusFees = Coin.fromAmino(object.surplus_fees); + } + return message; + }, + toAmino(message: CallbackFeesFeeSplit): CallbackFeesFeeSplitAmino { + const obj: any = {}; + obj.transaction_fees = message.transactionFees ? Coin.toAmino(message.transactionFees) : undefined; + obj.block_reservation_fees = message.blockReservationFees ? Coin.toAmino(message.blockReservationFees) : undefined; + obj.future_reservation_fees = message.futureReservationFees ? Coin.toAmino(message.futureReservationFees) : undefined; + obj.surplus_fees = message.surplusFees ? Coin.toAmino(message.surplusFees) : undefined; + return obj; + }, + fromAminoMsg(object: CallbackFeesFeeSplitAminoMsg): CallbackFeesFeeSplit { + return CallbackFeesFeeSplit.fromAmino(object.value); + }, + fromProtoMsg(message: CallbackFeesFeeSplitProtoMsg): CallbackFeesFeeSplit { + return CallbackFeesFeeSplit.decode(message.value); + }, + toProto(message: CallbackFeesFeeSplit): Uint8Array { + return CallbackFeesFeeSplit.encode(message).finish(); + }, + toProtoMsg(message: CallbackFeesFeeSplit): CallbackFeesFeeSplitProtoMsg { + return { + typeUrl: "/archway.callback.v1.CallbackFeesFeeSplit", + value: CallbackFeesFeeSplit.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + callbackGasLimit: BigInt(0), + maxBlockReservationLimit: BigInt(0), + maxFutureReservationLimit: BigInt(0), + blockReservationFeeMultiplier: "", + futureReservationFeeMultiplier: "" + }; +} +export const Params = { + typeUrl: "/archway.callback.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.callbackGasLimit !== BigInt(0)) { + writer.uint32(8).uint64(message.callbackGasLimit); + } + if (message.maxBlockReservationLimit !== BigInt(0)) { + writer.uint32(16).uint64(message.maxBlockReservationLimit); + } + if (message.maxFutureReservationLimit !== BigInt(0)) { + writer.uint32(24).uint64(message.maxFutureReservationLimit); + } + if (message.blockReservationFeeMultiplier !== "") { + writer.uint32(34).string(Decimal.fromUserInput(message.blockReservationFeeMultiplier, 18).atomics); + } + if (message.futureReservationFeeMultiplier !== "") { + writer.uint32(42).string(Decimal.fromUserInput(message.futureReservationFeeMultiplier, 18).atomics); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.callbackGasLimit = reader.uint64(); + break; + case 2: + message.maxBlockReservationLimit = reader.uint64(); + break; + case 3: + message.maxFutureReservationLimit = reader.uint64(); + break; + case 4: + message.blockReservationFeeMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + case 5: + message.futureReservationFeeMultiplier = Decimal.fromAtomics(reader.string(), 18).toString(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + callbackGasLimit: isSet(object.callbackGasLimit) ? BigInt(object.callbackGasLimit.toString()) : BigInt(0), + maxBlockReservationLimit: isSet(object.maxBlockReservationLimit) ? BigInt(object.maxBlockReservationLimit.toString()) : BigInt(0), + maxFutureReservationLimit: isSet(object.maxFutureReservationLimit) ? BigInt(object.maxFutureReservationLimit.toString()) : BigInt(0), + blockReservationFeeMultiplier: isSet(object.blockReservationFeeMultiplier) ? String(object.blockReservationFeeMultiplier) : "", + futureReservationFeeMultiplier: isSet(object.futureReservationFeeMultiplier) ? String(object.futureReservationFeeMultiplier) : "" + }; + }, + toJSON(message: Params): JsonSafe { + const obj: any = {}; + message.callbackGasLimit !== undefined && (obj.callbackGasLimit = (message.callbackGasLimit || BigInt(0)).toString()); + message.maxBlockReservationLimit !== undefined && (obj.maxBlockReservationLimit = (message.maxBlockReservationLimit || BigInt(0)).toString()); + message.maxFutureReservationLimit !== undefined && (obj.maxFutureReservationLimit = (message.maxFutureReservationLimit || BigInt(0)).toString()); + message.blockReservationFeeMultiplier !== undefined && (obj.blockReservationFeeMultiplier = message.blockReservationFeeMultiplier); + message.futureReservationFeeMultiplier !== undefined && (obj.futureReservationFeeMultiplier = message.futureReservationFeeMultiplier); + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.callbackGasLimit = object.callbackGasLimit !== undefined && object.callbackGasLimit !== null ? BigInt(object.callbackGasLimit.toString()) : BigInt(0); + message.maxBlockReservationLimit = object.maxBlockReservationLimit !== undefined && object.maxBlockReservationLimit !== null ? BigInt(object.maxBlockReservationLimit.toString()) : BigInt(0); + message.maxFutureReservationLimit = object.maxFutureReservationLimit !== undefined && object.maxFutureReservationLimit !== null ? BigInt(object.maxFutureReservationLimit.toString()) : BigInt(0); + message.blockReservationFeeMultiplier = object.blockReservationFeeMultiplier ?? ""; + message.futureReservationFeeMultiplier = object.futureReservationFeeMultiplier ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.callback_gas_limit !== undefined && object.callback_gas_limit !== null) { + message.callbackGasLimit = BigInt(object.callback_gas_limit); + } + if (object.max_block_reservation_limit !== undefined && object.max_block_reservation_limit !== null) { + message.maxBlockReservationLimit = BigInt(object.max_block_reservation_limit); + } + if (object.max_future_reservation_limit !== undefined && object.max_future_reservation_limit !== null) { + message.maxFutureReservationLimit = BigInt(object.max_future_reservation_limit); + } + if (object.block_reservation_fee_multiplier !== undefined && object.block_reservation_fee_multiplier !== null) { + message.blockReservationFeeMultiplier = object.block_reservation_fee_multiplier; + } + if (object.future_reservation_fee_multiplier !== undefined && object.future_reservation_fee_multiplier !== null) { + message.futureReservationFeeMultiplier = object.future_reservation_fee_multiplier; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.callback_gas_limit = message.callbackGasLimit !== BigInt(0) ? message.callbackGasLimit.toString() : undefined; + obj.max_block_reservation_limit = message.maxBlockReservationLimit !== BigInt(0) ? message.maxBlockReservationLimit.toString() : undefined; + obj.max_future_reservation_limit = message.maxFutureReservationLimit !== BigInt(0) ? message.maxFutureReservationLimit.toString() : undefined; + obj.block_reservation_fee_multiplier = message.blockReservationFeeMultiplier === "" ? undefined : message.blockReservationFeeMultiplier; + obj.future_reservation_fee_multiplier = message.futureReservationFeeMultiplier === "" ? undefined : message.futureReservationFeeMultiplier; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/archway.callback.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/errors.ts b/packages/arch3-proto/generated/archway/callback/v1/errors.ts new file mode 100644 index 0000000..b01896b --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/errors.ts @@ -0,0 +1,42 @@ +/* eslint-disable */ +/** ModuleErrors defines the module level error codes */ +export enum ModuleErrors { + /** ERR_UNKNOWN - ERR_UNKNOWN is the default error code */ + ERR_UNKNOWN = 0, + /** ERR_OUT_OF_GAS - ERR_OUT_OF_GAS is the error code when the contract callback exceeds the gas limit allowed by the module */ + ERR_OUT_OF_GAS = 1, + /** ERR_CONTRACT_EXECUTION_FAILED - ERR_CONTRACT_EXECUTION_FAILED is the error code when the contract callback execution fails */ + ERR_CONTRACT_EXECUTION_FAILED = 2, + UNRECOGNIZED = -1, +} +export const ModuleErrorsAmino = ModuleErrors; +export function moduleErrorsFromJSON(object: any): ModuleErrors { + switch (object) { + case 0: + case "ERR_UNKNOWN": + return ModuleErrors.ERR_UNKNOWN; + case 1: + case "ERR_OUT_OF_GAS": + return ModuleErrors.ERR_OUT_OF_GAS; + case 2: + case "ERR_CONTRACT_EXECUTION_FAILED": + return ModuleErrors.ERR_CONTRACT_EXECUTION_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ModuleErrors.UNRECOGNIZED; + } +} +export function moduleErrorsToJSON(object: ModuleErrors): string { + switch (object) { + case ModuleErrors.ERR_UNKNOWN: + return "ERR_UNKNOWN"; + case ModuleErrors.ERR_OUT_OF_GAS: + return "ERR_OUT_OF_GAS"; + case ModuleErrors.ERR_CONTRACT_EXECUTION_FAILED: + return "ERR_CONTRACT_EXECUTION_FAILED"; + case ModuleErrors.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/events.ts b/packages/arch3-proto/generated/archway/callback/v1/events.ts new file mode 100644 index 0000000..cf3815f --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/events.ts @@ -0,0 +1,640 @@ +/* eslint-disable */ +import { CallbackFeesFeeSplit, CallbackFeesFeeSplitAmino } from "./callback"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** CallbackRegisteredEvent is emitted when a callback is registered. */ +export interface CallbackRegisteredEvent { + /** contract_address is the address of the contract for which callback is being registered (bech32 encoded). */ + contractAddress: string; + /** job_id is an identifier of the callback. */ + jobId: bigint; + /** callback_height is the height at which the callback is executed. */ + callbackHeight: bigint; + /** fee_split is the breakdown of the fees paid by the contract to reserve the callback */ + feeSplit?: CallbackFeesFeeSplit; + /** reserved_by is the address which reserved the callback (bech32 encoded). */ + reservedBy: string; +} +export interface CallbackRegisteredEventProtoMsg { + typeUrl: "/archway.callback.v1.CallbackRegisteredEvent"; + value: Uint8Array; +} +/** CallbackRegisteredEvent is emitted when a callback is registered. */ +export interface CallbackRegisteredEventAmino { + /** contract_address is the address of the contract for which callback is being registered (bech32 encoded). */ + contract_address?: string; + /** job_id is an identifier of the callback. */ + job_id?: string; + /** callback_height is the height at which the callback is executed. */ + callback_height?: string; + /** fee_split is the breakdown of the fees paid by the contract to reserve the callback */ + fee_split?: CallbackFeesFeeSplitAmino; + /** reserved_by is the address which reserved the callback (bech32 encoded). */ + reserved_by?: string; +} +export interface CallbackRegisteredEventAminoMsg { + type: "/archway.callback.v1.CallbackRegisteredEvent"; + value: CallbackRegisteredEventAmino; +} +/** CallbackCancelledEvent is emitted when a callback is cancelled. */ +export interface CallbackCancelledEvent { + /** cancelled_by is the address of the contract whose callback is being cancelled (bech32 encoded) */ + cancelledBy: string; + /** contract_address is the address of the contract (bech32 encoded) */ + contractAddress: string; + /** job_id is an identifier the callback requestor had passed during registration of the callback */ + jobId: bigint; + /** callback_height is the height at which the callback requestor had registered the callback */ + callbackHeight: bigint; + /** refund_amount is the amount of fees which was refunded on cancellation */ + refundAmount: Coin; +} +export interface CallbackCancelledEventProtoMsg { + typeUrl: "/archway.callback.v1.CallbackCancelledEvent"; + value: Uint8Array; +} +/** CallbackCancelledEvent is emitted when a callback is cancelled. */ +export interface CallbackCancelledEventAmino { + /** cancelled_by is the address of the contract whose callback is being cancelled (bech32 encoded) */ + cancelled_by?: string; + /** contract_address is the address of the contract (bech32 encoded) */ + contract_address?: string; + /** job_id is an identifier the callback requestor had passed during registration of the callback */ + job_id?: string; + /** callback_height is the height at which the callback requestor had registered the callback */ + callback_height?: string; + /** refund_amount is the amount of fees which was refunded on cancellation */ + refund_amount?: CoinAmino; +} +export interface CallbackCancelledEventAminoMsg { + type: "/archway.callback.v1.CallbackCancelledEvent"; + value: CallbackCancelledEventAmino; +} +/** CallbackExecutedSuccessEvent is emitted when a callback is executed successfully. */ +export interface CallbackExecutedSuccessEvent { + /** contract_address is the address of the contract for which callback is being executed (bech32 encoded). */ + contractAddress: string; + /** job_id is an identifier of the callback. */ + jobId: bigint; + /** sudo_msg is the input passed by the module to the contract */ + sudoMsg: string; + /** gas_used is the amount of gas consumed during the callback execution */ + gasUsed: bigint; +} +export interface CallbackExecutedSuccessEventProtoMsg { + typeUrl: "/archway.callback.v1.CallbackExecutedSuccessEvent"; + value: Uint8Array; +} +/** CallbackExecutedSuccessEvent is emitted when a callback is executed successfully. */ +export interface CallbackExecutedSuccessEventAmino { + /** contract_address is the address of the contract for which callback is being executed (bech32 encoded). */ + contract_address?: string; + /** job_id is an identifier of the callback. */ + job_id?: string; + /** sudo_msg is the input passed by the module to the contract */ + sudo_msg?: string; + /** gas_used is the amount of gas consumed during the callback execution */ + gas_used?: string; +} +export interface CallbackExecutedSuccessEventAminoMsg { + type: "/archway.callback.v1.CallbackExecutedSuccessEvent"; + value: CallbackExecutedSuccessEventAmino; +} +/** CallbackExecutedFailedEvent is emitted when a callback execution fails. */ +export interface CallbackExecutedFailedEvent { + /** contract_address is the address of the contract for which callback is being executed (bech32 encoded). */ + contractAddress: string; + /** job_id is an identifier of the callback. */ + jobId: bigint; + /** sudo_msg is the input passed by the module to the contract */ + sudoMsg: string; + /** gas_used is the amount of gas consumed during the callback execution */ + gasUsed: bigint; + /** error is the error returned during the callback execution */ + error: string; +} +export interface CallbackExecutedFailedEventProtoMsg { + typeUrl: "/archway.callback.v1.CallbackExecutedFailedEvent"; + value: Uint8Array; +} +/** CallbackExecutedFailedEvent is emitted when a callback execution fails. */ +export interface CallbackExecutedFailedEventAmino { + /** contract_address is the address of the contract for which callback is being executed (bech32 encoded). */ + contract_address?: string; + /** job_id is an identifier of the callback. */ + job_id?: string; + /** sudo_msg is the input passed by the module to the contract */ + sudo_msg?: string; + /** gas_used is the amount of gas consumed during the callback execution */ + gas_used?: string; + /** error is the error returned during the callback execution */ + error?: string; +} +export interface CallbackExecutedFailedEventAminoMsg { + type: "/archway.callback.v1.CallbackExecutedFailedEvent"; + value: CallbackExecutedFailedEventAmino; +} +function createBaseCallbackRegisteredEvent(): CallbackRegisteredEvent { + return { + contractAddress: "", + jobId: BigInt(0), + callbackHeight: BigInt(0), + feeSplit: undefined, + reservedBy: "" + }; +} +export const CallbackRegisteredEvent = { + typeUrl: "/archway.callback.v1.CallbackRegisteredEvent", + encode(message: CallbackRegisteredEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(16).uint64(message.jobId); + } + if (message.callbackHeight !== BigInt(0)) { + writer.uint32(24).int64(message.callbackHeight); + } + if (message.feeSplit !== undefined) { + CallbackFeesFeeSplit.encode(message.feeSplit, writer.uint32(34).fork()).ldelim(); + } + if (message.reservedBy !== "") { + writer.uint32(42).string(message.reservedBy); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CallbackRegisteredEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCallbackRegisteredEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.jobId = reader.uint64(); + break; + case 3: + message.callbackHeight = reader.int64(); + break; + case 4: + message.feeSplit = CallbackFeesFeeSplit.decode(reader, reader.uint32()); + break; + case 5: + message.reservedBy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CallbackRegisteredEvent { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + callbackHeight: isSet(object.callbackHeight) ? BigInt(object.callbackHeight.toString()) : BigInt(0), + feeSplit: isSet(object.feeSplit) ? CallbackFeesFeeSplit.fromJSON(object.feeSplit) : undefined, + reservedBy: isSet(object.reservedBy) ? String(object.reservedBy) : "" + }; + }, + toJSON(message: CallbackRegisteredEvent): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.callbackHeight !== undefined && (obj.callbackHeight = (message.callbackHeight || BigInt(0)).toString()); + message.feeSplit !== undefined && (obj.feeSplit = message.feeSplit ? CallbackFeesFeeSplit.toJSON(message.feeSplit) : undefined); + message.reservedBy !== undefined && (obj.reservedBy = message.reservedBy); + return obj; + }, + fromPartial(object: Partial): CallbackRegisteredEvent { + const message = createBaseCallbackRegisteredEvent(); + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.callbackHeight = object.callbackHeight !== undefined && object.callbackHeight !== null ? BigInt(object.callbackHeight.toString()) : BigInt(0); + message.feeSplit = object.feeSplit !== undefined && object.feeSplit !== null ? CallbackFeesFeeSplit.fromPartial(object.feeSplit) : undefined; + message.reservedBy = object.reservedBy ?? ""; + return message; + }, + fromAmino(object: CallbackRegisteredEventAmino): CallbackRegisteredEvent { + const message = createBaseCallbackRegisteredEvent(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.callback_height !== undefined && object.callback_height !== null) { + message.callbackHeight = BigInt(object.callback_height); + } + if (object.fee_split !== undefined && object.fee_split !== null) { + message.feeSplit = CallbackFeesFeeSplit.fromAmino(object.fee_split); + } + if (object.reserved_by !== undefined && object.reserved_by !== null) { + message.reservedBy = object.reserved_by; + } + return message; + }, + toAmino(message: CallbackRegisteredEvent): CallbackRegisteredEventAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.callback_height = message.callbackHeight !== BigInt(0) ? message.callbackHeight.toString() : undefined; + obj.fee_split = message.feeSplit ? CallbackFeesFeeSplit.toAmino(message.feeSplit) : undefined; + obj.reserved_by = message.reservedBy === "" ? undefined : message.reservedBy; + return obj; + }, + fromAminoMsg(object: CallbackRegisteredEventAminoMsg): CallbackRegisteredEvent { + return CallbackRegisteredEvent.fromAmino(object.value); + }, + fromProtoMsg(message: CallbackRegisteredEventProtoMsg): CallbackRegisteredEvent { + return CallbackRegisteredEvent.decode(message.value); + }, + toProto(message: CallbackRegisteredEvent): Uint8Array { + return CallbackRegisteredEvent.encode(message).finish(); + }, + toProtoMsg(message: CallbackRegisteredEvent): CallbackRegisteredEventProtoMsg { + return { + typeUrl: "/archway.callback.v1.CallbackRegisteredEvent", + value: CallbackRegisteredEvent.encode(message).finish() + }; + } +}; +function createBaseCallbackCancelledEvent(): CallbackCancelledEvent { + return { + cancelledBy: "", + contractAddress: "", + jobId: BigInt(0), + callbackHeight: BigInt(0), + refundAmount: Coin.fromPartial({}) + }; +} +export const CallbackCancelledEvent = { + typeUrl: "/archway.callback.v1.CallbackCancelledEvent", + encode(message: CallbackCancelledEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.cancelledBy !== "") { + writer.uint32(10).string(message.cancelledBy); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(24).uint64(message.jobId); + } + if (message.callbackHeight !== BigInt(0)) { + writer.uint32(32).int64(message.callbackHeight); + } + if (message.refundAmount !== undefined) { + Coin.encode(message.refundAmount, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CallbackCancelledEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCallbackCancelledEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cancelledBy = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.jobId = reader.uint64(); + break; + case 4: + message.callbackHeight = reader.int64(); + break; + case 5: + message.refundAmount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CallbackCancelledEvent { + return { + cancelledBy: isSet(object.cancelledBy) ? String(object.cancelledBy) : "", + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + callbackHeight: isSet(object.callbackHeight) ? BigInt(object.callbackHeight.toString()) : BigInt(0), + refundAmount: isSet(object.refundAmount) ? Coin.fromJSON(object.refundAmount) : undefined + }; + }, + toJSON(message: CallbackCancelledEvent): JsonSafe { + const obj: any = {}; + message.cancelledBy !== undefined && (obj.cancelledBy = message.cancelledBy); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.callbackHeight !== undefined && (obj.callbackHeight = (message.callbackHeight || BigInt(0)).toString()); + message.refundAmount !== undefined && (obj.refundAmount = message.refundAmount ? Coin.toJSON(message.refundAmount) : undefined); + return obj; + }, + fromPartial(object: Partial): CallbackCancelledEvent { + const message = createBaseCallbackCancelledEvent(); + message.cancelledBy = object.cancelledBy ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.callbackHeight = object.callbackHeight !== undefined && object.callbackHeight !== null ? BigInt(object.callbackHeight.toString()) : BigInt(0); + message.refundAmount = object.refundAmount !== undefined && object.refundAmount !== null ? Coin.fromPartial(object.refundAmount) : undefined; + return message; + }, + fromAmino(object: CallbackCancelledEventAmino): CallbackCancelledEvent { + const message = createBaseCallbackCancelledEvent(); + if (object.cancelled_by !== undefined && object.cancelled_by !== null) { + message.cancelledBy = object.cancelled_by; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.callback_height !== undefined && object.callback_height !== null) { + message.callbackHeight = BigInt(object.callback_height); + } + if (object.refund_amount !== undefined && object.refund_amount !== null) { + message.refundAmount = Coin.fromAmino(object.refund_amount); + } + return message; + }, + toAmino(message: CallbackCancelledEvent): CallbackCancelledEventAmino { + const obj: any = {}; + obj.cancelled_by = message.cancelledBy === "" ? undefined : message.cancelledBy; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.callback_height = message.callbackHeight !== BigInt(0) ? message.callbackHeight.toString() : undefined; + obj.refund_amount = message.refundAmount ? Coin.toAmino(message.refundAmount) : undefined; + return obj; + }, + fromAminoMsg(object: CallbackCancelledEventAminoMsg): CallbackCancelledEvent { + return CallbackCancelledEvent.fromAmino(object.value); + }, + fromProtoMsg(message: CallbackCancelledEventProtoMsg): CallbackCancelledEvent { + return CallbackCancelledEvent.decode(message.value); + }, + toProto(message: CallbackCancelledEvent): Uint8Array { + return CallbackCancelledEvent.encode(message).finish(); + }, + toProtoMsg(message: CallbackCancelledEvent): CallbackCancelledEventProtoMsg { + return { + typeUrl: "/archway.callback.v1.CallbackCancelledEvent", + value: CallbackCancelledEvent.encode(message).finish() + }; + } +}; +function createBaseCallbackExecutedSuccessEvent(): CallbackExecutedSuccessEvent { + return { + contractAddress: "", + jobId: BigInt(0), + sudoMsg: "", + gasUsed: BigInt(0) + }; +} +export const CallbackExecutedSuccessEvent = { + typeUrl: "/archway.callback.v1.CallbackExecutedSuccessEvent", + encode(message: CallbackExecutedSuccessEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(16).uint64(message.jobId); + } + if (message.sudoMsg !== "") { + writer.uint32(26).string(message.sudoMsg); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(32).uint64(message.gasUsed); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CallbackExecutedSuccessEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCallbackExecutedSuccessEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.jobId = reader.uint64(); + break; + case 3: + message.sudoMsg = reader.string(); + break; + case 4: + message.gasUsed = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CallbackExecutedSuccessEvent { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + sudoMsg: isSet(object.sudoMsg) ? String(object.sudoMsg) : "", + gasUsed: isSet(object.gasUsed) ? BigInt(object.gasUsed.toString()) : BigInt(0) + }; + }, + toJSON(message: CallbackExecutedSuccessEvent): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.sudoMsg !== undefined && (obj.sudoMsg = message.sudoMsg); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): CallbackExecutedSuccessEvent { + const message = createBaseCallbackExecutedSuccessEvent(); + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.sudoMsg = object.sudoMsg ?? ""; + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CallbackExecutedSuccessEventAmino): CallbackExecutedSuccessEvent { + const message = createBaseCallbackExecutedSuccessEvent(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.sudo_msg !== undefined && object.sudo_msg !== null) { + message.sudoMsg = object.sudo_msg; + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + return message; + }, + toAmino(message: CallbackExecutedSuccessEvent): CallbackExecutedSuccessEventAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.sudo_msg = message.sudoMsg === "" ? undefined : message.sudoMsg; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CallbackExecutedSuccessEventAminoMsg): CallbackExecutedSuccessEvent { + return CallbackExecutedSuccessEvent.fromAmino(object.value); + }, + fromProtoMsg(message: CallbackExecutedSuccessEventProtoMsg): CallbackExecutedSuccessEvent { + return CallbackExecutedSuccessEvent.decode(message.value); + }, + toProto(message: CallbackExecutedSuccessEvent): Uint8Array { + return CallbackExecutedSuccessEvent.encode(message).finish(); + }, + toProtoMsg(message: CallbackExecutedSuccessEvent): CallbackExecutedSuccessEventProtoMsg { + return { + typeUrl: "/archway.callback.v1.CallbackExecutedSuccessEvent", + value: CallbackExecutedSuccessEvent.encode(message).finish() + }; + } +}; +function createBaseCallbackExecutedFailedEvent(): CallbackExecutedFailedEvent { + return { + contractAddress: "", + jobId: BigInt(0), + sudoMsg: "", + gasUsed: BigInt(0), + error: "" + }; +} +export const CallbackExecutedFailedEvent = { + typeUrl: "/archway.callback.v1.CallbackExecutedFailedEvent", + encode(message: CallbackExecutedFailedEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(16).uint64(message.jobId); + } + if (message.sudoMsg !== "") { + writer.uint32(26).string(message.sudoMsg); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(32).uint64(message.gasUsed); + } + if (message.error !== "") { + writer.uint32(42).string(message.error); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CallbackExecutedFailedEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCallbackExecutedFailedEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.jobId = reader.uint64(); + break; + case 3: + message.sudoMsg = reader.string(); + break; + case 4: + message.gasUsed = reader.uint64(); + break; + case 5: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CallbackExecutedFailedEvent { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + sudoMsg: isSet(object.sudoMsg) ? String(object.sudoMsg) : "", + gasUsed: isSet(object.gasUsed) ? BigInt(object.gasUsed.toString()) : BigInt(0), + error: isSet(object.error) ? String(object.error) : "" + }; + }, + toJSON(message: CallbackExecutedFailedEvent): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.sudoMsg !== undefined && (obj.sudoMsg = message.sudoMsg); + message.gasUsed !== undefined && (obj.gasUsed = (message.gasUsed || BigInt(0)).toString()); + message.error !== undefined && (obj.error = message.error); + return obj; + }, + fromPartial(object: Partial): CallbackExecutedFailedEvent { + const message = createBaseCallbackExecutedFailedEvent(); + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.sudoMsg = object.sudoMsg ?? ""; + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + message.error = object.error ?? ""; + return message; + }, + fromAmino(object: CallbackExecutedFailedEventAmino): CallbackExecutedFailedEvent { + const message = createBaseCallbackExecutedFailedEvent(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.sudo_msg !== undefined && object.sudo_msg !== null) { + message.sudoMsg = object.sudo_msg; + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: CallbackExecutedFailedEvent): CallbackExecutedFailedEventAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.sudo_msg = message.sudoMsg === "" ? undefined : message.sudoMsg; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + obj.error = message.error === "" ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: CallbackExecutedFailedEventAminoMsg): CallbackExecutedFailedEvent { + return CallbackExecutedFailedEvent.fromAmino(object.value); + }, + fromProtoMsg(message: CallbackExecutedFailedEventProtoMsg): CallbackExecutedFailedEvent { + return CallbackExecutedFailedEvent.decode(message.value); + }, + toProto(message: CallbackExecutedFailedEvent): Uint8Array { + return CallbackExecutedFailedEvent.encode(message).finish(); + }, + toProtoMsg(message: CallbackExecutedFailedEvent): CallbackExecutedFailedEventProtoMsg { + return { + typeUrl: "/archway.callback.v1.CallbackExecutedFailedEvent", + value: CallbackExecutedFailedEvent.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/genesis.ts b/packages/arch3-proto/generated/archway/callback/v1/genesis.ts new file mode 100644 index 0000000..19b5057 --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/genesis.ts @@ -0,0 +1,120 @@ +/* eslint-disable */ +import { Params, ParamsAmino, Callback, CallbackAmino } from "./callback"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** GenesisState defines the initial state of the callback module. */ +export interface GenesisState { + /** params defines all the module parameters. */ + params: Params; + /** callbacks defines all the callbacks which are yet to be executed */ + callbacks: Callback[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/archway.callback.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the initial state of the callback module. */ +export interface GenesisStateAmino { + /** params defines all the module parameters. */ + params?: ParamsAmino; + /** callbacks defines all the callbacks which are yet to be executed */ + callbacks?: CallbackAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/archway.callback.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + callbacks: [] + }; +} +export const GenesisState = { + typeUrl: "/archway.callback.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.callbacks) { + Callback.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.callbacks.push(Callback.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + callbacks: Array.isArray(object?.callbacks) ? object.callbacks.map((e: any) => Callback.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): JsonSafe { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.callbacks) { + obj.callbacks = message.callbacks.map(e => e ? Callback.toJSON(e) : undefined); + } else { + obj.callbacks = []; + } + return obj; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.callbacks = object.callbacks?.map(e => Callback.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.callbacks = object.callbacks?.map(e => Callback.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.callbacks) { + obj.callbacks = message.callbacks.map(e => e ? Callback.toAmino(e) : undefined); + } else { + obj.callbacks = message.callbacks; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/archway.callback.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/query.rpc.Query.ts b/packages/arch3-proto/generated/archway/callback/v1/query.rpc.Query.ts new file mode 100644 index 0000000..be1b4a8 --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/query.rpc.Query.ts @@ -0,0 +1,53 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryEstimateCallbackFeesRequest, QueryEstimateCallbackFeesResponse, QueryCallbacksRequest, QueryCallbacksResponse } from "./query"; +/** Query service for the callback module. */ +export interface Query { + /** Params returns module parameters */ + params(request?: QueryParamsRequest): Promise; + /** EstimateCallbackFees returns the total amount of callback fees a contract needs to pay to register the callback */ + estimateCallbackFees(request: QueryEstimateCallbackFeesRequest): Promise; + /** Callbacks returns all the callbacks registered at a given height */ + callbacks(request: QueryCallbacksRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.estimateCallbackFees = this.estimateCallbackFees.bind(this); + this.callbacks = this.callbacks.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("archway.callback.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + estimateCallbackFees(request: QueryEstimateCallbackFeesRequest): Promise { + const data = QueryEstimateCallbackFeesRequest.encode(request).finish(); + const promise = this.rpc.request("archway.callback.v1.Query", "EstimateCallbackFees", data); + return promise.then(data => QueryEstimateCallbackFeesResponse.decode(new BinaryReader(data))); + } + callbacks(request: QueryCallbacksRequest): Promise { + const data = QueryCallbacksRequest.encode(request).finish(); + const promise = this.rpc.request("archway.callback.v1.Query", "Callbacks", data); + return promise.then(data => QueryCallbacksResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + estimateCallbackFees(request: QueryEstimateCallbackFeesRequest): Promise { + return queryService.estimateCallbackFees(request); + }, + callbacks(request: QueryCallbacksRequest): Promise { + return queryService.callbacks(request); + } + }; +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/query.ts b/packages/arch3-proto/generated/archway/callback/v1/query.ts new file mode 100644 index 0000000..ab2248a --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/query.ts @@ -0,0 +1,554 @@ +/* eslint-disable */ +import { Params, ParamsAmino, CallbackFeesFeeSplit, CallbackFeesFeeSplitAmino, Callback, CallbackAmino } from "./callback"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { JsonSafe } from "../../../json-safe"; +import { isSet } from "../../../helpers"; +/** QueryParamsRequest is the request for Query.Params. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/archway.callback.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request for Query.Params. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/archway.callback.v1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is the response for Query.Params. */ +export interface QueryParamsResponse { + /** params defines all the module parameters. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/archway.callback.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response for Query.Params. */ +export interface QueryParamsResponseAmino { + /** params defines all the module parameters. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/archway.callback.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryEstimateCallbackFeesRequest is the request for Query.EstimateCallbackFees. */ +export interface QueryEstimateCallbackFeesRequest { + /** block_height is the height at which to estimate the callback fees */ + blockHeight: bigint; +} +export interface QueryEstimateCallbackFeesRequestProtoMsg { + typeUrl: "/archway.callback.v1.QueryEstimateCallbackFeesRequest"; + value: Uint8Array; +} +/** QueryEstimateCallbackFeesRequest is the request for Query.EstimateCallbackFees. */ +export interface QueryEstimateCallbackFeesRequestAmino { + /** block_height is the height at which to estimate the callback fees */ + block_height?: string; +} +export interface QueryEstimateCallbackFeesRequestAminoMsg { + type: "/archway.callback.v1.QueryEstimateCallbackFeesRequest"; + value: QueryEstimateCallbackFeesRequestAmino; +} +/** QueryEstimateCallbackFeesResponse is the response for Query.EstimateCallbackFees. */ +export interface QueryEstimateCallbackFeesResponse { + /** total_fees is the total fees that needs to be paid by the contract to reserve a callback */ + totalFees?: Coin; + /** fee_split is the breakdown of the total_fees */ + feeSplit?: CallbackFeesFeeSplit; +} +export interface QueryEstimateCallbackFeesResponseProtoMsg { + typeUrl: "/archway.callback.v1.QueryEstimateCallbackFeesResponse"; + value: Uint8Array; +} +/** QueryEstimateCallbackFeesResponse is the response for Query.EstimateCallbackFees. */ +export interface QueryEstimateCallbackFeesResponseAmino { + /** total_fees is the total fees that needs to be paid by the contract to reserve a callback */ + total_fees?: CoinAmino; + /** fee_split is the breakdown of the total_fees */ + fee_split?: CallbackFeesFeeSplitAmino; +} +export interface QueryEstimateCallbackFeesResponseAminoMsg { + type: "/archway.callback.v1.QueryEstimateCallbackFeesResponse"; + value: QueryEstimateCallbackFeesResponseAmino; +} +/** QueryCallbacksRequest is the request for Query.Callbacks. */ +export interface QueryCallbacksRequest { + /** block_height is the height at which to query the callbacks */ + blockHeight: bigint; +} +export interface QueryCallbacksRequestProtoMsg { + typeUrl: "/archway.callback.v1.QueryCallbacksRequest"; + value: Uint8Array; +} +/** QueryCallbacksRequest is the request for Query.Callbacks. */ +export interface QueryCallbacksRequestAmino { + /** block_height is the height at which to query the callbacks */ + block_height?: string; +} +export interface QueryCallbacksRequestAminoMsg { + type: "/archway.callback.v1.QueryCallbacksRequest"; + value: QueryCallbacksRequestAmino; +} +/** QueryCallbacksResponse is the response for Query.Callbacks. */ +export interface QueryCallbacksResponse { + /** callbacks is the list of callbacks registered at the given height */ + callbacks: Callback[]; +} +export interface QueryCallbacksResponseProtoMsg { + typeUrl: "/archway.callback.v1.QueryCallbacksResponse"; + value: Uint8Array; +} +/** QueryCallbacksResponse is the response for Query.Callbacks. */ +export interface QueryCallbacksResponseAmino { + /** callbacks is the list of callbacks registered at the given height */ + callbacks?: CallbackAmino[]; +} +export interface QueryCallbacksResponseAminoMsg { + type: "/archway.callback.v1.QueryCallbacksResponse"; + value: QueryCallbacksResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/archway.callback.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/archway.callback.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/archway.callback.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryParamsResponse): JsonSafe { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/archway.callback.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryEstimateCallbackFeesRequest(): QueryEstimateCallbackFeesRequest { + return { + blockHeight: BigInt(0) + }; +} +export const QueryEstimateCallbackFeesRequest = { + typeUrl: "/archway.callback.v1.QueryEstimateCallbackFeesRequest", + encode(message: QueryEstimateCallbackFeesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).int64(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEstimateCallbackFeesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEstimateCallbackFeesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryEstimateCallbackFeesRequest { + return { + blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryEstimateCallbackFeesRequest): JsonSafe { + const obj: any = {}; + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): QueryEstimateCallbackFeesRequest { + const message = createBaseQueryEstimateCallbackFeesRequest(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryEstimateCallbackFeesRequestAmino): QueryEstimateCallbackFeesRequest { + const message = createBaseQueryEstimateCallbackFeesRequest(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + return message; + }, + toAmino(message: QueryEstimateCallbackFeesRequest): QueryEstimateCallbackFeesRequestAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryEstimateCallbackFeesRequestAminoMsg): QueryEstimateCallbackFeesRequest { + return QueryEstimateCallbackFeesRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEstimateCallbackFeesRequestProtoMsg): QueryEstimateCallbackFeesRequest { + return QueryEstimateCallbackFeesRequest.decode(message.value); + }, + toProto(message: QueryEstimateCallbackFeesRequest): Uint8Array { + return QueryEstimateCallbackFeesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryEstimateCallbackFeesRequest): QueryEstimateCallbackFeesRequestProtoMsg { + return { + typeUrl: "/archway.callback.v1.QueryEstimateCallbackFeesRequest", + value: QueryEstimateCallbackFeesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryEstimateCallbackFeesResponse(): QueryEstimateCallbackFeesResponse { + return { + totalFees: undefined, + feeSplit: undefined + }; +} +export const QueryEstimateCallbackFeesResponse = { + typeUrl: "/archway.callback.v1.QueryEstimateCallbackFeesResponse", + encode(message: QueryEstimateCallbackFeesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalFees !== undefined) { + Coin.encode(message.totalFees, writer.uint32(10).fork()).ldelim(); + } + if (message.feeSplit !== undefined) { + CallbackFeesFeeSplit.encode(message.feeSplit, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryEstimateCallbackFeesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryEstimateCallbackFeesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalFees = Coin.decode(reader, reader.uint32()); + break; + case 2: + message.feeSplit = CallbackFeesFeeSplit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryEstimateCallbackFeesResponse { + return { + totalFees: isSet(object.totalFees) ? Coin.fromJSON(object.totalFees) : undefined, + feeSplit: isSet(object.feeSplit) ? CallbackFeesFeeSplit.fromJSON(object.feeSplit) : undefined + }; + }, + toJSON(message: QueryEstimateCallbackFeesResponse): JsonSafe { + const obj: any = {}; + message.totalFees !== undefined && (obj.totalFees = message.totalFees ? Coin.toJSON(message.totalFees) : undefined); + message.feeSplit !== undefined && (obj.feeSplit = message.feeSplit ? CallbackFeesFeeSplit.toJSON(message.feeSplit) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryEstimateCallbackFeesResponse { + const message = createBaseQueryEstimateCallbackFeesResponse(); + message.totalFees = object.totalFees !== undefined && object.totalFees !== null ? Coin.fromPartial(object.totalFees) : undefined; + message.feeSplit = object.feeSplit !== undefined && object.feeSplit !== null ? CallbackFeesFeeSplit.fromPartial(object.feeSplit) : undefined; + return message; + }, + fromAmino(object: QueryEstimateCallbackFeesResponseAmino): QueryEstimateCallbackFeesResponse { + const message = createBaseQueryEstimateCallbackFeesResponse(); + if (object.total_fees !== undefined && object.total_fees !== null) { + message.totalFees = Coin.fromAmino(object.total_fees); + } + if (object.fee_split !== undefined && object.fee_split !== null) { + message.feeSplit = CallbackFeesFeeSplit.fromAmino(object.fee_split); + } + return message; + }, + toAmino(message: QueryEstimateCallbackFeesResponse): QueryEstimateCallbackFeesResponseAmino { + const obj: any = {}; + obj.total_fees = message.totalFees ? Coin.toAmino(message.totalFees) : undefined; + obj.fee_split = message.feeSplit ? CallbackFeesFeeSplit.toAmino(message.feeSplit) : undefined; + return obj; + }, + fromAminoMsg(object: QueryEstimateCallbackFeesResponseAminoMsg): QueryEstimateCallbackFeesResponse { + return QueryEstimateCallbackFeesResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryEstimateCallbackFeesResponseProtoMsg): QueryEstimateCallbackFeesResponse { + return QueryEstimateCallbackFeesResponse.decode(message.value); + }, + toProto(message: QueryEstimateCallbackFeesResponse): Uint8Array { + return QueryEstimateCallbackFeesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryEstimateCallbackFeesResponse): QueryEstimateCallbackFeesResponseProtoMsg { + return { + typeUrl: "/archway.callback.v1.QueryEstimateCallbackFeesResponse", + value: QueryEstimateCallbackFeesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCallbacksRequest(): QueryCallbacksRequest { + return { + blockHeight: BigInt(0) + }; +} +export const QueryCallbacksRequest = { + typeUrl: "/archway.callback.v1.QueryCallbacksRequest", + encode(message: QueryCallbacksRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).int64(message.blockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCallbacksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCallbacksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCallbacksRequest { + return { + blockHeight: isSet(object.blockHeight) ? BigInt(object.blockHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryCallbacksRequest): JsonSafe { + const obj: any = {}; + message.blockHeight !== undefined && (obj.blockHeight = (message.blockHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): QueryCallbacksRequest { + const message = createBaseQueryCallbacksRequest(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryCallbacksRequestAmino): QueryCallbacksRequest { + const message = createBaseQueryCallbacksRequest(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + return message; + }, + toAmino(message: QueryCallbacksRequest): QueryCallbacksRequestAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryCallbacksRequestAminoMsg): QueryCallbacksRequest { + return QueryCallbacksRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCallbacksRequestProtoMsg): QueryCallbacksRequest { + return QueryCallbacksRequest.decode(message.value); + }, + toProto(message: QueryCallbacksRequest): Uint8Array { + return QueryCallbacksRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCallbacksRequest): QueryCallbacksRequestProtoMsg { + return { + typeUrl: "/archway.callback.v1.QueryCallbacksRequest", + value: QueryCallbacksRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCallbacksResponse(): QueryCallbacksResponse { + return { + callbacks: [] + }; +} +export const QueryCallbacksResponse = { + typeUrl: "/archway.callback.v1.QueryCallbacksResponse", + encode(message: QueryCallbacksResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.callbacks) { + Callback.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCallbacksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCallbacksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.callbacks.push(Callback.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryCallbacksResponse { + return { + callbacks: Array.isArray(object?.callbacks) ? object.callbacks.map((e: any) => Callback.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryCallbacksResponse): JsonSafe { + const obj: any = {}; + if (message.callbacks) { + obj.callbacks = message.callbacks.map(e => e ? Callback.toJSON(e) : undefined); + } else { + obj.callbacks = []; + } + return obj; + }, + fromPartial(object: Partial): QueryCallbacksResponse { + const message = createBaseQueryCallbacksResponse(); + message.callbacks = object.callbacks?.map(e => Callback.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryCallbacksResponseAmino): QueryCallbacksResponse { + const message = createBaseQueryCallbacksResponse(); + message.callbacks = object.callbacks?.map(e => Callback.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryCallbacksResponse): QueryCallbacksResponseAmino { + const obj: any = {}; + if (message.callbacks) { + obj.callbacks = message.callbacks.map(e => e ? Callback.toAmino(e) : undefined); + } else { + obj.callbacks = message.callbacks; + } + return obj; + }, + fromAminoMsg(object: QueryCallbacksResponseAminoMsg): QueryCallbacksResponse { + return QueryCallbacksResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryCallbacksResponseProtoMsg): QueryCallbacksResponse { + return QueryCallbacksResponse.decode(message.value); + }, + toProto(message: QueryCallbacksResponse): Uint8Array { + return QueryCallbacksResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCallbacksResponse): QueryCallbacksResponseProtoMsg { + return { + typeUrl: "/archway.callback.v1.QueryCallbacksResponse", + value: QueryCallbacksResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/tx.amino.ts b/packages/arch3-proto/generated/archway/callback/v1/tx.amino.ts new file mode 100644 index 0000000..b86f6de --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/tx.amino.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ +import { MsgUpdateParams, MsgRequestCallback, MsgCancelCallback } from "./tx"; +export const AminoConverter = { + "/archway.callback.v1.MsgUpdateParams": { + aminoType: "/archway.callback.v1.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/archway.callback.v1.MsgRequestCallback": { + aminoType: "/archway.callback.v1.MsgRequestCallback", + toAmino: MsgRequestCallback.toAmino, + fromAmino: MsgRequestCallback.fromAmino + }, + "/archway.callback.v1.MsgCancelCallback": { + aminoType: "/archway.callback.v1.MsgCancelCallback", + toAmino: MsgCancelCallback.toAmino, + fromAmino: MsgCancelCallback.fromAmino + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/tx.registry.ts b/packages/arch3-proto/generated/archway/callback/v1/tx.registry.ts new file mode 100644 index 0000000..5ec4709 --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/tx.registry.ts @@ -0,0 +1,112 @@ +/* eslint-disable */ +import { TelescopeGeneratedType } from "../../../types"; +import { Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams, MsgRequestCallback, MsgCancelCallback } from "./tx"; +export const registry: ReadonlyArray<[string, TelescopeGeneratedType]> = [["/archway.callback.v1.MsgUpdateParams", MsgUpdateParams], ["/archway.callback.v1.MsgRequestCallback", MsgRequestCallback], ["/archway.callback.v1.MsgCancelCallback", MsgCancelCallback]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + requestCallback(value: MsgRequestCallback) { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + value: MsgRequestCallback.encode(value).finish() + }; + }, + cancelCallback(value: MsgCancelCallback) { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + value: MsgCancelCallback.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + value + }; + }, + requestCallback(value: MsgRequestCallback) { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + value + }; + }, + cancelCallback(value: MsgCancelCallback) { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + value + }; + } + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + }, + requestCallback(value: MsgRequestCallback) { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + value: MsgRequestCallback.toJSON(value) + }; + }, + cancelCallback(value: MsgCancelCallback) { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + value: MsgCancelCallback.toJSON(value) + }; + } + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + }, + requestCallback(value: any) { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + value: MsgRequestCallback.fromJSON(value) + }; + }, + cancelCallback(value: any) { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + value: MsgCancelCallback.fromJSON(value) + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + requestCallback(value: MsgRequestCallback) { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + value: MsgRequestCallback.fromPartial(value) + }; + }, + cancelCallback(value: MsgCancelCallback) { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + value: MsgCancelCallback.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/tx.rpc.msg.ts b/packages/arch3-proto/generated/archway/callback/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..39d9b9c --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/tx.rpc.msg.ts @@ -0,0 +1,40 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse, MsgRequestCallback, MsgRequestCallbackResponse, MsgCancelCallback, MsgCancelCallbackResponse } from "./tx"; +/** Msg defines the module messaging service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/callback + * module parameters. The authority is defined in the keeper. + */ + updateParams(request: MsgUpdateParams): Promise; + /** RequestCallback defines a message for registering a callback at a specific height by a given contract */ + requestCallback(request: MsgRequestCallback): Promise; + /** CancelCallback defines a message for cancelling an existing callback */ + cancelCallback(request: MsgCancelCallback): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + this.requestCallback = this.requestCallback.bind(this); + this.cancelCallback = this.cancelCallback.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("archway.callback.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + requestCallback(request: MsgRequestCallback): Promise { + const data = MsgRequestCallback.encode(request).finish(); + const promise = this.rpc.request("archway.callback.v1.Msg", "RequestCallback", data); + return promise.then(data => MsgRequestCallbackResponse.decode(new BinaryReader(data))); + } + cancelCallback(request: MsgCancelCallback): Promise { + const data = MsgCancelCallback.encode(request).finish(); + const promise = this.rpc.request("archway.callback.v1.Msg", "CancelCallback", data); + return promise.then(data => MsgCancelCallbackResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/callback/v1/tx.ts b/packages/arch3-proto/generated/archway/callback/v1/tx.ts new file mode 100644 index 0000000..4e93d4d --- /dev/null +++ b/packages/arch3-proto/generated/archway/callback/v1/tx.ts @@ -0,0 +1,660 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./callback"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/callback parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/archway.callback.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/callback parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "/archway.callback.v1.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/archway.callback.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/archway.callback.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgRequestCallback is the Msg/RequestCallback request type. */ +export interface MsgRequestCallback { + /** sender is the address who is requesting the callback (bech32 encoded) */ + sender: string; + /** contract_address is the address of the contract which is requesting the callback (bech32 encoded) */ + contractAddress: string; + /** job_id is an identifier the callback requestor can pass in to identify the callback when it happens */ + jobId: bigint; + /** callback_height is the height at which the callback is executed. */ + callbackHeight: bigint; + /** fees is the amount of fees being paid to register the contract */ + fees: Coin; +} +export interface MsgRequestCallbackProtoMsg { + typeUrl: "/archway.callback.v1.MsgRequestCallback"; + value: Uint8Array; +} +/** MsgRequestCallback is the Msg/RequestCallback request type. */ +export interface MsgRequestCallbackAmino { + /** sender is the address who is requesting the callback (bech32 encoded) */ + sender?: string; + /** contract_address is the address of the contract which is requesting the callback (bech32 encoded) */ + contract_address?: string; + /** job_id is an identifier the callback requestor can pass in to identify the callback when it happens */ + job_id?: string; + /** callback_height is the height at which the callback is executed. */ + callback_height?: string; + /** fees is the amount of fees being paid to register the contract */ + fees?: CoinAmino; +} +export interface MsgRequestCallbackAminoMsg { + type: "/archway.callback.v1.MsgRequestCallback"; + value: MsgRequestCallbackAmino; +} +/** MsgRequestCallbackResponse defines the response structure for executing a MsgRequestCallback message. */ +export interface MsgRequestCallbackResponse {} +export interface MsgRequestCallbackResponseProtoMsg { + typeUrl: "/archway.callback.v1.MsgRequestCallbackResponse"; + value: Uint8Array; +} +/** MsgRequestCallbackResponse defines the response structure for executing a MsgRequestCallback message. */ +export interface MsgRequestCallbackResponseAmino {} +export interface MsgRequestCallbackResponseAminoMsg { + type: "/archway.callback.v1.MsgRequestCallbackResponse"; + value: MsgRequestCallbackResponseAmino; +} +/** MsgCancelCallback is the Msg/CancelCallback request type. */ +export interface MsgCancelCallback { + /** sender is the address of the contract which is cancelling the callback (bech32 encoded) */ + sender: string; + /** contract_address is the address of the contract (bech32 encoded) */ + contractAddress: string; + /** job_id is an identifier the callback requestor had passed during registration of the callback */ + jobId: bigint; + /** callback_height is the height at which the callback requestor had registered the callback */ + callbackHeight: bigint; +} +export interface MsgCancelCallbackProtoMsg { + typeUrl: "/archway.callback.v1.MsgCancelCallback"; + value: Uint8Array; +} +/** MsgCancelCallback is the Msg/CancelCallback request type. */ +export interface MsgCancelCallbackAmino { + /** sender is the address of the contract which is cancelling the callback (bech32 encoded) */ + sender?: string; + /** contract_address is the address of the contract (bech32 encoded) */ + contract_address?: string; + /** job_id is an identifier the callback requestor had passed during registration of the callback */ + job_id?: string; + /** callback_height is the height at which the callback requestor had registered the callback */ + callback_height?: string; +} +export interface MsgCancelCallbackAminoMsg { + type: "/archway.callback.v1.MsgCancelCallback"; + value: MsgCancelCallbackAmino; +} +/** MsgCancelCallbackResponse defines the response structure for executing a MsgCancelCallback message. */ +export interface MsgCancelCallbackResponse { + /** refund is the amount of fees being refunded due to the cancellation of the callback */ + refund: Coin; +} +export interface MsgCancelCallbackResponseProtoMsg { + typeUrl: "/archway.callback.v1.MsgCancelCallbackResponse"; + value: Uint8Array; +} +/** MsgCancelCallbackResponse defines the response structure for executing a MsgCancelCallback message. */ +export interface MsgCancelCallbackResponseAmino { + /** refund is the amount of fees being refunded due to the cancellation of the callback */ + refund?: CoinAmino; +} +export interface MsgCancelCallbackResponseAminoMsg { + type: "/archway.callback.v1.MsgCancelCallbackResponse"; + value: MsgCancelCallbackResponseAmino; +} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): JsonSafe { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/archway.callback.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/archway.callback.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRequestCallback(): MsgRequestCallback { + return { + sender: "", + contractAddress: "", + jobId: BigInt(0), + callbackHeight: BigInt(0), + fees: Coin.fromPartial({}) + }; +} +export const MsgRequestCallback = { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + encode(message: MsgRequestCallback, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(24).uint64(message.jobId); + } + if (message.callbackHeight !== BigInt(0)) { + writer.uint32(32).int64(message.callbackHeight); + } + if (message.fees !== undefined) { + Coin.encode(message.fees, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestCallback { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestCallback(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.jobId = reader.uint64(); + break; + case 4: + message.callbackHeight = reader.int64(); + break; + case 5: + message.fees = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgRequestCallback { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + callbackHeight: isSet(object.callbackHeight) ? BigInt(object.callbackHeight.toString()) : BigInt(0), + fees: isSet(object.fees) ? Coin.fromJSON(object.fees) : undefined + }; + }, + toJSON(message: MsgRequestCallback): JsonSafe { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.callbackHeight !== undefined && (obj.callbackHeight = (message.callbackHeight || BigInt(0)).toString()); + message.fees !== undefined && (obj.fees = message.fees ? Coin.toJSON(message.fees) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgRequestCallback { + const message = createBaseMsgRequestCallback(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.callbackHeight = object.callbackHeight !== undefined && object.callbackHeight !== null ? BigInt(object.callbackHeight.toString()) : BigInt(0); + message.fees = object.fees !== undefined && object.fees !== null ? Coin.fromPartial(object.fees) : undefined; + return message; + }, + fromAmino(object: MsgRequestCallbackAmino): MsgRequestCallback { + const message = createBaseMsgRequestCallback(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.callback_height !== undefined && object.callback_height !== null) { + message.callbackHeight = BigInt(object.callback_height); + } + if (object.fees !== undefined && object.fees !== null) { + message.fees = Coin.fromAmino(object.fees); + } + return message; + }, + toAmino(message: MsgRequestCallback): MsgRequestCallbackAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.callback_height = message.callbackHeight !== BigInt(0) ? message.callbackHeight.toString() : undefined; + obj.fees = message.fees ? Coin.toAmino(message.fees) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRequestCallbackAminoMsg): MsgRequestCallback { + return MsgRequestCallback.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestCallbackProtoMsg): MsgRequestCallback { + return MsgRequestCallback.decode(message.value); + }, + toProto(message: MsgRequestCallback): Uint8Array { + return MsgRequestCallback.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestCallback): MsgRequestCallbackProtoMsg { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallback", + value: MsgRequestCallback.encode(message).finish() + }; + } +}; +function createBaseMsgRequestCallbackResponse(): MsgRequestCallbackResponse { + return {}; +} +export const MsgRequestCallbackResponse = { + typeUrl: "/archway.callback.v1.MsgRequestCallbackResponse", + encode(_: MsgRequestCallbackResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRequestCallbackResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRequestCallbackResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgRequestCallbackResponse { + return {}; + }, + toJSON(_: MsgRequestCallbackResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgRequestCallbackResponse { + const message = createBaseMsgRequestCallbackResponse(); + return message; + }, + fromAmino(_: MsgRequestCallbackResponseAmino): MsgRequestCallbackResponse { + const message = createBaseMsgRequestCallbackResponse(); + return message; + }, + toAmino(_: MsgRequestCallbackResponse): MsgRequestCallbackResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRequestCallbackResponseAminoMsg): MsgRequestCallbackResponse { + return MsgRequestCallbackResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRequestCallbackResponseProtoMsg): MsgRequestCallbackResponse { + return MsgRequestCallbackResponse.decode(message.value); + }, + toProto(message: MsgRequestCallbackResponse): Uint8Array { + return MsgRequestCallbackResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRequestCallbackResponse): MsgRequestCallbackResponseProtoMsg { + return { + typeUrl: "/archway.callback.v1.MsgRequestCallbackResponse", + value: MsgRequestCallbackResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCancelCallback(): MsgCancelCallback { + return { + sender: "", + contractAddress: "", + jobId: BigInt(0), + callbackHeight: BigInt(0) + }; +} +export const MsgCancelCallback = { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + encode(message: MsgCancelCallback, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.jobId !== BigInt(0)) { + writer.uint32(24).uint64(message.jobId); + } + if (message.callbackHeight !== BigInt(0)) { + writer.uint32(32).int64(message.callbackHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelCallback { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelCallback(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.jobId = reader.uint64(); + break; + case 4: + message.callbackHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCancelCallback { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + jobId: isSet(object.jobId) ? BigInt(object.jobId.toString()) : BigInt(0), + callbackHeight: isSet(object.callbackHeight) ? BigInt(object.callbackHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgCancelCallback): JsonSafe { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.jobId !== undefined && (obj.jobId = (message.jobId || BigInt(0)).toString()); + message.callbackHeight !== undefined && (obj.callbackHeight = (message.callbackHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgCancelCallback { + const message = createBaseMsgCancelCallback(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.jobId = object.jobId !== undefined && object.jobId !== null ? BigInt(object.jobId.toString()) : BigInt(0); + message.callbackHeight = object.callbackHeight !== undefined && object.callbackHeight !== null ? BigInt(object.callbackHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCancelCallbackAmino): MsgCancelCallback { + const message = createBaseMsgCancelCallback(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.job_id !== undefined && object.job_id !== null) { + message.jobId = BigInt(object.job_id); + } + if (object.callback_height !== undefined && object.callback_height !== null) { + message.callbackHeight = BigInt(object.callback_height); + } + return message; + }, + toAmino(message: MsgCancelCallback): MsgCancelCallbackAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.job_id = message.jobId !== BigInt(0) ? message.jobId.toString() : undefined; + obj.callback_height = message.callbackHeight !== BigInt(0) ? message.callbackHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelCallbackAminoMsg): MsgCancelCallback { + return MsgCancelCallback.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelCallbackProtoMsg): MsgCancelCallback { + return MsgCancelCallback.decode(message.value); + }, + toProto(message: MsgCancelCallback): Uint8Array { + return MsgCancelCallback.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelCallback): MsgCancelCallbackProtoMsg { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallback", + value: MsgCancelCallback.encode(message).finish() + }; + } +}; +function createBaseMsgCancelCallbackResponse(): MsgCancelCallbackResponse { + return { + refund: Coin.fromPartial({}) + }; +} +export const MsgCancelCallbackResponse = { + typeUrl: "/archway.callback.v1.MsgCancelCallbackResponse", + encode(message: MsgCancelCallbackResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.refund !== undefined) { + Coin.encode(message.refund, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelCallbackResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelCallbackResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.refund = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgCancelCallbackResponse { + return { + refund: isSet(object.refund) ? Coin.fromJSON(object.refund) : undefined + }; + }, + toJSON(message: MsgCancelCallbackResponse): JsonSafe { + const obj: any = {}; + message.refund !== undefined && (obj.refund = message.refund ? Coin.toJSON(message.refund) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgCancelCallbackResponse { + const message = createBaseMsgCancelCallbackResponse(); + message.refund = object.refund !== undefined && object.refund !== null ? Coin.fromPartial(object.refund) : undefined; + return message; + }, + fromAmino(object: MsgCancelCallbackResponseAmino): MsgCancelCallbackResponse { + const message = createBaseMsgCancelCallbackResponse(); + if (object.refund !== undefined && object.refund !== null) { + message.refund = Coin.fromAmino(object.refund); + } + return message; + }, + toAmino(message: MsgCancelCallbackResponse): MsgCancelCallbackResponseAmino { + const obj: any = {}; + obj.refund = message.refund ? Coin.toAmino(message.refund) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelCallbackResponseAminoMsg): MsgCancelCallbackResponse { + return MsgCancelCallbackResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgCancelCallbackResponseProtoMsg): MsgCancelCallbackResponse { + return MsgCancelCallbackResponse.decode(message.value); + }, + toProto(message: MsgCancelCallbackResponse): Uint8Array { + return MsgCancelCallbackResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelCallbackResponse): MsgCancelCallbackResponseProtoMsg { + return { + typeUrl: "/archway.callback.v1.MsgCancelCallbackResponse", + value: MsgCancelCallbackResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/client.ts b/packages/arch3-proto/generated/archway/client.ts index c498a0c..6ffc606 100644 --- a/packages/arch3-proto/generated/archway/client.ts +++ b/packages/arch3-proto/generated/archway/client.ts @@ -2,12 +2,24 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as archwayCallbackV1TxRegistry from "./callback/v1/tx.registry"; +import * as archwayCwerrorsV1TxRegistry from "./cwerrors/v1/tx.registry"; +import * as archwayCwfeesV1CwfeesRegistry from "./cwfees/v1/cwfees.registry"; +import * as archwayCwicaV1TxRegistry from "./cwica/v1/tx.registry"; import * as archwayRewardsV1TxRegistry from "./rewards/v1/tx.registry"; +import * as archwayCallbackV1TxAmino from "./callback/v1/tx.amino"; +import * as archwayCwerrorsV1TxAmino from "./cwerrors/v1/tx.amino"; +import * as archwayCwfeesV1CwfeesAmino from "./cwfees/v1/cwfees.amino"; +import * as archwayCwicaV1TxAmino from "./cwica/v1/tx.amino"; import * as archwayRewardsV1TxAmino from "./rewards/v1/tx.amino"; export const archwayAminoConverters = { + ...archwayCallbackV1TxAmino.AminoConverter, + ...archwayCwerrorsV1TxAmino.AminoConverter, + ...archwayCwfeesV1CwfeesAmino.AminoConverter, + ...archwayCwicaV1TxAmino.AminoConverter, ...archwayRewardsV1TxAmino.AminoConverter }; -export const archwayProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...archwayRewardsV1TxRegistry.registry]; +export const archwayProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...archwayCallbackV1TxRegistry.registry, ...archwayCwerrorsV1TxRegistry.registry, ...archwayCwfeesV1CwfeesRegistry.registry, ...archwayCwicaV1TxRegistry.registry, ...archwayRewardsV1TxRegistry.registry]; export const getSigningArchwayClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/cwerrors.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/cwerrors.ts new file mode 100644 index 0000000..7253aa6 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/cwerrors.ts @@ -0,0 +1,207 @@ +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** ModuleErrors defines the module level error codes */ +export enum ModuleErrors { + /** ERR_UNKNOWN - ERR_UNKNOWN is the default error code */ + ERR_UNKNOWN = 0, + /** ERR_CALLBACK_EXECUTION_FAILED - ERR_CALLBACK_EXECUTION_FAILED is the error code for when the error callback fails */ + ERR_CALLBACK_EXECUTION_FAILED = 1, + UNRECOGNIZED = -1, +} +export const ModuleErrorsAmino = ModuleErrors; +export function moduleErrorsFromJSON(object: any): ModuleErrors { + switch (object) { + case 0: + case "ERR_UNKNOWN": + return ModuleErrors.ERR_UNKNOWN; + case 1: + case "ERR_CALLBACK_EXECUTION_FAILED": + return ModuleErrors.ERR_CALLBACK_EXECUTION_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ModuleErrors.UNRECOGNIZED; + } +} +export function moduleErrorsToJSON(object: ModuleErrors): string { + switch (object) { + case ModuleErrors.ERR_UNKNOWN: + return "ERR_UNKNOWN"; + case ModuleErrors.ERR_CALLBACK_EXECUTION_FAILED: + return "ERR_CALLBACK_EXECUTION_FAILED"; + case ModuleErrors.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** SudoError defines the sudo message for the error callback */ +export interface SudoError { + /** module_name is the name of the module throwing the error */ + moduleName: string; + /** error_code is the module level error code */ + errorCode: number; + /** + * contract_address is the address of the contract which will receive the + * error callback + */ + contractAddress: string; + /** input_payload is any input which caused the error */ + inputPayload: string; + /** error_message is the error message */ + errorMessage: string; +} +export interface SudoErrorProtoMsg { + typeUrl: "/archway.cwerrors.v1.SudoError"; + value: Uint8Array; +} +/** SudoError defines the sudo message for the error callback */ +export interface SudoErrorAmino { + /** module_name is the name of the module throwing the error */ + module_name?: string; + /** error_code is the module level error code */ + error_code?: number; + /** + * contract_address is the address of the contract which will receive the + * error callback + */ + contract_address?: string; + /** input_payload is any input which caused the error */ + input_payload?: string; + /** error_message is the error message */ + error_message?: string; +} +export interface SudoErrorAminoMsg { + type: "/archway.cwerrors.v1.SudoError"; + value: SudoErrorAmino; +} +function createBaseSudoError(): SudoError { + return { + moduleName: "", + errorCode: 0, + contractAddress: "", + inputPayload: "", + errorMessage: "" + }; +} +export const SudoError = { + typeUrl: "/archway.cwerrors.v1.SudoError", + encode(message: SudoError, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + if (message.errorCode !== 0) { + writer.uint32(16).int32(message.errorCode); + } + if (message.contractAddress !== "") { + writer.uint32(26).string(message.contractAddress); + } + if (message.inputPayload !== "") { + writer.uint32(34).string(message.inputPayload); + } + if (message.errorMessage !== "") { + writer.uint32(42).string(message.errorMessage); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SudoError { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.errorCode = reader.int32(); + break; + case 3: + message.contractAddress = reader.string(); + break; + case 4: + message.inputPayload = reader.string(); + break; + case 5: + message.errorMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SudoError { + return { + moduleName: isSet(object.moduleName) ? String(object.moduleName) : "", + errorCode: isSet(object.errorCode) ? Number(object.errorCode) : 0, + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + inputPayload: isSet(object.inputPayload) ? String(object.inputPayload) : "", + errorMessage: isSet(object.errorMessage) ? String(object.errorMessage) : "" + }; + }, + toJSON(message: SudoError): JsonSafe { + const obj: any = {}; + message.moduleName !== undefined && (obj.moduleName = message.moduleName); + message.errorCode !== undefined && (obj.errorCode = Math.round(message.errorCode)); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.inputPayload !== undefined && (obj.inputPayload = message.inputPayload); + message.errorMessage !== undefined && (obj.errorMessage = message.errorMessage); + return obj; + }, + fromPartial(object: Partial): SudoError { + const message = createBaseSudoError(); + message.moduleName = object.moduleName ?? ""; + message.errorCode = object.errorCode ?? 0; + message.contractAddress = object.contractAddress ?? ""; + message.inputPayload = object.inputPayload ?? ""; + message.errorMessage = object.errorMessage ?? ""; + return message; + }, + fromAmino(object: SudoErrorAmino): SudoError { + const message = createBaseSudoError(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + if (object.error_code !== undefined && object.error_code !== null) { + message.errorCode = object.error_code; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.input_payload !== undefined && object.input_payload !== null) { + message.inputPayload = object.input_payload; + } + if (object.error_message !== undefined && object.error_message !== null) { + message.errorMessage = object.error_message; + } + return message; + }, + toAmino(message: SudoError): SudoErrorAmino { + const obj: any = {}; + obj.module_name = message.moduleName === "" ? undefined : message.moduleName; + obj.error_code = message.errorCode === 0 ? undefined : message.errorCode; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.input_payload = message.inputPayload === "" ? undefined : message.inputPayload; + obj.error_message = message.errorMessage === "" ? undefined : message.errorMessage; + return obj; + }, + fromAminoMsg(object: SudoErrorAminoMsg): SudoError { + return SudoError.fromAmino(object.value); + }, + fromProtoMsg(message: SudoErrorProtoMsg): SudoError { + return SudoError.decode(message.value); + }, + toProto(message: SudoError): Uint8Array { + return SudoError.encode(message).finish(); + }, + toProtoMsg(message: SudoError): SudoErrorProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.SudoError", + value: SudoError.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/events.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/events.ts new file mode 100644 index 0000000..7614503 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/events.ts @@ -0,0 +1,515 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./params"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { SudoError, SudoErrorAmino } from "./cwerrors"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** + * ParamsUpdatedEvent defines the event which is thrown when the module + * parameters are updated + */ +export interface ParamsUpdatedEvent { + /** new_params are the new parameters for the module */ + newParams: Params; + /** authority is the address of the authority that updated the parameters */ + authority: string; +} +export interface ParamsUpdatedEventProtoMsg { + typeUrl: "/archway.cwerrors.v1.ParamsUpdatedEvent"; + value: Uint8Array; +} +/** + * ParamsUpdatedEvent defines the event which is thrown when the module + * parameters are updated + */ +export interface ParamsUpdatedEventAmino { + /** new_params are the new parameters for the module */ + new_params?: ParamsAmino; + /** authority is the address of the authority that updated the parameters */ + authority?: string; +} +export interface ParamsUpdatedEventAminoMsg { + type: "/archway.cwerrors.v1.ParamsUpdatedEvent"; + value: ParamsUpdatedEventAmino; +} +/** + * SubscribedToErrorsEvent defines the event which is thrown when a contract + * subscribes to errors + */ +export interface SubscribedToErrorsEvent { + /** sender is the address which initiated the subscription */ + sender: string; + /** + * contract_address is the address of the contract which is subscribed to + * errors + */ + contractAddress: string; + /** fees_paid is the fees paid for the subscription */ + feesPaid: Coin; + /** + * subscription_valid_till is the block height till which the subscription is + * valid + */ + subscriptionValidTill: bigint; +} +export interface SubscribedToErrorsEventProtoMsg { + typeUrl: "/archway.cwerrors.v1.SubscribedToErrorsEvent"; + value: Uint8Array; +} +/** + * SubscribedToErrorsEvent defines the event which is thrown when a contract + * subscribes to errors + */ +export interface SubscribedToErrorsEventAmino { + /** sender is the address which initiated the subscription */ + sender?: string; + /** + * contract_address is the address of the contract which is subscribed to + * errors + */ + contract_address?: string; + /** fees_paid is the fees paid for the subscription */ + fees_paid?: CoinAmino; + /** + * subscription_valid_till is the block height till which the subscription is + * valid + */ + subscription_valid_till?: string; +} +export interface SubscribedToErrorsEventAminoMsg { + type: "/archway.cwerrors.v1.SubscribedToErrorsEvent"; + value: SubscribedToErrorsEventAmino; +} +/** StoringErrorEvent defines the event which is thrown when an error is stored */ +export interface StoringErrorEvent { + /** error is the error which is stored */ + error: SudoError; + /** + * deletion_block_height is the block height at which the error will be pruned + * from the state + */ + deletionBlockHeight: bigint; +} +export interface StoringErrorEventProtoMsg { + typeUrl: "/archway.cwerrors.v1.StoringErrorEvent"; + value: Uint8Array; +} +/** StoringErrorEvent defines the event which is thrown when an error is stored */ +export interface StoringErrorEventAmino { + /** error is the error which is stored */ + error?: SudoErrorAmino; + /** + * deletion_block_height is the block height at which the error will be pruned + * from the state + */ + deletion_block_height?: string; +} +export interface StoringErrorEventAminoMsg { + type: "/archway.cwerrors.v1.StoringErrorEvent"; + value: StoringErrorEventAmino; +} +/** + * SudoErrorCallbackFailedEvent defines the event which is thrown when a sudo + * error callback fails + */ +export interface SudoErrorCallbackFailedEvent { + /** error is the error for which the callback is executed */ + error: SudoError; + /** callback_error_message is the error message of why the callback failed */ + callbackErrorMessage: string; +} +export interface SudoErrorCallbackFailedEventProtoMsg { + typeUrl: "/archway.cwerrors.v1.SudoErrorCallbackFailedEvent"; + value: Uint8Array; +} +/** + * SudoErrorCallbackFailedEvent defines the event which is thrown when a sudo + * error callback fails + */ +export interface SudoErrorCallbackFailedEventAmino { + /** error is the error for which the callback is executed */ + error?: SudoErrorAmino; + /** callback_error_message is the error message of why the callback failed */ + callback_error_message?: string; +} +export interface SudoErrorCallbackFailedEventAminoMsg { + type: "/archway.cwerrors.v1.SudoErrorCallbackFailedEvent"; + value: SudoErrorCallbackFailedEventAmino; +} +function createBaseParamsUpdatedEvent(): ParamsUpdatedEvent { + return { + newParams: Params.fromPartial({}), + authority: "" + }; +} +export const ParamsUpdatedEvent = { + typeUrl: "/archway.cwerrors.v1.ParamsUpdatedEvent", + encode(message: ParamsUpdatedEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newParams !== undefined) { + Params.encode(message.newParams, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ParamsUpdatedEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParamsUpdatedEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newParams = Params.decode(reader, reader.uint32()); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ParamsUpdatedEvent { + return { + newParams: isSet(object.newParams) ? Params.fromJSON(object.newParams) : undefined, + authority: isSet(object.authority) ? String(object.authority) : "" + }; + }, + toJSON(message: ParamsUpdatedEvent): JsonSafe { + const obj: any = {}; + message.newParams !== undefined && (obj.newParams = message.newParams ? Params.toJSON(message.newParams) : undefined); + message.authority !== undefined && (obj.authority = message.authority); + return obj; + }, + fromPartial(object: Partial): ParamsUpdatedEvent { + const message = createBaseParamsUpdatedEvent(); + message.newParams = object.newParams !== undefined && object.newParams !== null ? Params.fromPartial(object.newParams) : undefined; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: ParamsUpdatedEventAmino): ParamsUpdatedEvent { + const message = createBaseParamsUpdatedEvent(); + if (object.new_params !== undefined && object.new_params !== null) { + message.newParams = Params.fromAmino(object.new_params); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: ParamsUpdatedEvent): ParamsUpdatedEventAmino { + const obj: any = {}; + obj.new_params = message.newParams ? Params.toAmino(message.newParams) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: ParamsUpdatedEventAminoMsg): ParamsUpdatedEvent { + return ParamsUpdatedEvent.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsUpdatedEventProtoMsg): ParamsUpdatedEvent { + return ParamsUpdatedEvent.decode(message.value); + }, + toProto(message: ParamsUpdatedEvent): Uint8Array { + return ParamsUpdatedEvent.encode(message).finish(); + }, + toProtoMsg(message: ParamsUpdatedEvent): ParamsUpdatedEventProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.ParamsUpdatedEvent", + value: ParamsUpdatedEvent.encode(message).finish() + }; + } +}; +function createBaseSubscribedToErrorsEvent(): SubscribedToErrorsEvent { + return { + sender: "", + contractAddress: "", + feesPaid: Coin.fromPartial({}), + subscriptionValidTill: BigInt(0) + }; +} +export const SubscribedToErrorsEvent = { + typeUrl: "/archway.cwerrors.v1.SubscribedToErrorsEvent", + encode(message: SubscribedToErrorsEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.feesPaid !== undefined) { + Coin.encode(message.feesPaid, writer.uint32(26).fork()).ldelim(); + } + if (message.subscriptionValidTill !== BigInt(0)) { + writer.uint32(32).int64(message.subscriptionValidTill); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SubscribedToErrorsEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribedToErrorsEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.feesPaid = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.subscriptionValidTill = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SubscribedToErrorsEvent { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + feesPaid: isSet(object.feesPaid) ? Coin.fromJSON(object.feesPaid) : undefined, + subscriptionValidTill: isSet(object.subscriptionValidTill) ? BigInt(object.subscriptionValidTill.toString()) : BigInt(0) + }; + }, + toJSON(message: SubscribedToErrorsEvent): JsonSafe { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.feesPaid !== undefined && (obj.feesPaid = message.feesPaid ? Coin.toJSON(message.feesPaid) : undefined); + message.subscriptionValidTill !== undefined && (obj.subscriptionValidTill = (message.subscriptionValidTill || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): SubscribedToErrorsEvent { + const message = createBaseSubscribedToErrorsEvent(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.feesPaid = object.feesPaid !== undefined && object.feesPaid !== null ? Coin.fromPartial(object.feesPaid) : undefined; + message.subscriptionValidTill = object.subscriptionValidTill !== undefined && object.subscriptionValidTill !== null ? BigInt(object.subscriptionValidTill.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SubscribedToErrorsEventAmino): SubscribedToErrorsEvent { + const message = createBaseSubscribedToErrorsEvent(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.fees_paid !== undefined && object.fees_paid !== null) { + message.feesPaid = Coin.fromAmino(object.fees_paid); + } + if (object.subscription_valid_till !== undefined && object.subscription_valid_till !== null) { + message.subscriptionValidTill = BigInt(object.subscription_valid_till); + } + return message; + }, + toAmino(message: SubscribedToErrorsEvent): SubscribedToErrorsEventAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.fees_paid = message.feesPaid ? Coin.toAmino(message.feesPaid) : undefined; + obj.subscription_valid_till = message.subscriptionValidTill !== BigInt(0) ? message.subscriptionValidTill.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SubscribedToErrorsEventAminoMsg): SubscribedToErrorsEvent { + return SubscribedToErrorsEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SubscribedToErrorsEventProtoMsg): SubscribedToErrorsEvent { + return SubscribedToErrorsEvent.decode(message.value); + }, + toProto(message: SubscribedToErrorsEvent): Uint8Array { + return SubscribedToErrorsEvent.encode(message).finish(); + }, + toProtoMsg(message: SubscribedToErrorsEvent): SubscribedToErrorsEventProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.SubscribedToErrorsEvent", + value: SubscribedToErrorsEvent.encode(message).finish() + }; + } +}; +function createBaseStoringErrorEvent(): StoringErrorEvent { + return { + error: SudoError.fromPartial({}), + deletionBlockHeight: BigInt(0) + }; +} +export const StoringErrorEvent = { + typeUrl: "/archway.cwerrors.v1.StoringErrorEvent", + encode(message: StoringErrorEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.error !== undefined) { + SudoError.encode(message.error, writer.uint32(10).fork()).ldelim(); + } + if (message.deletionBlockHeight !== BigInt(0)) { + writer.uint32(16).int64(message.deletionBlockHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoringErrorEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoringErrorEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = SudoError.decode(reader, reader.uint32()); + break; + case 2: + message.deletionBlockHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): StoringErrorEvent { + return { + error: isSet(object.error) ? SudoError.fromJSON(object.error) : undefined, + deletionBlockHeight: isSet(object.deletionBlockHeight) ? BigInt(object.deletionBlockHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: StoringErrorEvent): JsonSafe { + const obj: any = {}; + message.error !== undefined && (obj.error = message.error ? SudoError.toJSON(message.error) : undefined); + message.deletionBlockHeight !== undefined && (obj.deletionBlockHeight = (message.deletionBlockHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): StoringErrorEvent { + const message = createBaseStoringErrorEvent(); + message.error = object.error !== undefined && object.error !== null ? SudoError.fromPartial(object.error) : undefined; + message.deletionBlockHeight = object.deletionBlockHeight !== undefined && object.deletionBlockHeight !== null ? BigInt(object.deletionBlockHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: StoringErrorEventAmino): StoringErrorEvent { + const message = createBaseStoringErrorEvent(); + if (object.error !== undefined && object.error !== null) { + message.error = SudoError.fromAmino(object.error); + } + if (object.deletion_block_height !== undefined && object.deletion_block_height !== null) { + message.deletionBlockHeight = BigInt(object.deletion_block_height); + } + return message; + }, + toAmino(message: StoringErrorEvent): StoringErrorEventAmino { + const obj: any = {}; + obj.error = message.error ? SudoError.toAmino(message.error) : undefined; + obj.deletion_block_height = message.deletionBlockHeight !== BigInt(0) ? message.deletionBlockHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: StoringErrorEventAminoMsg): StoringErrorEvent { + return StoringErrorEvent.fromAmino(object.value); + }, + fromProtoMsg(message: StoringErrorEventProtoMsg): StoringErrorEvent { + return StoringErrorEvent.decode(message.value); + }, + toProto(message: StoringErrorEvent): Uint8Array { + return StoringErrorEvent.encode(message).finish(); + }, + toProtoMsg(message: StoringErrorEvent): StoringErrorEventProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.StoringErrorEvent", + value: StoringErrorEvent.encode(message).finish() + }; + } +}; +function createBaseSudoErrorCallbackFailedEvent(): SudoErrorCallbackFailedEvent { + return { + error: SudoError.fromPartial({}), + callbackErrorMessage: "" + }; +} +export const SudoErrorCallbackFailedEvent = { + typeUrl: "/archway.cwerrors.v1.SudoErrorCallbackFailedEvent", + encode(message: SudoErrorCallbackFailedEvent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.error !== undefined) { + SudoError.encode(message.error, writer.uint32(10).fork()).ldelim(); + } + if (message.callbackErrorMessage !== "") { + writer.uint32(18).string(message.callbackErrorMessage); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SudoErrorCallbackFailedEvent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoErrorCallbackFailedEvent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = SudoError.decode(reader, reader.uint32()); + break; + case 2: + message.callbackErrorMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SudoErrorCallbackFailedEvent { + return { + error: isSet(object.error) ? SudoError.fromJSON(object.error) : undefined, + callbackErrorMessage: isSet(object.callbackErrorMessage) ? String(object.callbackErrorMessage) : "" + }; + }, + toJSON(message: SudoErrorCallbackFailedEvent): JsonSafe { + const obj: any = {}; + message.error !== undefined && (obj.error = message.error ? SudoError.toJSON(message.error) : undefined); + message.callbackErrorMessage !== undefined && (obj.callbackErrorMessage = message.callbackErrorMessage); + return obj; + }, + fromPartial(object: Partial): SudoErrorCallbackFailedEvent { + const message = createBaseSudoErrorCallbackFailedEvent(); + message.error = object.error !== undefined && object.error !== null ? SudoError.fromPartial(object.error) : undefined; + message.callbackErrorMessage = object.callbackErrorMessage ?? ""; + return message; + }, + fromAmino(object: SudoErrorCallbackFailedEventAmino): SudoErrorCallbackFailedEvent { + const message = createBaseSudoErrorCallbackFailedEvent(); + if (object.error !== undefined && object.error !== null) { + message.error = SudoError.fromAmino(object.error); + } + if (object.callback_error_message !== undefined && object.callback_error_message !== null) { + message.callbackErrorMessage = object.callback_error_message; + } + return message; + }, + toAmino(message: SudoErrorCallbackFailedEvent): SudoErrorCallbackFailedEventAmino { + const obj: any = {}; + obj.error = message.error ? SudoError.toAmino(message.error) : undefined; + obj.callback_error_message = message.callbackErrorMessage === "" ? undefined : message.callbackErrorMessage; + return obj; + }, + fromAminoMsg(object: SudoErrorCallbackFailedEventAminoMsg): SudoErrorCallbackFailedEvent { + return SudoErrorCallbackFailedEvent.fromAmino(object.value); + }, + fromProtoMsg(message: SudoErrorCallbackFailedEventProtoMsg): SudoErrorCallbackFailedEvent { + return SudoErrorCallbackFailedEvent.decode(message.value); + }, + toProto(message: SudoErrorCallbackFailedEvent): Uint8Array { + return SudoErrorCallbackFailedEvent.encode(message).finish(); + }, + toProtoMsg(message: SudoErrorCallbackFailedEvent): SudoErrorCallbackFailedEventProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.SudoErrorCallbackFailedEvent", + value: SudoErrorCallbackFailedEvent.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/genesis.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/genesis.ts new file mode 100644 index 0000000..64c6470 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/genesis.ts @@ -0,0 +1,121 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./params"; +import { SudoError, SudoErrorAmino } from "./cwerrors"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** GenesisState defines the cwerrors module's genesis state. */ +export interface GenesisState { + /** params defines all the module parameters. */ + params: Params; + /** errors defines all the sudo errors currently registered. */ + errors: SudoError[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/archway.cwerrors.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the cwerrors module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the module parameters. */ + params?: ParamsAmino; + /** errors defines all the sudo errors currently registered. */ + errors?: SudoErrorAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/archway.cwerrors.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + errors: [] + }; +} +export const GenesisState = { + typeUrl: "/archway.cwerrors.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.errors) { + SudoError.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.errors.push(SudoError.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + errors: Array.isArray(object?.errors) ? object.errors.map((e: any) => SudoError.fromJSON(e)) : [] + }; + }, + toJSON(message: GenesisState): JsonSafe { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + if (message.errors) { + obj.errors = message.errors.map(e => e ? SudoError.toJSON(e) : undefined); + } else { + obj.errors = []; + } + return obj; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.errors = object.errors?.map(e => SudoError.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.errors = object.errors?.map(e => SudoError.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.errors) { + obj.errors = message.errors.map(e => e ? SudoError.toAmino(e) : undefined); + } else { + obj.errors = message.errors; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/params.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/params.ts new file mode 100644 index 0000000..84ff438 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/params.ts @@ -0,0 +1,132 @@ +/* eslint-disable */ +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** Params defines the set of parameters for the cwerrors module. */ +export interface Params { + /** error_stored_time is the block height until which error is stored */ + errorStoredTime: bigint; + /** subsciption_fee is the fee required to subscribe to error callbacks */ + subscriptionFee: Coin; + /** subscription_period is the period for which the subscription is valid */ + subscriptionPeriod: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/archway.cwerrors.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of parameters for the cwerrors module. */ +export interface ParamsAmino { + /** error_stored_time is the block height until which error is stored */ + error_stored_time?: string; + /** subsciption_fee is the fee required to subscribe to error callbacks */ + subscription_fee?: CoinAmino; + /** subscription_period is the period for which the subscription is valid */ + subscription_period?: string; +} +export interface ParamsAminoMsg { + type: "/archway.cwerrors.v1.Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + errorStoredTime: BigInt(0), + subscriptionFee: Coin.fromPartial({}), + subscriptionPeriod: BigInt(0) + }; +} +export const Params = { + typeUrl: "/archway.cwerrors.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.errorStoredTime !== BigInt(0)) { + writer.uint32(8).int64(message.errorStoredTime); + } + if (message.subscriptionFee !== undefined) { + Coin.encode(message.subscriptionFee, writer.uint32(18).fork()).ldelim(); + } + if (message.subscriptionPeriod !== BigInt(0)) { + writer.uint32(24).int64(message.subscriptionPeriod); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errorStoredTime = reader.int64(); + break; + case 2: + message.subscriptionFee = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.subscriptionPeriod = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + errorStoredTime: isSet(object.errorStoredTime) ? BigInt(object.errorStoredTime.toString()) : BigInt(0), + subscriptionFee: isSet(object.subscriptionFee) ? Coin.fromJSON(object.subscriptionFee) : undefined, + subscriptionPeriod: isSet(object.subscriptionPeriod) ? BigInt(object.subscriptionPeriod.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): JsonSafe { + const obj: any = {}; + message.errorStoredTime !== undefined && (obj.errorStoredTime = (message.errorStoredTime || BigInt(0)).toString()); + message.subscriptionFee !== undefined && (obj.subscriptionFee = message.subscriptionFee ? Coin.toJSON(message.subscriptionFee) : undefined); + message.subscriptionPeriod !== undefined && (obj.subscriptionPeriod = (message.subscriptionPeriod || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.errorStoredTime = object.errorStoredTime !== undefined && object.errorStoredTime !== null ? BigInt(object.errorStoredTime.toString()) : BigInt(0); + message.subscriptionFee = object.subscriptionFee !== undefined && object.subscriptionFee !== null ? Coin.fromPartial(object.subscriptionFee) : undefined; + message.subscriptionPeriod = object.subscriptionPeriod !== undefined && object.subscriptionPeriod !== null ? BigInt(object.subscriptionPeriod.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.error_stored_time !== undefined && object.error_stored_time !== null) { + message.errorStoredTime = BigInt(object.error_stored_time); + } + if (object.subscription_fee !== undefined && object.subscription_fee !== null) { + message.subscriptionFee = Coin.fromAmino(object.subscription_fee); + } + if (object.subscription_period !== undefined && object.subscription_period !== null) { + message.subscriptionPeriod = BigInt(object.subscription_period); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.error_stored_time = message.errorStoredTime !== BigInt(0) ? message.errorStoredTime.toString() : undefined; + obj.subscription_fee = message.subscriptionFee ? Coin.toAmino(message.subscriptionFee) : undefined; + obj.subscription_period = message.subscriptionPeriod !== BigInt(0) ? message.subscriptionPeriod.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/query.rpc.Query.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/query.rpc.Query.ts new file mode 100644 index 0000000..8b5d36d --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/query.rpc.Query.ts @@ -0,0 +1,53 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryErrorsRequest, QueryErrorsResponse, QueryIsSubscribedRequest, QueryIsSubscribedResponse } from "./query"; +/** Query service for the cwerrors module. */ +export interface Query { + /** Params queries all the module parameters. */ + params(request?: QueryParamsRequest): Promise; + /** Errors queries all the errors for a given contract. */ + errors(request: QueryErrorsRequest): Promise; + /** IsSubscribed queries if a contract is subscribed to sudo error callbacks. */ + isSubscribed(request: QueryIsSubscribedRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.errors = this.errors.bind(this); + this.isSubscribed = this.isSubscribed.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("archway.cwerrors.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + errors(request: QueryErrorsRequest): Promise { + const data = QueryErrorsRequest.encode(request).finish(); + const promise = this.rpc.request("archway.cwerrors.v1.Query", "Errors", data); + return promise.then(data => QueryErrorsResponse.decode(new BinaryReader(data))); + } + isSubscribed(request: QueryIsSubscribedRequest): Promise { + const data = QueryIsSubscribedRequest.encode(request).finish(); + const promise = this.rpc.request("archway.cwerrors.v1.Query", "IsSubscribed", data); + return promise.then(data => QueryIsSubscribedResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + errors(request: QueryErrorsRequest): Promise { + return queryService.errors(request); + }, + isSubscribed(request: QueryIsSubscribedRequest): Promise { + return queryService.isSubscribed(request); + } + }; +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/query.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/query.ts new file mode 100644 index 0000000..46294c8 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/query.ts @@ -0,0 +1,560 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./params"; +import { SudoError, SudoErrorAmino } from "./cwerrors"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { JsonSafe } from "../../../json-safe"; +import { isSet } from "../../../helpers"; +/** QueryParamsRequest is the request for Query.Params. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/archway.cwerrors.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request for Query.Params. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/archway.cwerrors.v1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is the response for Query.Params. */ +export interface QueryParamsResponse { + /** params defines all the module parameters. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/archway.cwerrors.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response for Query.Params. */ +export interface QueryParamsResponseAmino { + /** params defines all the module parameters. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/archway.cwerrors.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryErrorsRequest is the request for Query.Errors. */ +export interface QueryErrorsRequest { + /** contract_address is the address of the contract whose errors to query for */ + contractAddress: string; +} +export interface QueryErrorsRequestProtoMsg { + typeUrl: "/archway.cwerrors.v1.QueryErrorsRequest"; + value: Uint8Array; +} +/** QueryErrorsRequest is the request for Query.Errors. */ +export interface QueryErrorsRequestAmino { + /** contract_address is the address of the contract whose errors to query for */ + contract_address?: string; +} +export interface QueryErrorsRequestAminoMsg { + type: "/archway.cwerrors.v1.QueryErrorsRequest"; + value: QueryErrorsRequestAmino; +} +/** QueryErrorsResponse is the response for Query.Errors. */ +export interface QueryErrorsResponse { + /** errors defines all the contract errors which will be returned */ + errors: SudoError[]; +} +export interface QueryErrorsResponseProtoMsg { + typeUrl: "/archway.cwerrors.v1.QueryErrorsResponse"; + value: Uint8Array; +} +/** QueryErrorsResponse is the response for Query.Errors. */ +export interface QueryErrorsResponseAmino { + /** errors defines all the contract errors which will be returned */ + errors?: SudoErrorAmino[]; +} +export interface QueryErrorsResponseAminoMsg { + type: "/archway.cwerrors.v1.QueryErrorsResponse"; + value: QueryErrorsResponseAmino; +} +/** QueryIsSubscribedRequest is the request for Query.IsSubscribed. */ +export interface QueryIsSubscribedRequest { + /** contract_address is the address of the contract to query if subscribed */ + contractAddress: string; +} +export interface QueryIsSubscribedRequestProtoMsg { + typeUrl: "/archway.cwerrors.v1.QueryIsSubscribedRequest"; + value: Uint8Array; +} +/** QueryIsSubscribedRequest is the request for Query.IsSubscribed. */ +export interface QueryIsSubscribedRequestAmino { + /** contract_address is the address of the contract to query if subscribed */ + contract_address?: string; +} +export interface QueryIsSubscribedRequestAminoMsg { + type: "/archway.cwerrors.v1.QueryIsSubscribedRequest"; + value: QueryIsSubscribedRequestAmino; +} +/** QueryIsSubscribedResponse is the response for Query.IsSubscribed. */ +export interface QueryIsSubscribedResponse { + /** subscribed defines if the contract is subscribed to sudo error callbacks */ + subscribed: boolean; + /** + * subscription_valid_till defines the block height till which the + * subscription is valid + */ + subscriptionValidTill: bigint; +} +export interface QueryIsSubscribedResponseProtoMsg { + typeUrl: "/archway.cwerrors.v1.QueryIsSubscribedResponse"; + value: Uint8Array; +} +/** QueryIsSubscribedResponse is the response for Query.IsSubscribed. */ +export interface QueryIsSubscribedResponseAmino { + /** subscribed defines if the contract is subscribed to sudo error callbacks */ + subscribed?: boolean; + /** + * subscription_valid_till defines the block height till which the + * subscription is valid + */ + subscription_valid_till?: string; +} +export interface QueryIsSubscribedResponseAminoMsg { + type: "/archway.cwerrors.v1.QueryIsSubscribedResponse"; + value: QueryIsSubscribedResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/archway.cwerrors.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/archway.cwerrors.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryParamsResponse): JsonSafe { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryErrorsRequest(): QueryErrorsRequest { + return { + contractAddress: "" + }; +} +export const QueryErrorsRequest = { + typeUrl: "/archway.cwerrors.v1.QueryErrorsRequest", + encode(message: QueryErrorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryErrorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryErrorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryErrorsRequest { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + toJSON(message: QueryErrorsRequest): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + fromPartial(object: Partial): QueryErrorsRequest { + const message = createBaseQueryErrorsRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryErrorsRequestAmino): QueryErrorsRequest { + const message = createBaseQueryErrorsRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryErrorsRequest): QueryErrorsRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryErrorsRequestAminoMsg): QueryErrorsRequest { + return QueryErrorsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryErrorsRequestProtoMsg): QueryErrorsRequest { + return QueryErrorsRequest.decode(message.value); + }, + toProto(message: QueryErrorsRequest): Uint8Array { + return QueryErrorsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryErrorsRequest): QueryErrorsRequestProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.QueryErrorsRequest", + value: QueryErrorsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryErrorsResponse(): QueryErrorsResponse { + return { + errors: [] + }; +} +export const QueryErrorsResponse = { + typeUrl: "/archway.cwerrors.v1.QueryErrorsResponse", + encode(message: QueryErrorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.errors) { + SudoError.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryErrorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryErrorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errors.push(SudoError.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryErrorsResponse { + return { + errors: Array.isArray(object?.errors) ? object.errors.map((e: any) => SudoError.fromJSON(e)) : [] + }; + }, + toJSON(message: QueryErrorsResponse): JsonSafe { + const obj: any = {}; + if (message.errors) { + obj.errors = message.errors.map(e => e ? SudoError.toJSON(e) : undefined); + } else { + obj.errors = []; + } + return obj; + }, + fromPartial(object: Partial): QueryErrorsResponse { + const message = createBaseQueryErrorsResponse(); + message.errors = object.errors?.map(e => SudoError.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryErrorsResponseAmino): QueryErrorsResponse { + const message = createBaseQueryErrorsResponse(); + message.errors = object.errors?.map(e => SudoError.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryErrorsResponse): QueryErrorsResponseAmino { + const obj: any = {}; + if (message.errors) { + obj.errors = message.errors.map(e => e ? SudoError.toAmino(e) : undefined); + } else { + obj.errors = message.errors; + } + return obj; + }, + fromAminoMsg(object: QueryErrorsResponseAminoMsg): QueryErrorsResponse { + return QueryErrorsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryErrorsResponseProtoMsg): QueryErrorsResponse { + return QueryErrorsResponse.decode(message.value); + }, + toProto(message: QueryErrorsResponse): Uint8Array { + return QueryErrorsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryErrorsResponse): QueryErrorsResponseProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.QueryErrorsResponse", + value: QueryErrorsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryIsSubscribedRequest(): QueryIsSubscribedRequest { + return { + contractAddress: "" + }; +} +export const QueryIsSubscribedRequest = { + typeUrl: "/archway.cwerrors.v1.QueryIsSubscribedRequest", + encode(message: QueryIsSubscribedRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryIsSubscribedRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIsSubscribedRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryIsSubscribedRequest { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + toJSON(message: QueryIsSubscribedRequest): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + fromPartial(object: Partial): QueryIsSubscribedRequest { + const message = createBaseQueryIsSubscribedRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: QueryIsSubscribedRequestAmino): QueryIsSubscribedRequest { + const message = createBaseQueryIsSubscribedRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: QueryIsSubscribedRequest): QueryIsSubscribedRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: QueryIsSubscribedRequestAminoMsg): QueryIsSubscribedRequest { + return QueryIsSubscribedRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIsSubscribedRequestProtoMsg): QueryIsSubscribedRequest { + return QueryIsSubscribedRequest.decode(message.value); + }, + toProto(message: QueryIsSubscribedRequest): Uint8Array { + return QueryIsSubscribedRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryIsSubscribedRequest): QueryIsSubscribedRequestProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.QueryIsSubscribedRequest", + value: QueryIsSubscribedRequest.encode(message).finish() + }; + } +}; +function createBaseQueryIsSubscribedResponse(): QueryIsSubscribedResponse { + return { + subscribed: false, + subscriptionValidTill: BigInt(0) + }; +} +export const QueryIsSubscribedResponse = { + typeUrl: "/archway.cwerrors.v1.QueryIsSubscribedResponse", + encode(message: QueryIsSubscribedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subscribed === true) { + writer.uint32(8).bool(message.subscribed); + } + if (message.subscriptionValidTill !== BigInt(0)) { + writer.uint32(16).int64(message.subscriptionValidTill); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryIsSubscribedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryIsSubscribedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscribed = reader.bool(); + break; + case 2: + message.subscriptionValidTill = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryIsSubscribedResponse { + return { + subscribed: isSet(object.subscribed) ? Boolean(object.subscribed) : false, + subscriptionValidTill: isSet(object.subscriptionValidTill) ? BigInt(object.subscriptionValidTill.toString()) : BigInt(0) + }; + }, + toJSON(message: QueryIsSubscribedResponse): JsonSafe { + const obj: any = {}; + message.subscribed !== undefined && (obj.subscribed = message.subscribed); + message.subscriptionValidTill !== undefined && (obj.subscriptionValidTill = (message.subscriptionValidTill || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): QueryIsSubscribedResponse { + const message = createBaseQueryIsSubscribedResponse(); + message.subscribed = object.subscribed ?? false; + message.subscriptionValidTill = object.subscriptionValidTill !== undefined && object.subscriptionValidTill !== null ? BigInt(object.subscriptionValidTill.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryIsSubscribedResponseAmino): QueryIsSubscribedResponse { + const message = createBaseQueryIsSubscribedResponse(); + if (object.subscribed !== undefined && object.subscribed !== null) { + message.subscribed = object.subscribed; + } + if (object.subscription_valid_till !== undefined && object.subscription_valid_till !== null) { + message.subscriptionValidTill = BigInt(object.subscription_valid_till); + } + return message; + }, + toAmino(message: QueryIsSubscribedResponse): QueryIsSubscribedResponseAmino { + const obj: any = {}; + obj.subscribed = message.subscribed === false ? undefined : message.subscribed; + obj.subscription_valid_till = message.subscriptionValidTill !== BigInt(0) ? message.subscriptionValidTill.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryIsSubscribedResponseAminoMsg): QueryIsSubscribedResponse { + return QueryIsSubscribedResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryIsSubscribedResponseProtoMsg): QueryIsSubscribedResponse { + return QueryIsSubscribedResponse.decode(message.value); + }, + toProto(message: QueryIsSubscribedResponse): Uint8Array { + return QueryIsSubscribedResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryIsSubscribedResponse): QueryIsSubscribedResponseProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.QueryIsSubscribedResponse", + value: QueryIsSubscribedResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/tx.amino.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.amino.ts new file mode 100644 index 0000000..db1e34b --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.amino.ts @@ -0,0 +1,14 @@ +/* eslint-disable */ +import { MsgUpdateParams, MsgSubscribeToError } from "./tx"; +export const AminoConverter = { + "/archway.cwerrors.v1.MsgUpdateParams": { + aminoType: "/archway.cwerrors.v1.MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/archway.cwerrors.v1.MsgSubscribeToError": { + aminoType: "/archway.cwerrors.v1.MsgSubscribeToError", + toAmino: MsgSubscribeToError.toAmino, + fromAmino: MsgSubscribeToError.fromAmino + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/tx.registry.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.registry.ts new file mode 100644 index 0000000..4a908f5 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.registry.ts @@ -0,0 +1,82 @@ +/* eslint-disable */ +import { TelescopeGeneratedType } from "../../../types"; +import { Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams, MsgSubscribeToError } from "./tx"; +export const registry: ReadonlyArray<[string, TelescopeGeneratedType]> = [["/archway.cwerrors.v1.MsgUpdateParams", MsgUpdateParams], ["/archway.cwerrors.v1.MsgSubscribeToError", MsgSubscribeToError]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + subscribeToError(value: MsgSubscribeToError) { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + value: MsgSubscribeToError.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + value + }; + }, + subscribeToError(value: MsgSubscribeToError) { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + value + }; + } + }, + toJSON: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + }, + subscribeToError(value: MsgSubscribeToError) { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + value: MsgSubscribeToError.toJSON(value) + }; + } + }, + fromJSON: { + updateParams(value: any) { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + }, + subscribeToError(value: any) { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + value: MsgSubscribeToError.fromJSON(value) + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + subscribeToError(value: MsgSubscribeToError) { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + value: MsgSubscribeToError.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/tx.rpc.msg.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..437357a --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.rpc.msg.ts @@ -0,0 +1,35 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse, MsgSubscribeToError, MsgSubscribeToErrorResponse } from "./tx"; +/** Msg defines the cwerrors Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/cwerrors + * module parameters. The authority is defined in the keeper. + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * SubscribeToError defines an operation which will register a contract for a + * sudo callback on errors + */ + subscribeToError(request: MsgSubscribeToError): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + this.subscribeToError = this.subscribeToError.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("archway.cwerrors.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + subscribeToError(request: MsgSubscribeToError): Promise { + const data = MsgSubscribeToError.encode(request).finish(); + const promise = this.rpc.request("archway.cwerrors.v1.Msg", "SubscribeToError", data); + return promise.then(data => MsgSubscribeToErrorResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwerrors/v1/tx.ts b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.ts new file mode 100644 index 0000000..a2b43d4 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwerrors/v1/tx.ts @@ -0,0 +1,446 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./params"; +import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** + * authority is the address that controls the module (defaults to x/gov unless + * overwritten). + */ + authority: string; + /** + * params defines the x/cwerrors parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** + * authority is the address that controls the module (defaults to x/gov unless + * overwritten). + */ + authority?: string; + /** + * params defines the x/cwerrors parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "/archway.cwerrors.v1.MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/archway.cwerrors.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgSubscribeToError is the Msg/SubscribeToError request type. */ +export interface MsgSubscribeToError { + /** + * sender is the address of who is registering the contarcts for callback on + * error + */ + sender: string; + /** contract is the address of the contract that will be called on error */ + contractAddress: string; + /** + * fee is the subscription fee for the feature (current no fee is charged for + * this feature) + */ + fee: Coin; +} +export interface MsgSubscribeToErrorProtoMsg { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError"; + value: Uint8Array; +} +/** MsgSubscribeToError is the Msg/SubscribeToError request type. */ +export interface MsgSubscribeToErrorAmino { + /** + * sender is the address of who is registering the contarcts for callback on + * error + */ + sender?: string; + /** contract is the address of the contract that will be called on error */ + contract_address?: string; + /** + * fee is the subscription fee for the feature (current no fee is charged for + * this feature) + */ + fee?: CoinAmino; +} +export interface MsgSubscribeToErrorAminoMsg { + type: "/archway.cwerrors.v1.MsgSubscribeToError"; + value: MsgSubscribeToErrorAmino; +} +/** + * MsgSubscribeToErrorResponse defines the response structure for executing a + * MsgSubscribeToError message. + */ +export interface MsgSubscribeToErrorResponse { + /** + * subscription_valid_till is the block height till which the subscription is + * valid + */ + subscriptionValidTill: bigint; +} +export interface MsgSubscribeToErrorResponseProtoMsg { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToErrorResponse"; + value: Uint8Array; +} +/** + * MsgSubscribeToErrorResponse defines the response structure for executing a + * MsgSubscribeToError message. + */ +export interface MsgSubscribeToErrorResponseAmino { + /** + * subscription_valid_till is the block height till which the subscription is + * valid + */ + subscription_valid_till?: string; +} +export interface MsgSubscribeToErrorResponseAminoMsg { + type: "/archway.cwerrors.v1.MsgSubscribeToErrorResponse"; + value: MsgSubscribeToErrorResponseAmino; +} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): JsonSafe { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubscribeToError(): MsgSubscribeToError { + return { + sender: "", + contractAddress: "", + fee: Coin.fromPartial({}) + }; +} +export const MsgSubscribeToError = { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + encode(message: MsgSubscribeToError, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contractAddress !== "") { + writer.uint32(18).string(message.contractAddress); + } + if (message.fee !== undefined) { + Coin.encode(message.fee, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubscribeToError { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubscribeToError(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contractAddress = reader.string(); + break; + case 3: + message.fee = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSubscribeToError { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + fee: isSet(object.fee) ? Coin.fromJSON(object.fee) : undefined + }; + }, + toJSON(message: MsgSubscribeToError): JsonSafe { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.fee !== undefined && (obj.fee = message.fee ? Coin.toJSON(message.fee) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgSubscribeToError { + const message = createBaseMsgSubscribeToError(); + message.sender = object.sender ?? ""; + message.contractAddress = object.contractAddress ?? ""; + message.fee = object.fee !== undefined && object.fee !== null ? Coin.fromPartial(object.fee) : undefined; + return message; + }, + fromAmino(object: MsgSubscribeToErrorAmino): MsgSubscribeToError { + const message = createBaseMsgSubscribeToError(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.fee !== undefined && object.fee !== null) { + message.fee = Coin.fromAmino(object.fee); + } + return message; + }, + toAmino(message: MsgSubscribeToError): MsgSubscribeToErrorAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.fee = message.fee ? Coin.toAmino(message.fee) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubscribeToErrorAminoMsg): MsgSubscribeToError { + return MsgSubscribeToError.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubscribeToErrorProtoMsg): MsgSubscribeToError { + return MsgSubscribeToError.decode(message.value); + }, + toProto(message: MsgSubscribeToError): Uint8Array { + return MsgSubscribeToError.encode(message).finish(); + }, + toProtoMsg(message: MsgSubscribeToError): MsgSubscribeToErrorProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToError", + value: MsgSubscribeToError.encode(message).finish() + }; + } +}; +function createBaseMsgSubscribeToErrorResponse(): MsgSubscribeToErrorResponse { + return { + subscriptionValidTill: BigInt(0) + }; +} +export const MsgSubscribeToErrorResponse = { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToErrorResponse", + encode(message: MsgSubscribeToErrorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subscriptionValidTill !== BigInt(0)) { + writer.uint32(8).int64(message.subscriptionValidTill); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubscribeToErrorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubscribeToErrorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subscriptionValidTill = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSubscribeToErrorResponse { + return { + subscriptionValidTill: isSet(object.subscriptionValidTill) ? BigInt(object.subscriptionValidTill.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSubscribeToErrorResponse): JsonSafe { + const obj: any = {}; + message.subscriptionValidTill !== undefined && (obj.subscriptionValidTill = (message.subscriptionValidTill || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgSubscribeToErrorResponse { + const message = createBaseMsgSubscribeToErrorResponse(); + message.subscriptionValidTill = object.subscriptionValidTill !== undefined && object.subscriptionValidTill !== null ? BigInt(object.subscriptionValidTill.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubscribeToErrorResponseAmino): MsgSubscribeToErrorResponse { + const message = createBaseMsgSubscribeToErrorResponse(); + if (object.subscription_valid_till !== undefined && object.subscription_valid_till !== null) { + message.subscriptionValidTill = BigInt(object.subscription_valid_till); + } + return message; + }, + toAmino(message: MsgSubscribeToErrorResponse): MsgSubscribeToErrorResponseAmino { + const obj: any = {}; + obj.subscription_valid_till = message.subscriptionValidTill !== BigInt(0) ? message.subscriptionValidTill.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubscribeToErrorResponseAminoMsg): MsgSubscribeToErrorResponse { + return MsgSubscribeToErrorResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSubscribeToErrorResponseProtoMsg): MsgSubscribeToErrorResponse { + return MsgSubscribeToErrorResponse.decode(message.value); + }, + toProto(message: MsgSubscribeToErrorResponse): Uint8Array { + return MsgSubscribeToErrorResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubscribeToErrorResponse): MsgSubscribeToErrorResponseProtoMsg { + return { + typeUrl: "/archway.cwerrors.v1.MsgSubscribeToErrorResponse", + value: MsgSubscribeToErrorResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.amino.ts b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.amino.ts new file mode 100644 index 0000000..edbec1f --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.amino.ts @@ -0,0 +1,14 @@ +/* eslint-disable */ +import { MsgRegisterAsGranter, MsgUnregisterAsGranter } from "./cwfees"; +export const AminoConverter = { + "/archway.cwfees.v1.MsgRegisterAsGranter": { + aminoType: "/archway.cwfees.v1.MsgRegisterAsGranter", + toAmino: MsgRegisterAsGranter.toAmino, + fromAmino: MsgRegisterAsGranter.fromAmino + }, + "/archway.cwfees.v1.MsgUnregisterAsGranter": { + aminoType: "/archway.cwfees.v1.MsgUnregisterAsGranter", + toAmino: MsgUnregisterAsGranter.toAmino, + fromAmino: MsgUnregisterAsGranter.fromAmino + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.registry.ts b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.registry.ts new file mode 100644 index 0000000..ac0a819 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.registry.ts @@ -0,0 +1,82 @@ +/* eslint-disable */ +import { TelescopeGeneratedType } from "../../../types"; +import { Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterAsGranter, MsgUnregisterAsGranter } from "./cwfees"; +export const registry: ReadonlyArray<[string, TelescopeGeneratedType]> = [["/archway.cwfees.v1.MsgRegisterAsGranter", MsgRegisterAsGranter], ["/archway.cwfees.v1.MsgUnregisterAsGranter", MsgUnregisterAsGranter]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerAsGranter(value: MsgRegisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + value: MsgRegisterAsGranter.encode(value).finish() + }; + }, + unregisterAsGranter(value: MsgUnregisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + value: MsgUnregisterAsGranter.encode(value).finish() + }; + } + }, + withTypeUrl: { + registerAsGranter(value: MsgRegisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + value + }; + }, + unregisterAsGranter(value: MsgUnregisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + value + }; + } + }, + toJSON: { + registerAsGranter(value: MsgRegisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + value: MsgRegisterAsGranter.toJSON(value) + }; + }, + unregisterAsGranter(value: MsgUnregisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + value: MsgUnregisterAsGranter.toJSON(value) + }; + } + }, + fromJSON: { + registerAsGranter(value: any) { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + value: MsgRegisterAsGranter.fromJSON(value) + }; + }, + unregisterAsGranter(value: any) { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + value: MsgUnregisterAsGranter.fromJSON(value) + }; + } + }, + fromPartial: { + registerAsGranter(value: MsgRegisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + value: MsgRegisterAsGranter.fromPartial(value) + }; + }, + unregisterAsGranter(value: MsgUnregisterAsGranter) { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + value: MsgUnregisterAsGranter.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.Query.ts b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.Query.ts new file mode 100644 index 0000000..2e51239 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.Query.ts @@ -0,0 +1,30 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { IsGrantingContractRequest, IsGrantingContractResponse } from "./cwfees"; +export interface Query { + /** IsGrantingContract can be used to check if a contract is a granting contract. */ + isGrantingContract(request: IsGrantingContractRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.isGrantingContract = this.isGrantingContract.bind(this); + } + isGrantingContract(request: IsGrantingContractRequest): Promise { + const data = IsGrantingContractRequest.encode(request).finish(); + const promise = this.rpc.request("archway.cwfees.v1.Query", "IsGrantingContract", data); + return promise.then(data => IsGrantingContractResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + isGrantingContract(request: IsGrantingContractRequest): Promise { + return queryService.isGrantingContract(request); + } + }; +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.msg.ts b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.msg.ts new file mode 100644 index 0000000..d158c3f --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.rpc.msg.ts @@ -0,0 +1,28 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { MsgRegisterAsGranter, MsgRegisterAsGranterResponse, MsgUnregisterAsGranter, MsgUnregisterAsGranterResponse } from "./cwfees"; +export interface Msg { + /** RegisterAsGranter allows a cosmwasm contract to register itself as a fee granter. */ + registerAsGranter(request: MsgRegisterAsGranter): Promise; + /** UnregisterAsGranter allows a cosmwasm contract to unregister itself as a fee granter. */ + unregisterAsGranter(request: MsgUnregisterAsGranter): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.registerAsGranter = this.registerAsGranter.bind(this); + this.unregisterAsGranter = this.unregisterAsGranter.bind(this); + } + registerAsGranter(request: MsgRegisterAsGranter): Promise { + const data = MsgRegisterAsGranter.encode(request).finish(); + const promise = this.rpc.request("archway.cwfees.v1.Msg", "RegisterAsGranter", data); + return promise.then(data => MsgRegisterAsGranterResponse.decode(new BinaryReader(data))); + } + unregisterAsGranter(request: MsgUnregisterAsGranter): Promise { + const data = MsgUnregisterAsGranter.encode(request).finish(); + const promise = this.rpc.request("archway.cwfees.v1.Msg", "UnregisterAsGranter", data); + return promise.then(data => MsgUnregisterAsGranterResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.ts b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.ts new file mode 100644 index 0000000..a70a3f9 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwfees/v1/cwfees.ts @@ -0,0 +1,603 @@ +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** MsgRegisterAsGranter allows a contract to register itself as a fee granter. */ +export interface MsgRegisterAsGranter { + grantingContract: string; +} +export interface MsgRegisterAsGranterProtoMsg { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter"; + value: Uint8Array; +} +/** MsgRegisterAsGranter allows a contract to register itself as a fee granter. */ +export interface MsgRegisterAsGranterAmino { + granting_contract?: string; +} +export interface MsgRegisterAsGranterAminoMsg { + type: "/archway.cwfees.v1.MsgRegisterAsGranter"; + value: MsgRegisterAsGranterAmino; +} +/** MsgRegisterAsGranterResponse defines the response of RegisterAsGranter. */ +export interface MsgRegisterAsGranterResponse {} +export interface MsgRegisterAsGranterResponseProtoMsg { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranterResponse"; + value: Uint8Array; +} +/** MsgRegisterAsGranterResponse defines the response of RegisterAsGranter. */ +export interface MsgRegisterAsGranterResponseAmino {} +export interface MsgRegisterAsGranterResponseAminoMsg { + type: "/archway.cwfees.v1.MsgRegisterAsGranterResponse"; + value: MsgRegisterAsGranterResponseAmino; +} +/** MsgUnregisterAsGranter can be used by a cosmwasm contract to unregister itself as a fee granter. */ +export interface MsgUnregisterAsGranter { + grantingContract: string; +} +export interface MsgUnregisterAsGranterProtoMsg { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter"; + value: Uint8Array; +} +/** MsgUnregisterAsGranter can be used by a cosmwasm contract to unregister itself as a fee granter. */ +export interface MsgUnregisterAsGranterAmino { + granting_contract?: string; +} +export interface MsgUnregisterAsGranterAminoMsg { + type: "/archway.cwfees.v1.MsgUnregisterAsGranter"; + value: MsgUnregisterAsGranterAmino; +} +/** MsgUnregisterAsGranterResponse defines the response of UnregisterAsGranter. */ +export interface MsgUnregisterAsGranterResponse {} +export interface MsgUnregisterAsGranterResponseProtoMsg { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranterResponse"; + value: Uint8Array; +} +/** MsgUnregisterAsGranterResponse defines the response of UnregisterAsGranter. */ +export interface MsgUnregisterAsGranterResponseAmino {} +export interface MsgUnregisterAsGranterResponseAminoMsg { + type: "/archway.cwfees.v1.MsgUnregisterAsGranterResponse"; + value: MsgUnregisterAsGranterResponseAmino; +} +/** IsGrantingContract is the request type of IsGrantingContract RPC. */ +export interface IsGrantingContractRequest { + /** + * contract_address defines the address of the contract + * which we want to check if it is a granter or not. + */ + contractAddress: string; +} +export interface IsGrantingContractRequestProtoMsg { + typeUrl: "/archway.cwfees.v1.IsGrantingContractRequest"; + value: Uint8Array; +} +/** IsGrantingContract is the request type of IsGrantingContract RPC. */ +export interface IsGrantingContractRequestAmino { + /** + * contract_address defines the address of the contract + * which we want to check if it is a granter or not. + */ + contract_address?: string; +} +export interface IsGrantingContractRequestAminoMsg { + type: "/archway.cwfees.v1.IsGrantingContractRequest"; + value: IsGrantingContractRequestAmino; +} +/** IsGrantingContractResponse is the response type of IsGRantingContract RPC. */ +export interface IsGrantingContractResponse { + /** is_granting_contract report if the contract is a granter or not. */ + isGrantingContract: boolean; +} +export interface IsGrantingContractResponseProtoMsg { + typeUrl: "/archway.cwfees.v1.IsGrantingContractResponse"; + value: Uint8Array; +} +/** IsGrantingContractResponse is the response type of IsGRantingContract RPC. */ +export interface IsGrantingContractResponseAmino { + /** is_granting_contract report if the contract is a granter or not. */ + is_granting_contract?: boolean; +} +export interface IsGrantingContractResponseAminoMsg { + type: "/archway.cwfees.v1.IsGrantingContractResponse"; + value: IsGrantingContractResponseAmino; +} +/** GenesisState represents the genesis state of the cwfeesant module. */ +export interface GenesisState { + grantingContracts: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/archway.cwfees.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState represents the genesis state of the cwfeesant module. */ +export interface GenesisStateAmino { + granting_contracts?: string[]; +} +export interface GenesisStateAminoMsg { + type: "/archway.cwfees.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseMsgRegisterAsGranter(): MsgRegisterAsGranter { + return { + grantingContract: "" + }; +} +export const MsgRegisterAsGranter = { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + encode(message: MsgRegisterAsGranter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantingContract !== "") { + writer.uint32(10).string(message.grantingContract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterAsGranter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAsGranter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantingContract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgRegisterAsGranter { + return { + grantingContract: isSet(object.grantingContract) ? String(object.grantingContract) : "" + }; + }, + toJSON(message: MsgRegisterAsGranter): JsonSafe { + const obj: any = {}; + message.grantingContract !== undefined && (obj.grantingContract = message.grantingContract); + return obj; + }, + fromPartial(object: Partial): MsgRegisterAsGranter { + const message = createBaseMsgRegisterAsGranter(); + message.grantingContract = object.grantingContract ?? ""; + return message; + }, + fromAmino(object: MsgRegisterAsGranterAmino): MsgRegisterAsGranter { + const message = createBaseMsgRegisterAsGranter(); + if (object.granting_contract !== undefined && object.granting_contract !== null) { + message.grantingContract = object.granting_contract; + } + return message; + }, + toAmino(message: MsgRegisterAsGranter): MsgRegisterAsGranterAmino { + const obj: any = {}; + obj.granting_contract = message.grantingContract === "" ? undefined : message.grantingContract; + return obj; + }, + fromAminoMsg(object: MsgRegisterAsGranterAminoMsg): MsgRegisterAsGranter { + return MsgRegisterAsGranter.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterAsGranterProtoMsg): MsgRegisterAsGranter { + return MsgRegisterAsGranter.decode(message.value); + }, + toProto(message: MsgRegisterAsGranter): Uint8Array { + return MsgRegisterAsGranter.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterAsGranter): MsgRegisterAsGranterProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranter", + value: MsgRegisterAsGranter.encode(message).finish() + }; + } +}; +function createBaseMsgRegisterAsGranterResponse(): MsgRegisterAsGranterResponse { + return {}; +} +export const MsgRegisterAsGranterResponse = { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranterResponse", + encode(_: MsgRegisterAsGranterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterAsGranterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterAsGranterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgRegisterAsGranterResponse { + return {}; + }, + toJSON(_: MsgRegisterAsGranterResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgRegisterAsGranterResponse { + const message = createBaseMsgRegisterAsGranterResponse(); + return message; + }, + fromAmino(_: MsgRegisterAsGranterResponseAmino): MsgRegisterAsGranterResponse { + const message = createBaseMsgRegisterAsGranterResponse(); + return message; + }, + toAmino(_: MsgRegisterAsGranterResponse): MsgRegisterAsGranterResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterAsGranterResponseAminoMsg): MsgRegisterAsGranterResponse { + return MsgRegisterAsGranterResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterAsGranterResponseProtoMsg): MsgRegisterAsGranterResponse { + return MsgRegisterAsGranterResponse.decode(message.value); + }, + toProto(message: MsgRegisterAsGranterResponse): Uint8Array { + return MsgRegisterAsGranterResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterAsGranterResponse): MsgRegisterAsGranterResponseProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.MsgRegisterAsGranterResponse", + value: MsgRegisterAsGranterResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUnregisterAsGranter(): MsgUnregisterAsGranter { + return { + grantingContract: "" + }; +} +export const MsgUnregisterAsGranter = { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + encode(message: MsgUnregisterAsGranter, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.grantingContract !== "") { + writer.uint32(10).string(message.grantingContract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnregisterAsGranter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnregisterAsGranter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantingContract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUnregisterAsGranter { + return { + grantingContract: isSet(object.grantingContract) ? String(object.grantingContract) : "" + }; + }, + toJSON(message: MsgUnregisterAsGranter): JsonSafe { + const obj: any = {}; + message.grantingContract !== undefined && (obj.grantingContract = message.grantingContract); + return obj; + }, + fromPartial(object: Partial): MsgUnregisterAsGranter { + const message = createBaseMsgUnregisterAsGranter(); + message.grantingContract = object.grantingContract ?? ""; + return message; + }, + fromAmino(object: MsgUnregisterAsGranterAmino): MsgUnregisterAsGranter { + const message = createBaseMsgUnregisterAsGranter(); + if (object.granting_contract !== undefined && object.granting_contract !== null) { + message.grantingContract = object.granting_contract; + } + return message; + }, + toAmino(message: MsgUnregisterAsGranter): MsgUnregisterAsGranterAmino { + const obj: any = {}; + obj.granting_contract = message.grantingContract === "" ? undefined : message.grantingContract; + return obj; + }, + fromAminoMsg(object: MsgUnregisterAsGranterAminoMsg): MsgUnregisterAsGranter { + return MsgUnregisterAsGranter.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUnregisterAsGranterProtoMsg): MsgUnregisterAsGranter { + return MsgUnregisterAsGranter.decode(message.value); + }, + toProto(message: MsgUnregisterAsGranter): Uint8Array { + return MsgUnregisterAsGranter.encode(message).finish(); + }, + toProtoMsg(message: MsgUnregisterAsGranter): MsgUnregisterAsGranterProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranter", + value: MsgUnregisterAsGranter.encode(message).finish() + }; + } +}; +function createBaseMsgUnregisterAsGranterResponse(): MsgUnregisterAsGranterResponse { + return {}; +} +export const MsgUnregisterAsGranterResponse = { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranterResponse", + encode(_: MsgUnregisterAsGranterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnregisterAsGranterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnregisterAsGranterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUnregisterAsGranterResponse { + return {}; + }, + toJSON(_: MsgUnregisterAsGranterResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUnregisterAsGranterResponse { + const message = createBaseMsgUnregisterAsGranterResponse(); + return message; + }, + fromAmino(_: MsgUnregisterAsGranterResponseAmino): MsgUnregisterAsGranterResponse { + const message = createBaseMsgUnregisterAsGranterResponse(); + return message; + }, + toAmino(_: MsgUnregisterAsGranterResponse): MsgUnregisterAsGranterResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUnregisterAsGranterResponseAminoMsg): MsgUnregisterAsGranterResponse { + return MsgUnregisterAsGranterResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUnregisterAsGranterResponseProtoMsg): MsgUnregisterAsGranterResponse { + return MsgUnregisterAsGranterResponse.decode(message.value); + }, + toProto(message: MsgUnregisterAsGranterResponse): Uint8Array { + return MsgUnregisterAsGranterResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnregisterAsGranterResponse): MsgUnregisterAsGranterResponseProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.MsgUnregisterAsGranterResponse", + value: MsgUnregisterAsGranterResponse.encode(message).finish() + }; + } +}; +function createBaseIsGrantingContractRequest(): IsGrantingContractRequest { + return { + contractAddress: "" + }; +} +export const IsGrantingContractRequest = { + typeUrl: "/archway.cwfees.v1.IsGrantingContractRequest", + encode(message: IsGrantingContractRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IsGrantingContractRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIsGrantingContractRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IsGrantingContractRequest { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + toJSON(message: IsGrantingContractRequest): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + fromPartial(object: Partial): IsGrantingContractRequest { + const message = createBaseIsGrantingContractRequest(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + fromAmino(object: IsGrantingContractRequestAmino): IsGrantingContractRequest { + const message = createBaseIsGrantingContractRequest(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + return message; + }, + toAmino(message: IsGrantingContractRequest): IsGrantingContractRequestAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + return obj; + }, + fromAminoMsg(object: IsGrantingContractRequestAminoMsg): IsGrantingContractRequest { + return IsGrantingContractRequest.fromAmino(object.value); + }, + fromProtoMsg(message: IsGrantingContractRequestProtoMsg): IsGrantingContractRequest { + return IsGrantingContractRequest.decode(message.value); + }, + toProto(message: IsGrantingContractRequest): Uint8Array { + return IsGrantingContractRequest.encode(message).finish(); + }, + toProtoMsg(message: IsGrantingContractRequest): IsGrantingContractRequestProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.IsGrantingContractRequest", + value: IsGrantingContractRequest.encode(message).finish() + }; + } +}; +function createBaseIsGrantingContractResponse(): IsGrantingContractResponse { + return { + isGrantingContract: false + }; +} +export const IsGrantingContractResponse = { + typeUrl: "/archway.cwfees.v1.IsGrantingContractResponse", + encode(message: IsGrantingContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.isGrantingContract === true) { + writer.uint32(8).bool(message.isGrantingContract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IsGrantingContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIsGrantingContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.isGrantingContract = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IsGrantingContractResponse { + return { + isGrantingContract: isSet(object.isGrantingContract) ? Boolean(object.isGrantingContract) : false + }; + }, + toJSON(message: IsGrantingContractResponse): JsonSafe { + const obj: any = {}; + message.isGrantingContract !== undefined && (obj.isGrantingContract = message.isGrantingContract); + return obj; + }, + fromPartial(object: Partial): IsGrantingContractResponse { + const message = createBaseIsGrantingContractResponse(); + message.isGrantingContract = object.isGrantingContract ?? false; + return message; + }, + fromAmino(object: IsGrantingContractResponseAmino): IsGrantingContractResponse { + const message = createBaseIsGrantingContractResponse(); + if (object.is_granting_contract !== undefined && object.is_granting_contract !== null) { + message.isGrantingContract = object.is_granting_contract; + } + return message; + }, + toAmino(message: IsGrantingContractResponse): IsGrantingContractResponseAmino { + const obj: any = {}; + obj.is_granting_contract = message.isGrantingContract === false ? undefined : message.isGrantingContract; + return obj; + }, + fromAminoMsg(object: IsGrantingContractResponseAminoMsg): IsGrantingContractResponse { + return IsGrantingContractResponse.fromAmino(object.value); + }, + fromProtoMsg(message: IsGrantingContractResponseProtoMsg): IsGrantingContractResponse { + return IsGrantingContractResponse.decode(message.value); + }, + toProto(message: IsGrantingContractResponse): Uint8Array { + return IsGrantingContractResponse.encode(message).finish(); + }, + toProtoMsg(message: IsGrantingContractResponse): IsGrantingContractResponseProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.IsGrantingContractResponse", + value: IsGrantingContractResponse.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + grantingContracts: [] + }; +} +export const GenesisState = { + typeUrl: "/archway.cwfees.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grantingContracts) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grantingContracts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + return { + grantingContracts: Array.isArray(object?.grantingContracts) ? object.grantingContracts.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: GenesisState): JsonSafe { + const obj: any = {}; + if (message.grantingContracts) { + obj.grantingContracts = message.grantingContracts.map(e => e); + } else { + obj.grantingContracts = []; + } + return obj; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.grantingContracts = object.grantingContracts?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.grantingContracts = object.granting_contracts?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.grantingContracts) { + obj.granting_contracts = message.grantingContracts.map(e => e); + } else { + obj.granting_contracts = message.grantingContracts; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/archway.cwfees.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/errors.ts b/packages/arch3-proto/generated/archway/cwica/v1/errors.ts new file mode 100644 index 0000000..d7b3957 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/errors.ts @@ -0,0 +1,42 @@ +/* eslint-disable */ +/** ModuleErrors defines the module level error codes */ +export enum ModuleErrors { + /** ERR_UNKNOWN - ERR_UNKNOWN is the default error code */ + ERR_UNKNOWN = 0, + /** ERR_PACKET_TIMEOUT - ERR_PACKET_TIMEOUT is the error code for packet timeout */ + ERR_PACKET_TIMEOUT = 1, + /** ERR_EXEC_FAILURE - ERR_EXEC_FAILURE is the error code for tx execution failure */ + ERR_EXEC_FAILURE = 2, + UNRECOGNIZED = -1, +} +export const ModuleErrorsAmino = ModuleErrors; +export function moduleErrorsFromJSON(object: any): ModuleErrors { + switch (object) { + case 0: + case "ERR_UNKNOWN": + return ModuleErrors.ERR_UNKNOWN; + case 1: + case "ERR_PACKET_TIMEOUT": + return ModuleErrors.ERR_PACKET_TIMEOUT; + case 2: + case "ERR_EXEC_FAILURE": + return ModuleErrors.ERR_EXEC_FAILURE; + case -1: + case "UNRECOGNIZED": + default: + return ModuleErrors.UNRECOGNIZED; + } +} +export function moduleErrorsToJSON(object: ModuleErrors): string { + switch (object) { + case ModuleErrors.ERR_UNKNOWN: + return "ERR_UNKNOWN"; + case ModuleErrors.ERR_PACKET_TIMEOUT: + return "ERR_PACKET_TIMEOUT"; + case ModuleErrors.ERR_EXEC_FAILURE: + return "ERR_EXEC_FAILURE"; + case ModuleErrors.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/genesis.ts b/packages/arch3-proto/generated/archway/cwica/v1/genesis.ts new file mode 100644 index 0000000..4855573 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/genesis.ts @@ -0,0 +1,96 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** GenesisState defines the cwica module's genesis state. */ +export interface GenesisState { + /** params defines all the parameters of the module. */ + params: Params; +} +export interface GenesisStateProtoMsg { + typeUrl: "/archway.cwica.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the cwica module's genesis state. */ +export interface GenesisStateAmino { + /** params defines all the parameters of the module. */ + params?: ParamsAmino; +} +export interface GenesisStateAminoMsg { + type: "/archway.cwica.v1.GenesisState"; + value: GenesisStateAmino; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/archway.cwica.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: GenesisState): JsonSafe { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/archway.cwica.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/params.ts b/packages/arch3-proto/generated/archway/cwica/v1/params.ts new file mode 100644 index 0000000..ecca828 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/params.ts @@ -0,0 +1,95 @@ +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** Params defines the parameters for the module. */ +export interface Params { + /** Defines maximum amount of messages which can be passed in MsgSendTx */ + msgSendTxMaxMessages: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/archway.cwica.v1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the module. */ +export interface ParamsAmino { + /** Defines maximum amount of messages which can be passed in MsgSendTx */ + msg_send_tx_max_messages?: string; +} +export interface ParamsAminoMsg { + type: "/archway.cwica.v1.Params"; + value: ParamsAmino; +} +function createBaseParams(): Params { + return { + msgSendTxMaxMessages: BigInt(0) + }; +} +export const Params = { + typeUrl: "/archway.cwica.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.msgSendTxMaxMessages !== BigInt(0)) { + writer.uint32(8).uint64(message.msgSendTxMaxMessages); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgSendTxMaxMessages = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + msgSendTxMaxMessages: isSet(object.msgSendTxMaxMessages) ? BigInt(object.msgSendTxMaxMessages.toString()) : BigInt(0) + }; + }, + toJSON(message: Params): JsonSafe { + const obj: any = {}; + message.msgSendTxMaxMessages !== undefined && (obj.msgSendTxMaxMessages = (message.msgSendTxMaxMessages || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.msgSendTxMaxMessages = object.msgSendTxMaxMessages !== undefined && object.msgSendTxMaxMessages !== null ? BigInt(object.msgSendTxMaxMessages.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.msg_send_tx_max_messages !== undefined && object.msg_send_tx_max_messages !== null) { + message.msgSendTxMaxMessages = BigInt(object.msg_send_tx_max_messages); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.msg_send_tx_max_messages = message.msgSendTxMaxMessages !== BigInt(0) ? message.msgSendTxMaxMessages.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/archway.cwica.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/query.rpc.Query.ts b/packages/arch3-proto/generated/archway/cwica/v1/query.rpc.Query.ts new file mode 100644 index 0000000..c3d6133 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/query.rpc.Query.ts @@ -0,0 +1,31 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params queries the module parameters */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("archway.cwica.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/query.ts b/packages/arch3-proto/generated/archway/cwica/v1/query.ts new file mode 100644 index 0000000..e7f980f --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/query.ts @@ -0,0 +1,165 @@ +/* eslint-disable */ +import { Params, ParamsAmino } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { JsonSafe } from "../../../json-safe"; +import { isSet } from "../../../helpers"; +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/archway.cwica.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "/archway.cwica.v1.QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters for the module */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/archway.cwica.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters for the module */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "/archway.cwica.v1.QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/archway.cwica.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + toJSON(_: QueryParamsRequest): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/archway.cwica.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/archway.cwica.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: QueryParamsResponse): JsonSafe { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/archway.cwica.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/sudo.ts b/packages/arch3-proto/generated/archway/cwica/v1/sudo.ts new file mode 100644 index 0000000..6ad4b39 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/sudo.ts @@ -0,0 +1,435 @@ +/* eslint-disable */ +import { Packet, PacketAmino } from "../../../ibc/core/channel/v1/channel"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** + * Sudopayload is the payload for the sudo call sent by the cwica module on IBC + * actions + */ +export interface SudoPayload { + /** ICA is the message which carries the success responses */ + ica?: ICASuccess; +} +export interface SudoPayloadProtoMsg { + typeUrl: "/archway.cwica.v1.SudoPayload"; + value: Uint8Array; +} +/** + * Sudopayload is the payload for the sudo call sent by the cwica module on IBC + * actions + */ +export interface SudoPayloadAmino { + /** ICA is the message which carries the success responses */ + ica?: ICASuccessAmino; +} +export interface SudoPayloadAminoMsg { + type: "/archway.cwica.v1.SudoPayload"; + value: SudoPayloadAmino; +} +/** ICASuccess is the success message after the ICA operation has taken place */ +export interface ICASuccess { + /** + * account_registered is the message which carries the success response after + * the ica account has been registered + */ + accountRegistered?: AccountRegistered; + /** + * tx_executed is the message which carries the success response after the ica + * tx has been executed + */ + txExecuted?: TxExecuted; +} +export interface ICASuccessProtoMsg { + typeUrl: "/archway.cwica.v1.ICASuccess"; + value: Uint8Array; +} +/** ICASuccess is the success message after the ICA operation has taken place */ +export interface ICASuccessAmino { + /** + * account_registered is the message which carries the success response after + * the ica account has been registered + */ + account_registered?: AccountRegisteredAmino; + /** + * tx_executed is the message which carries the success response after the ica + * tx has been executed + */ + tx_executed?: TxExecutedAmino; +} +export interface ICASuccessAminoMsg { + type: "/archway.cwica.v1.ICASuccess"; + value: ICASuccessAmino; +} +/** + * AccountRegistered is contains the address of the registered account on the + * counterparty chain + */ +export interface AccountRegistered { + /** + * counterparty_address is the address of the account on the counterparty + * chain + */ + counterpartyAddress: string; +} +export interface AccountRegisteredProtoMsg { + typeUrl: "/archway.cwica.v1.AccountRegistered"; + value: Uint8Array; +} +/** + * AccountRegistered is contains the address of the registered account on the + * counterparty chain + */ +export interface AccountRegisteredAmino { + /** + * counterparty_address is the address of the account on the counterparty + * chain + */ + counterparty_address?: string; +} +export interface AccountRegisteredAminoMsg { + type: "/archway.cwica.v1.AccountRegistered"; + value: AccountRegisteredAmino; +} +/** TxExecuted is the response message after the execute of the ICA tx */ +export interface TxExecuted { + /** packet is the ibc packet which was executed */ + packet?: Packet; + /** data is the response data after the tx has been executed */ + data: Uint8Array; +} +export interface TxExecutedProtoMsg { + typeUrl: "/archway.cwica.v1.TxExecuted"; + value: Uint8Array; +} +/** TxExecuted is the response message after the execute of the ICA tx */ +export interface TxExecutedAmino { + /** packet is the ibc packet which was executed */ + packet?: PacketAmino; + /** data is the response data after the tx has been executed */ + data?: string; +} +export interface TxExecutedAminoMsg { + type: "/archway.cwica.v1.TxExecuted"; + value: TxExecutedAmino; +} +function createBaseSudoPayload(): SudoPayload { + return { + ica: undefined + }; +} +export const SudoPayload = { + typeUrl: "/archway.cwica.v1.SudoPayload", + encode(message: SudoPayload, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ica !== undefined) { + ICASuccess.encode(message.ica, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SudoPayload { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ica = ICASuccess.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SudoPayload { + return { + ica: isSet(object.ica) ? ICASuccess.fromJSON(object.ica) : undefined + }; + }, + toJSON(message: SudoPayload): JsonSafe { + const obj: any = {}; + message.ica !== undefined && (obj.ica = message.ica ? ICASuccess.toJSON(message.ica) : undefined); + return obj; + }, + fromPartial(object: Partial): SudoPayload { + const message = createBaseSudoPayload(); + message.ica = object.ica !== undefined && object.ica !== null ? ICASuccess.fromPartial(object.ica) : undefined; + return message; + }, + fromAmino(object: SudoPayloadAmino): SudoPayload { + const message = createBaseSudoPayload(); + if (object.ica !== undefined && object.ica !== null) { + message.ica = ICASuccess.fromAmino(object.ica); + } + return message; + }, + toAmino(message: SudoPayload): SudoPayloadAmino { + const obj: any = {}; + obj.ica = message.ica ? ICASuccess.toAmino(message.ica) : undefined; + return obj; + }, + fromAminoMsg(object: SudoPayloadAminoMsg): SudoPayload { + return SudoPayload.fromAmino(object.value); + }, + fromProtoMsg(message: SudoPayloadProtoMsg): SudoPayload { + return SudoPayload.decode(message.value); + }, + toProto(message: SudoPayload): Uint8Array { + return SudoPayload.encode(message).finish(); + }, + toProtoMsg(message: SudoPayload): SudoPayloadProtoMsg { + return { + typeUrl: "/archway.cwica.v1.SudoPayload", + value: SudoPayload.encode(message).finish() + }; + } +}; +function createBaseICASuccess(): ICASuccess { + return { + accountRegistered: undefined, + txExecuted: undefined + }; +} +export const ICASuccess = { + typeUrl: "/archway.cwica.v1.ICASuccess", + encode(message: ICASuccess, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountRegistered !== undefined) { + AccountRegistered.encode(message.accountRegistered, writer.uint32(10).fork()).ldelim(); + } + if (message.txExecuted !== undefined) { + TxExecuted.encode(message.txExecuted, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ICASuccess { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseICASuccess(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountRegistered = AccountRegistered.decode(reader, reader.uint32()); + break; + case 2: + message.txExecuted = TxExecuted.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ICASuccess { + return { + accountRegistered: isSet(object.accountRegistered) ? AccountRegistered.fromJSON(object.accountRegistered) : undefined, + txExecuted: isSet(object.txExecuted) ? TxExecuted.fromJSON(object.txExecuted) : undefined + }; + }, + toJSON(message: ICASuccess): JsonSafe { + const obj: any = {}; + message.accountRegistered !== undefined && (obj.accountRegistered = message.accountRegistered ? AccountRegistered.toJSON(message.accountRegistered) : undefined); + message.txExecuted !== undefined && (obj.txExecuted = message.txExecuted ? TxExecuted.toJSON(message.txExecuted) : undefined); + return obj; + }, + fromPartial(object: Partial): ICASuccess { + const message = createBaseICASuccess(); + message.accountRegistered = object.accountRegistered !== undefined && object.accountRegistered !== null ? AccountRegistered.fromPartial(object.accountRegistered) : undefined; + message.txExecuted = object.txExecuted !== undefined && object.txExecuted !== null ? TxExecuted.fromPartial(object.txExecuted) : undefined; + return message; + }, + fromAmino(object: ICASuccessAmino): ICASuccess { + const message = createBaseICASuccess(); + if (object.account_registered !== undefined && object.account_registered !== null) { + message.accountRegistered = AccountRegistered.fromAmino(object.account_registered); + } + if (object.tx_executed !== undefined && object.tx_executed !== null) { + message.txExecuted = TxExecuted.fromAmino(object.tx_executed); + } + return message; + }, + toAmino(message: ICASuccess): ICASuccessAmino { + const obj: any = {}; + obj.account_registered = message.accountRegistered ? AccountRegistered.toAmino(message.accountRegistered) : undefined; + obj.tx_executed = message.txExecuted ? TxExecuted.toAmino(message.txExecuted) : undefined; + return obj; + }, + fromAminoMsg(object: ICASuccessAminoMsg): ICASuccess { + return ICASuccess.fromAmino(object.value); + }, + fromProtoMsg(message: ICASuccessProtoMsg): ICASuccess { + return ICASuccess.decode(message.value); + }, + toProto(message: ICASuccess): Uint8Array { + return ICASuccess.encode(message).finish(); + }, + toProtoMsg(message: ICASuccess): ICASuccessProtoMsg { + return { + typeUrl: "/archway.cwica.v1.ICASuccess", + value: ICASuccess.encode(message).finish() + }; + } +}; +function createBaseAccountRegistered(): AccountRegistered { + return { + counterpartyAddress: "" + }; +} +export const AccountRegistered = { + typeUrl: "/archway.cwica.v1.AccountRegistered", + encode(message: AccountRegistered, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.counterpartyAddress !== "") { + writer.uint32(10).string(message.counterpartyAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountRegistered { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountRegistered(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.counterpartyAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): AccountRegistered { + return { + counterpartyAddress: isSet(object.counterpartyAddress) ? String(object.counterpartyAddress) : "" + }; + }, + toJSON(message: AccountRegistered): JsonSafe { + const obj: any = {}; + message.counterpartyAddress !== undefined && (obj.counterpartyAddress = message.counterpartyAddress); + return obj; + }, + fromPartial(object: Partial): AccountRegistered { + const message = createBaseAccountRegistered(); + message.counterpartyAddress = object.counterpartyAddress ?? ""; + return message; + }, + fromAmino(object: AccountRegisteredAmino): AccountRegistered { + const message = createBaseAccountRegistered(); + if (object.counterparty_address !== undefined && object.counterparty_address !== null) { + message.counterpartyAddress = object.counterparty_address; + } + return message; + }, + toAmino(message: AccountRegistered): AccountRegisteredAmino { + const obj: any = {}; + obj.counterparty_address = message.counterpartyAddress === "" ? undefined : message.counterpartyAddress; + return obj; + }, + fromAminoMsg(object: AccountRegisteredAminoMsg): AccountRegistered { + return AccountRegistered.fromAmino(object.value); + }, + fromProtoMsg(message: AccountRegisteredProtoMsg): AccountRegistered { + return AccountRegistered.decode(message.value); + }, + toProto(message: AccountRegistered): Uint8Array { + return AccountRegistered.encode(message).finish(); + }, + toProtoMsg(message: AccountRegistered): AccountRegisteredProtoMsg { + return { + typeUrl: "/archway.cwica.v1.AccountRegistered", + value: AccountRegistered.encode(message).finish() + }; + } +}; +function createBaseTxExecuted(): TxExecuted { + return { + packet: undefined, + data: new Uint8Array() + }; +} +export const TxExecuted = { + typeUrl: "/archway.cwica.v1.TxExecuted", + encode(message: TxExecuted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.packet !== undefined) { + Packet.encode(message.packet, writer.uint32(10).fork()).ldelim(); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxExecuted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxExecuted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.packet = Packet.decode(reader, reader.uint32()); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): TxExecuted { + return { + packet: isSet(object.packet) ? Packet.fromJSON(object.packet) : undefined, + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: TxExecuted): JsonSafe { + const obj: any = {}; + message.packet !== undefined && (obj.packet = message.packet ? Packet.toJSON(message.packet) : undefined); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): TxExecuted { + const message = createBaseTxExecuted(); + message.packet = object.packet !== undefined && object.packet !== null ? Packet.fromPartial(object.packet) : undefined; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxExecutedAmino): TxExecuted { + const message = createBaseTxExecuted(); + if (object.packet !== undefined && object.packet !== null) { + message.packet = Packet.fromAmino(object.packet); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: TxExecuted): TxExecutedAmino { + const obj: any = {}; + obj.packet = message.packet ? Packet.toAmino(message.packet) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: TxExecutedAminoMsg): TxExecuted { + return TxExecuted.fromAmino(object.value); + }, + fromProtoMsg(message: TxExecutedProtoMsg): TxExecuted { + return TxExecuted.decode(message.value); + }, + toProto(message: TxExecuted): Uint8Array { + return TxExecuted.encode(message).finish(); + }, + toProtoMsg(message: TxExecuted): TxExecutedProtoMsg { + return { + typeUrl: "/archway.cwica.v1.TxExecuted", + value: TxExecuted.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/tx.amino.ts b/packages/arch3-proto/generated/archway/cwica/v1/tx.amino.ts new file mode 100644 index 0000000..5e83fc6 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/tx.amino.ts @@ -0,0 +1,19 @@ +/* eslint-disable */ +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/archway.cwica.v1.MsgRegisterInterchainAccount": { + aminoType: "/archway.cwica.v1.MsgRegisterInterchainAccount", + toAmino: MsgRegisterInterchainAccount.toAmino, + fromAmino: MsgRegisterInterchainAccount.fromAmino + }, + "/archway.cwica.v1.MsgSendTx": { + aminoType: "/archway.cwica.v1.MsgSendTx", + toAmino: MsgSendTx.toAmino, + fromAmino: MsgSendTx.fromAmino + }, + "/archway.cwica.v1.MsgUpdateParams": { + aminoType: "cwica/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/tx.registry.ts b/packages/arch3-proto/generated/archway/cwica/v1/tx.registry.ts new file mode 100644 index 0000000..3ab4941 --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/tx.registry.ts @@ -0,0 +1,112 @@ +/* eslint-disable */ +import { TelescopeGeneratedType } from "../../../types"; +import { Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, TelescopeGeneratedType]> = [["/archway.cwica.v1.MsgRegisterInterchainAccount", MsgRegisterInterchainAccount], ["/archway.cwica.v1.MsgSendTx", MsgSendTx], ["/archway.cwica.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.encode(value).finish() + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/archway.cwica.v1.MsgSendTx", + value: MsgSendTx.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + value + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/archway.cwica.v1.MsgSendTx", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + value + }; + } + }, + toJSON: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.toJSON(value) + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/archway.cwica.v1.MsgSendTx", + value: MsgSendTx.toJSON(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + value: MsgUpdateParams.toJSON(value) + }; + } + }, + fromJSON: { + registerInterchainAccount(value: any) { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.fromJSON(value) + }; + }, + sendTx(value: any) { + return { + typeUrl: "/archway.cwica.v1.MsgSendTx", + value: MsgSendTx.fromJSON(value) + }; + }, + updateParams(value: any) { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + value: MsgUpdateParams.fromJSON(value) + }; + } + }, + fromPartial: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.fromPartial(value) + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/archway.cwica.v1.MsgSendTx", + value: MsgSendTx.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/tx.rpc.msg.ts b/packages/arch3-proto/generated/archway/cwica/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..6e88bcd --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +/* eslint-disable */ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse, MsgSendTx, MsgSendTxResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the Msg service. */ +export interface Msg { + /** RegisterInterchainAccount registers an account on the counterparty chain. */ + registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise; + /** SendTx submits a transaction with msgs to the counterparty chain. */ + sendTx(request: MsgSendTx): Promise; + /** UpdateParams updates the cwica module parameters. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.registerInterchainAccount = this.registerInterchainAccount.bind(this); + this.sendTx = this.sendTx.bind(this); + this.updateParams = this.updateParams.bind(this); + } + registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise { + const data = MsgRegisterInterchainAccount.encode(request).finish(); + const promise = this.rpc.request("archway.cwica.v1.Msg", "RegisterInterchainAccount", data); + return promise.then(data => MsgRegisterInterchainAccountResponse.decode(new BinaryReader(data))); + } + sendTx(request: MsgSendTx): Promise { + const data = MsgSendTx.encode(request).finish(); + const promise = this.rpc.request("archway.cwica.v1.Msg", "SendTx", data); + return promise.then(data => MsgSendTxResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("archway.cwica.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/cwica/v1/tx.ts b/packages/arch3-proto/generated/archway/cwica/v1/tx.ts new file mode 100644 index 0000000..0f0641c --- /dev/null +++ b/packages/arch3-proto/generated/archway/cwica/v1/tx.ts @@ -0,0 +1,688 @@ +/* eslint-disable */ +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { Params, ParamsAmino } from "./params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** + * MsgRegisterInterchainAccount defines the Msg/RegisterInterchainAccount + * request type. + */ +export interface MsgRegisterInterchainAccount { + /** + * contract_address is the address of the contrat who wants to register an ica + * account on the counterparty chain + */ + contractAddress: string; + /** connection_id is the connection id between the two chains */ + connectionId: string; +} +export interface MsgRegisterInterchainAccountProtoMsg { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount"; + value: Uint8Array; +} +/** + * MsgRegisterInterchainAccount defines the Msg/RegisterInterchainAccount + * request type. + */ +export interface MsgRegisterInterchainAccountAmino { + /** + * contract_address is the address of the contrat who wants to register an ica + * account on the counterparty chain + */ + contract_address?: string; + /** connection_id is the connection id between the two chains */ + connection_id?: string; +} +export interface MsgRegisterInterchainAccountAminoMsg { + type: "/archway.cwica.v1.MsgRegisterInterchainAccount"; + value: MsgRegisterInterchainAccountAmino; +} +/** + * MsgRegisterInterchainAccountResponse defines the response for + * Msg/RegisterInterchainAccount + */ +export interface MsgRegisterInterchainAccountResponse {} +export interface MsgRegisterInterchainAccountResponseProtoMsg { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccountResponse"; + value: Uint8Array; +} +/** + * MsgRegisterInterchainAccountResponse defines the response for + * Msg/RegisterInterchainAccount + */ +export interface MsgRegisterInterchainAccountResponseAmino {} +export interface MsgRegisterInterchainAccountResponseAminoMsg { + type: "/archway.cwica.v1.MsgRegisterInterchainAccountResponse"; + value: MsgRegisterInterchainAccountResponseAmino; +} +/** MsgSendTx defines the Msg/SendTx request type. */ +export interface MsgSendTx { + /** + * contract_address is the address of the who wants to submit a transaction to + * the counterparty chain + */ + contractAddress: string; + /** connection_id is the connection id between the two chains */ + connectionId: string; + /** msgs are the messages to be submitted to the counterparty chain */ + msgs: Any[]; + /** memo is the memo to be included in the packet */ + memo: string; + /** timeout in seconds after which the packet times out */ + timeout: bigint; +} +export interface MsgSendTxProtoMsg { + typeUrl: "/archway.cwica.v1.MsgSendTx"; + value: Uint8Array; +} +/** MsgSendTx defines the Msg/SendTx request type. */ +export interface MsgSendTxAmino { + /** + * contract_address is the address of the who wants to submit a transaction to + * the counterparty chain + */ + contract_address?: string; + /** connection_id is the connection id between the two chains */ + connection_id?: string; + /** msgs are the messages to be submitted to the counterparty chain */ + msgs?: AnyAmino[]; + /** memo is the memo to be included in the packet */ + memo?: string; + /** timeout in seconds after which the packet times out */ + timeout?: string; +} +export interface MsgSendTxAminoMsg { + type: "/archway.cwica.v1.MsgSendTx"; + value: MsgSendTxAmino; +} +/** MsgSendTxResponse defines the response for Msg/SendTx */ +export interface MsgSendTxResponse { + /** + * sequence_id is the channel's sequence_id for outgoing ibc packet. Unique + * per a channel. + */ + sequenceId: bigint; + /** channel is the channel id the transaction was submitted from */ + channel: string; +} +export interface MsgSendTxResponseProtoMsg { + typeUrl: "/archway.cwica.v1.MsgSendTxResponse"; + value: Uint8Array; +} +/** MsgSendTxResponse defines the response for Msg/SendTx */ +export interface MsgSendTxResponseAmino { + /** + * sequence_id is the channel's sequence_id for outgoing ibc packet. Unique + * per a channel. + */ + sequence_id?: string; + /** channel is the channel id the transaction was submitted from */ + channel?: string; +} +export interface MsgSendTxResponseAminoMsg { + type: "/archway.cwica.v1.MsgSendTxResponse"; + value: MsgSendTxResponseAmino; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParams { + /** + * authority is the address of the authority that is allowed to update the + * cwica module parameters. + */ + authority: string; + /** + * params deines the module parmeters to update + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/archway.cwica.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** + * authority is the address of the authority that is allowed to update the + * cwica module parameters. + */ + authority?: string; + /** + * params deines the module parmeters to update + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cwica/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParamsResponse is the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/archway.cwica.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse is the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "/archway.cwica.v1.MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount { + return { + contractAddress: "", + connectionId: "" + }; +} +export const MsgRegisterInterchainAccount = { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + encode(message: MsgRegisterInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterInterchainAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterInterchainAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgRegisterInterchainAccount { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "" + }; + }, + toJSON(message: MsgRegisterInterchainAccount): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + return obj; + }, + fromPartial(object: Partial): MsgRegisterInterchainAccount { + const message = createBaseMsgRegisterInterchainAccount(); + message.contractAddress = object.contractAddress ?? ""; + message.connectionId = object.connectionId ?? ""; + return message; + }, + fromAmino(object: MsgRegisterInterchainAccountAmino): MsgRegisterInterchainAccount { + const message = createBaseMsgRegisterInterchainAccount(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + return message; + }, + toAmino(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + return obj; + }, + fromAminoMsg(object: MsgRegisterInterchainAccountAminoMsg): MsgRegisterInterchainAccount { + return MsgRegisterInterchainAccount.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterInterchainAccountProtoMsg): MsgRegisterInterchainAccount { + return MsgRegisterInterchainAccount.decode(message.value); + }, + toProto(message: MsgRegisterInterchainAccount): Uint8Array { + return MsgRegisterInterchainAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountProtoMsg { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.encode(message).finish() + }; + } +}; +function createBaseMsgRegisterInterchainAccountResponse(): MsgRegisterInterchainAccountResponse { + return {}; +} +export const MsgRegisterInterchainAccountResponse = { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccountResponse", + encode(_: MsgRegisterInterchainAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterInterchainAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterInterchainAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgRegisterInterchainAccountResponse { + return {}; + }, + toJSON(_: MsgRegisterInterchainAccountResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgRegisterInterchainAccountResponse { + const message = createBaseMsgRegisterInterchainAccountResponse(); + return message; + }, + fromAmino(_: MsgRegisterInterchainAccountResponseAmino): MsgRegisterInterchainAccountResponse { + const message = createBaseMsgRegisterInterchainAccountResponse(); + return message; + }, + toAmino(_: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRegisterInterchainAccountResponseAminoMsg): MsgRegisterInterchainAccountResponse { + return MsgRegisterInterchainAccountResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgRegisterInterchainAccountResponseProtoMsg): MsgRegisterInterchainAccountResponse { + return MsgRegisterInterchainAccountResponse.decode(message.value); + }, + toProto(message: MsgRegisterInterchainAccountResponse): Uint8Array { + return MsgRegisterInterchainAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseProtoMsg { + return { + typeUrl: "/archway.cwica.v1.MsgRegisterInterchainAccountResponse", + value: MsgRegisterInterchainAccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSendTx(): MsgSendTx { + return { + contractAddress: "", + connectionId: "", + msgs: [], + memo: "", + timeout: BigInt(0) + }; +} +export const MsgSendTx = { + typeUrl: "/archway.cwica.v1.MsgSendTx", + encode(message: MsgSendTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + for (const v of message.msgs) { + Any.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.memo !== "") { + writer.uint32(34).string(message.memo); + } + if (message.timeout !== BigInt(0)) { + writer.uint32(40).uint64(message.timeout); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.msgs.push(Any.decode(reader, reader.uint32())); + break; + case 4: + message.memo = reader.string(); + break; + case 5: + message.timeout = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSendTx { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "", + connectionId: isSet(object.connectionId) ? String(object.connectionId) : "", + msgs: Array.isArray(object?.msgs) ? object.msgs.map((e: any) => Any.fromJSON(e)) : [], + memo: isSet(object.memo) ? String(object.memo) : "", + timeout: isSet(object.timeout) ? BigInt(object.timeout.toString()) : BigInt(0) + }; + }, + toJSON(message: MsgSendTx): JsonSafe { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + message.connectionId !== undefined && (obj.connectionId = message.connectionId); + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.msgs = []; + } + message.memo !== undefined && (obj.memo = message.memo); + message.timeout !== undefined && (obj.timeout = (message.timeout || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): MsgSendTx { + const message = createBaseMsgSendTx(); + message.contractAddress = object.contractAddress ?? ""; + message.connectionId = object.connectionId ?? ""; + message.msgs = object.msgs?.map(e => Any.fromPartial(e)) || []; + message.memo = object.memo ?? ""; + message.timeout = object.timeout !== undefined && object.timeout !== null ? BigInt(object.timeout.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSendTxAmino): MsgSendTx { + const message = createBaseMsgSendTx(); + if (object.contract_address !== undefined && object.contract_address !== null) { + message.contractAddress = object.contract_address; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + message.msgs = object.msgs?.map(e => Any.fromAmino(e)) || []; + if (object.memo !== undefined && object.memo !== null) { + message.memo = object.memo; + } + if (object.timeout !== undefined && object.timeout !== null) { + message.timeout = BigInt(object.timeout); + } + return message; + }, + toAmino(message: MsgSendTx): MsgSendTxAmino { + const obj: any = {}; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + if (message.msgs) { + obj.msgs = message.msgs.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msgs = message.msgs; + } + obj.memo = message.memo === "" ? undefined : message.memo; + obj.timeout = message.timeout !== BigInt(0) ? message.timeout.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSendTxAminoMsg): MsgSendTx { + return MsgSendTx.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSendTxProtoMsg): MsgSendTx { + return MsgSendTx.decode(message.value); + }, + toProto(message: MsgSendTx): Uint8Array { + return MsgSendTx.encode(message).finish(); + }, + toProtoMsg(message: MsgSendTx): MsgSendTxProtoMsg { + return { + typeUrl: "/archway.cwica.v1.MsgSendTx", + value: MsgSendTx.encode(message).finish() + }; + } +}; +function createBaseMsgSendTxResponse(): MsgSendTxResponse { + return { + sequenceId: BigInt(0), + channel: "" + }; +} +export const MsgSendTxResponse = { + typeUrl: "/archway.cwica.v1.MsgSendTxResponse", + encode(message: MsgSendTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequenceId !== BigInt(0)) { + writer.uint32(8).uint64(message.sequenceId); + } + if (message.channel !== "") { + writer.uint32(18).string(message.channel); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequenceId = reader.uint64(); + break; + case 2: + message.channel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgSendTxResponse { + return { + sequenceId: isSet(object.sequenceId) ? BigInt(object.sequenceId.toString()) : BigInt(0), + channel: isSet(object.channel) ? String(object.channel) : "" + }; + }, + toJSON(message: MsgSendTxResponse): JsonSafe { + const obj: any = {}; + message.sequenceId !== undefined && (obj.sequenceId = (message.sequenceId || BigInt(0)).toString()); + message.channel !== undefined && (obj.channel = message.channel); + return obj; + }, + fromPartial(object: Partial): MsgSendTxResponse { + const message = createBaseMsgSendTxResponse(); + message.sequenceId = object.sequenceId !== undefined && object.sequenceId !== null ? BigInt(object.sequenceId.toString()) : BigInt(0); + message.channel = object.channel ?? ""; + return message; + }, + fromAmino(object: MsgSendTxResponseAmino): MsgSendTxResponse { + const message = createBaseMsgSendTxResponse(); + if (object.sequence_id !== undefined && object.sequence_id !== null) { + message.sequenceId = BigInt(object.sequence_id); + } + if (object.channel !== undefined && object.channel !== null) { + message.channel = object.channel; + } + return message; + }, + toAmino(message: MsgSendTxResponse): MsgSendTxResponseAmino { + const obj: any = {}; + obj.sequence_id = message.sequenceId !== BigInt(0) ? message.sequenceId.toString() : undefined; + obj.channel = message.channel === "" ? undefined : message.channel; + return obj; + }, + fromAminoMsg(object: MsgSendTxResponseAminoMsg): MsgSendTxResponse { + return MsgSendTxResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgSendTxResponseProtoMsg): MsgSendTxResponse { + return MsgSendTxResponse.decode(message.value); + }, + toProto(message: MsgSendTxResponse): Uint8Array { + return MsgSendTxResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendTxResponse): MsgSendTxResponseProtoMsg { + return { + typeUrl: "/archway.cwica.v1.MsgSendTxResponse", + value: MsgSendTxResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): MsgUpdateParams { + return { + authority: isSet(object.authority) ? String(object.authority) : "", + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + toJSON(message: MsgUpdateParams): JsonSafe { + const obj: any = {}; + message.authority !== undefined && (obj.authority = message.authority); + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cwica/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/archway.cwica.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(_: any): MsgUpdateParamsResponse { + return {}; + }, + toJSON(_: MsgUpdateParamsResponse): JsonSafe { + const obj: any = {}; + return obj; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/archway.cwica.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/archway/rewards/v1/events.ts b/packages/arch3-proto/generated/archway/rewards/v1/events.ts index 5e72d39..94ddecd 100644 --- a/packages/arch3-proto/generated/archway/rewards/v1/events.ts +++ b/packages/arch3-proto/generated/archway/rewards/v1/events.ts @@ -3,6 +3,7 @@ import { ContractMetadata, ContractMetadataAmino } from "./rewards"; import { Coin, CoinAmino, DecCoin, DecCoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; /** * ContractMetadataSetEvent is emitted when the contract metadata is created or * updated. @@ -202,7 +203,7 @@ export const ContractMetadataSetEvent = { metadata: isSet(object.metadata) ? ContractMetadata.fromJSON(object.metadata) : undefined }; }, - toJSON(message: ContractMetadataSetEvent): unknown { + toJSON(message: ContractMetadataSetEvent): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); message.metadata !== undefined && (obj.metadata = message.metadata ? ContractMetadata.toJSON(message.metadata) : undefined); @@ -226,7 +227,7 @@ export const ContractMetadataSetEvent = { }, toAmino(message: ContractMetadataSetEvent): ContractMetadataSetEventAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; obj.metadata = message.metadata ? ContractMetadata.toAmino(message.metadata) : undefined; return obj; }, @@ -313,7 +314,7 @@ export const ContractRewardCalculationEvent = { metadata: isSet(object.metadata) ? ContractMetadata.fromJSON(object.metadata) : undefined }; }, - toJSON(message: ContractRewardCalculationEvent): unknown { + toJSON(message: ContractRewardCalculationEvent): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); message.gasConsumed !== undefined && (obj.gasConsumed = (message.gasConsumed || BigInt(0)).toString()); @@ -354,13 +355,13 @@ export const ContractRewardCalculationEvent = { }, toAmino(message: ContractRewardCalculationEvent): ContractRewardCalculationEventAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; - obj.gas_consumed = message.gasConsumed ? message.gasConsumed.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.gas_consumed = message.gasConsumed !== BigInt(0) ? message.gasConsumed.toString() : undefined; obj.inflation_rewards = message.inflationRewards ? Coin.toAmino(message.inflationRewards) : undefined; if (message.feeRebateRewards) { obj.fee_rebate_rewards = message.feeRebateRewards.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.fee_rebate_rewards = []; + obj.fee_rebate_rewards = message.feeRebateRewards; } obj.metadata = message.metadata ? ContractMetadata.toAmino(message.metadata) : undefined; return obj; @@ -424,7 +425,7 @@ export const RewardsWithdrawEvent = { rewards: Array.isArray(object?.rewards) ? object.rewards.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: RewardsWithdrawEvent): unknown { + toJSON(message: RewardsWithdrawEvent): JsonSafe { const obj: any = {}; message.rewardAddress !== undefined && (obj.rewardAddress = message.rewardAddress); if (message.rewards) { @@ -450,11 +451,11 @@ export const RewardsWithdrawEvent = { }, toAmino(message: RewardsWithdrawEvent): RewardsWithdrawEventAmino { const obj: any = {}; - obj.reward_address = message.rewardAddress; + obj.reward_address = message.rewardAddress === "" ? undefined : message.rewardAddress; if (message.rewards) { obj.rewards = message.rewards.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.rewards = []; + obj.rewards = message.rewards; } return obj; }, @@ -509,7 +510,7 @@ export const MinConsensusFeeSetEvent = { fee: isSet(object.fee) ? DecCoin.fromJSON(object.fee) : undefined }; }, - toJSON(message: MinConsensusFeeSetEvent): unknown { + toJSON(message: MinConsensusFeeSetEvent): JsonSafe { const obj: any = {}; message.fee !== undefined && (obj.fee = message.fee ? DecCoin.toJSON(message.fee) : undefined); return obj; @@ -590,7 +591,7 @@ export const ContractFlatFeeSetEvent = { flatFee: isSet(object.flatFee) ? Coin.fromJSON(object.flatFee) : undefined }; }, - toJSON(message: ContractFlatFeeSetEvent): unknown { + toJSON(message: ContractFlatFeeSetEvent): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); message.flatFee !== undefined && (obj.flatFee = message.flatFee ? Coin.toJSON(message.flatFee) : undefined); @@ -614,7 +615,7 @@ export const ContractFlatFeeSetEvent = { }, toAmino(message: ContractFlatFeeSetEvent): ContractFlatFeeSetEventAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; obj.flat_fee = message.flatFee ? Coin.toAmino(message.flatFee) : undefined; return obj; }, diff --git a/packages/arch3-proto/generated/archway/rewards/v1/genesis.ts b/packages/arch3-proto/generated/archway/rewards/v1/genesis.ts index 98e4fe6..3f0c307 100644 --- a/packages/arch3-proto/generated/archway/rewards/v1/genesis.ts +++ b/packages/arch3-proto/generated/archway/rewards/v1/genesis.ts @@ -3,6 +3,7 @@ import { Params, ParamsAmino, ContractMetadata, ContractMetadataAmino, BlockRewa import { DecCoin, DecCoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; /** GenesisState defines the initial state of the tracking module. */ export interface GenesisState { /** params defines all the module parameters. */ @@ -146,7 +147,7 @@ export const GenesisState = { flatFees: Array.isArray(object?.flatFees) ? object.flatFees.map((e: any) => FlatFee.fromJSON(e)) : [] }; }, - toJSON(message: GenesisState): unknown { + toJSON(message: GenesisState): JsonSafe { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); if (message.contractsMetadata) { @@ -214,29 +215,29 @@ export const GenesisState = { if (message.contractsMetadata) { obj.contracts_metadata = message.contractsMetadata.map(e => e ? ContractMetadata.toAmino(e) : undefined); } else { - obj.contracts_metadata = []; + obj.contracts_metadata = message.contractsMetadata; } if (message.blockRewards) { obj.block_rewards = message.blockRewards.map(e => e ? BlockRewards.toAmino(e) : undefined); } else { - obj.block_rewards = []; + obj.block_rewards = message.blockRewards; } if (message.txRewards) { obj.tx_rewards = message.txRewards.map(e => e ? TxRewards.toAmino(e) : undefined); } else { - obj.tx_rewards = []; + obj.tx_rewards = message.txRewards; } obj.min_consensus_fee = message.minConsensusFee ? DecCoin.toAmino(message.minConsensusFee) : undefined; - obj.rewards_record_last_id = message.rewardsRecordLastId ? message.rewardsRecordLastId.toString() : undefined; + obj.rewards_record_last_id = message.rewardsRecordLastId !== BigInt(0) ? message.rewardsRecordLastId.toString() : undefined; if (message.rewardsRecords) { obj.rewards_records = message.rewardsRecords.map(e => e ? RewardsRecord.toAmino(e) : undefined); } else { - obj.rewards_records = []; + obj.rewards_records = message.rewardsRecords; } if (message.flatFees) { obj.flat_fees = message.flatFees.map(e => e ? FlatFee.toAmino(e) : undefined); } else { - obj.flat_fees = []; + obj.flat_fees = message.flatFees; } return obj; }, diff --git a/packages/arch3-proto/generated/archway/rewards/v1/query.ts b/packages/arch3-proto/generated/archway/rewards/v1/query.ts index e607833..4ad5df7 100644 --- a/packages/arch3-proto/generated/archway/rewards/v1/query.ts +++ b/packages/arch3-proto/generated/archway/rewards/v1/query.ts @@ -3,6 +3,7 @@ import { PageRequest, PageRequestAmino, PageResponse, PageResponseAmino } from " import { Params, ParamsAmino, ContractMetadata, ContractMetadataAmino, BlockRewards, BlockRewardsAmino, TxRewards, TxRewardsAmino, RewardsRecord, RewardsRecordAmino } from "./rewards"; import { Coin, CoinAmino, DecCoin, DecCoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { JsonSafe } from "../../../json-safe"; import { isSet } from "../../../helpers"; /** QueryParamsRequest is the request for Query.Params. */ export interface QueryParamsRequest {} @@ -383,7 +384,7 @@ export const QueryParamsRequest = { fromJSON(_: any): QueryParamsRequest { return {}; }, - toJSON(_: QueryParamsRequest): unknown { + toJSON(_: QueryParamsRequest): JsonSafe { const obj: any = {}; return obj; }, @@ -450,7 +451,7 @@ export const QueryParamsResponse = { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, - toJSON(message: QueryParamsResponse): unknown { + toJSON(message: QueryParamsResponse): JsonSafe { const obj: any = {}; message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); return obj; @@ -523,7 +524,7 @@ export const QueryContractMetadataRequest = { contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" }; }, - toJSON(message: QueryContractMetadataRequest): unknown { + toJSON(message: QueryContractMetadataRequest): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); return obj; @@ -542,7 +543,7 @@ export const QueryContractMetadataRequest = { }, toAmino(message: QueryContractMetadataRequest): QueryContractMetadataRequestAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; return obj; }, fromAminoMsg(object: QueryContractMetadataRequestAminoMsg): QueryContractMetadataRequest { @@ -596,7 +597,7 @@ export const QueryContractMetadataResponse = { metadata: isSet(object.metadata) ? ContractMetadata.fromJSON(object.metadata) : undefined }; }, - toJSON(message: QueryContractMetadataResponse): unknown { + toJSON(message: QueryContractMetadataResponse): JsonSafe { const obj: any = {}; message.metadata !== undefined && (obj.metadata = message.metadata ? ContractMetadata.toJSON(message.metadata) : undefined); return obj; @@ -659,7 +660,7 @@ export const QueryBlockRewardsTrackingRequest = { fromJSON(_: any): QueryBlockRewardsTrackingRequest { return {}; }, - toJSON(_: QueryBlockRewardsTrackingRequest): unknown { + toJSON(_: QueryBlockRewardsTrackingRequest): JsonSafe { const obj: any = {}; return obj; }, @@ -726,7 +727,7 @@ export const QueryBlockRewardsTrackingResponse = { block: isSet(object.block) ? BlockTracking.fromJSON(object.block) : undefined }; }, - toJSON(message: QueryBlockRewardsTrackingResponse): unknown { + toJSON(message: QueryBlockRewardsTrackingResponse): JsonSafe { const obj: any = {}; message.block !== undefined && (obj.block = message.block ? BlockTracking.toJSON(message.block) : undefined); return obj; @@ -789,7 +790,7 @@ export const QueryRewardsPoolRequest = { fromJSON(_: any): QueryRewardsPoolRequest { return {}; }, - toJSON(_: QueryRewardsPoolRequest): unknown { + toJSON(_: QueryRewardsPoolRequest): JsonSafe { const obj: any = {}; return obj; }, @@ -864,7 +865,7 @@ export const QueryRewardsPoolResponse = { treasuryFunds: Array.isArray(object?.treasuryFunds) ? object.treasuryFunds.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: QueryRewardsPoolResponse): unknown { + toJSON(message: QueryRewardsPoolResponse): JsonSafe { const obj: any = {}; if (message.undistributedFunds) { obj.undistributedFunds = message.undistributedFunds.map(e => e ? Coin.toJSON(e) : undefined); @@ -895,12 +896,12 @@ export const QueryRewardsPoolResponse = { if (message.undistributedFunds) { obj.undistributed_funds = message.undistributedFunds.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.undistributed_funds = []; + obj.undistributed_funds = message.undistributedFunds; } if (message.treasuryFunds) { obj.treasury_funds = message.treasuryFunds.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.treasury_funds = []; + obj.treasury_funds = message.treasuryFunds; } return obj; }, @@ -963,7 +964,7 @@ export const QueryEstimateTxFeesRequest = { contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" }; }, - toJSON(message: QueryEstimateTxFeesRequest): unknown { + toJSON(message: QueryEstimateTxFeesRequest): JsonSafe { const obj: any = {}; message.gasLimit !== undefined && (obj.gasLimit = (message.gasLimit || BigInt(0)).toString()); message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); @@ -987,8 +988,8 @@ export const QueryEstimateTxFeesRequest = { }, toAmino(message: QueryEstimateTxFeesRequest): QueryEstimateTxFeesRequestAmino { const obj: any = {}; - obj.gas_limit = message.gasLimit ? message.gasLimit.toString() : undefined; - obj.contract_address = message.contractAddress; + obj.gas_limit = message.gasLimit !== BigInt(0) ? message.gasLimit.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; return obj; }, fromAminoMsg(object: QueryEstimateTxFeesRequestAminoMsg): QueryEstimateTxFeesRequest { @@ -1050,7 +1051,7 @@ export const QueryEstimateTxFeesResponse = { estimatedFee: Array.isArray(object?.estimatedFee) ? object.estimatedFee.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: QueryEstimateTxFeesResponse): unknown { + toJSON(message: QueryEstimateTxFeesResponse): JsonSafe { const obj: any = {}; message.gasUnitPrice !== undefined && (obj.gasUnitPrice = message.gasUnitPrice ? DecCoin.toJSON(message.gasUnitPrice) : undefined); if (message.estimatedFee) { @@ -1080,7 +1081,7 @@ export const QueryEstimateTxFeesResponse = { if (message.estimatedFee) { obj.estimated_fee = message.estimatedFee.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.estimated_fee = []; + obj.estimated_fee = message.estimatedFee; } return obj; }, @@ -1143,7 +1144,7 @@ export const BlockTracking = { txRewards: Array.isArray(object?.txRewards) ? object.txRewards.map((e: any) => TxRewards.fromJSON(e)) : [] }; }, - toJSON(message: BlockTracking): unknown { + toJSON(message: BlockTracking): JsonSafe { const obj: any = {}; message.inflationRewards !== undefined && (obj.inflationRewards = message.inflationRewards ? BlockRewards.toJSON(message.inflationRewards) : undefined); if (message.txRewards) { @@ -1173,7 +1174,7 @@ export const BlockTracking = { if (message.txRewards) { obj.tx_rewards = message.txRewards.map(e => e ? TxRewards.toAmino(e) : undefined); } else { - obj.tx_rewards = []; + obj.tx_rewards = message.txRewards; } return obj; }, @@ -1236,7 +1237,7 @@ export const QueryRewardsRecordsRequest = { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryRewardsRecordsRequest): unknown { + toJSON(message: QueryRewardsRecordsRequest): JsonSafe { const obj: any = {}; message.rewardsAddress !== undefined && (obj.rewardsAddress = message.rewardsAddress); message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); @@ -1260,7 +1261,7 @@ export const QueryRewardsRecordsRequest = { }, toAmino(message: QueryRewardsRecordsRequest): QueryRewardsRecordsRequestAmino { const obj: any = {}; - obj.rewards_address = message.rewardsAddress; + obj.rewards_address = message.rewardsAddress === "" ? undefined : message.rewardsAddress; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; return obj; }, @@ -1323,7 +1324,7 @@ export const QueryRewardsRecordsResponse = { pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryRewardsRecordsResponse): unknown { + toJSON(message: QueryRewardsRecordsResponse): JsonSafe { const obj: any = {}; if (message.records) { obj.records = message.records.map(e => e ? RewardsRecord.toJSON(e) : undefined); @@ -1352,7 +1353,7 @@ export const QueryRewardsRecordsResponse = { if (message.records) { obj.records = message.records.map(e => e ? RewardsRecord.toAmino(e) : undefined); } else { - obj.records = []; + obj.records = message.records; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; @@ -1408,7 +1409,7 @@ export const QueryOutstandingRewardsRequest = { rewardsAddress: isSet(object.rewardsAddress) ? String(object.rewardsAddress) : "" }; }, - toJSON(message: QueryOutstandingRewardsRequest): unknown { + toJSON(message: QueryOutstandingRewardsRequest): JsonSafe { const obj: any = {}; message.rewardsAddress !== undefined && (obj.rewardsAddress = message.rewardsAddress); return obj; @@ -1427,7 +1428,7 @@ export const QueryOutstandingRewardsRequest = { }, toAmino(message: QueryOutstandingRewardsRequest): QueryOutstandingRewardsRequestAmino { const obj: any = {}; - obj.rewards_address = message.rewardsAddress; + obj.rewards_address = message.rewardsAddress === "" ? undefined : message.rewardsAddress; return obj; }, fromAminoMsg(object: QueryOutstandingRewardsRequestAminoMsg): QueryOutstandingRewardsRequest { @@ -1489,7 +1490,7 @@ export const QueryOutstandingRewardsResponse = { recordsNum: isSet(object.recordsNum) ? BigInt(object.recordsNum.toString()) : BigInt(0) }; }, - toJSON(message: QueryOutstandingRewardsResponse): unknown { + toJSON(message: QueryOutstandingRewardsResponse): JsonSafe { const obj: any = {}; if (message.totalRewards) { obj.totalRewards = message.totalRewards.map(e => e ? Coin.toJSON(e) : undefined); @@ -1518,9 +1519,9 @@ export const QueryOutstandingRewardsResponse = { if (message.totalRewards) { obj.total_rewards = message.totalRewards.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.total_rewards = []; + obj.total_rewards = message.totalRewards; } - obj.records_num = message.recordsNum ? message.recordsNum.toString() : undefined; + obj.records_num = message.recordsNum !== BigInt(0) ? message.recordsNum.toString() : undefined; return obj; }, fromAminoMsg(object: QueryOutstandingRewardsResponseAminoMsg): QueryOutstandingRewardsResponse { @@ -1574,7 +1575,7 @@ export const QueryFlatFeeRequest = { contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" }; }, - toJSON(message: QueryFlatFeeRequest): unknown { + toJSON(message: QueryFlatFeeRequest): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); return obj; @@ -1593,7 +1594,7 @@ export const QueryFlatFeeRequest = { }, toAmino(message: QueryFlatFeeRequest): QueryFlatFeeRequestAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; return obj; }, fromAminoMsg(object: QueryFlatFeeRequestAminoMsg): QueryFlatFeeRequest { @@ -1647,7 +1648,7 @@ export const QueryFlatFeeResponse = { flatFeeAmount: isSet(object.flatFeeAmount) ? Coin.fromJSON(object.flatFeeAmount) : undefined }; }, - toJSON(message: QueryFlatFeeResponse): unknown { + toJSON(message: QueryFlatFeeResponse): JsonSafe { const obj: any = {}; message.flatFeeAmount !== undefined && (obj.flatFeeAmount = message.flatFeeAmount ? Coin.toJSON(message.flatFeeAmount) : undefined); return obj; diff --git a/packages/arch3-proto/generated/archway/rewards/v1/rewards.ts b/packages/arch3-proto/generated/archway/rewards/v1/rewards.ts index d4eeae0..e6f31a1 100644 --- a/packages/arch3-proto/generated/archway/rewards/v1/rewards.ts +++ b/packages/arch3-proto/generated/archway/rewards/v1/rewards.ts @@ -4,6 +4,7 @@ import { Timestamp } from "../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { Decimal } from "@cosmjs/math"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; /** Params defines the module parameters. */ export interface Params { /** @@ -319,7 +320,7 @@ export const Params = { minPriceOfGas: isSet(object.minPriceOfGas) ? DecCoin.fromJSON(object.minPriceOfGas) : undefined }; }, - toJSON(message: Params): unknown { + toJSON(message: Params): JsonSafe { const obj: any = {}; message.inflationRewardsRatio !== undefined && (obj.inflationRewardsRatio = message.inflationRewardsRatio); message.txFeeRebateRatio !== undefined && (obj.txFeeRebateRatio = message.txFeeRebateRatio); @@ -353,9 +354,9 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.inflation_rewards_ratio = message.inflationRewardsRatio; - obj.tx_fee_rebate_ratio = message.txFeeRebateRatio; - obj.max_withdraw_records = message.maxWithdrawRecords ? message.maxWithdrawRecords.toString() : undefined; + obj.inflation_rewards_ratio = message.inflationRewardsRatio === "" ? undefined : message.inflationRewardsRatio; + obj.tx_fee_rebate_ratio = message.txFeeRebateRatio === "" ? undefined : message.txFeeRebateRatio; + obj.max_withdraw_records = message.maxWithdrawRecords !== BigInt(0) ? message.maxWithdrawRecords.toString() : undefined; obj.min_price_of_gas = message.minPriceOfGas ? DecCoin.toAmino(message.minPriceOfGas) : undefined; return obj; }, @@ -434,7 +435,7 @@ export const ContractMetadata = { withdrawToWallet: isSet(object.withdrawToWallet) ? Boolean(object.withdrawToWallet) : false }; }, - toJSON(message: ContractMetadata): unknown { + toJSON(message: ContractMetadata): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); message.ownerAddress !== undefined && (obj.ownerAddress = message.ownerAddress); @@ -468,10 +469,10 @@ export const ContractMetadata = { }, toAmino(message: ContractMetadata): ContractMetadataAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; - obj.owner_address = message.ownerAddress; - obj.rewards_address = message.rewardsAddress; - obj.withdraw_to_wallet = message.withdrawToWallet; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.owner_address = message.ownerAddress === "" ? undefined : message.ownerAddress; + obj.rewards_address = message.rewardsAddress === "" ? undefined : message.rewardsAddress; + obj.withdraw_to_wallet = message.withdrawToWallet === false ? undefined : message.withdrawToWallet; return obj; }, fromAminoMsg(object: ContractMetadataAminoMsg): ContractMetadata { @@ -541,7 +542,7 @@ export const BlockRewards = { maxGas: isSet(object.maxGas) ? BigInt(object.maxGas.toString()) : BigInt(0) }; }, - toJSON(message: BlockRewards): unknown { + toJSON(message: BlockRewards): JsonSafe { const obj: any = {}; message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); message.inflationRewards !== undefined && (obj.inflationRewards = message.inflationRewards ? Coin.toJSON(message.inflationRewards) : undefined); @@ -570,9 +571,9 @@ export const BlockRewards = { }, toAmino(message: BlockRewards): BlockRewardsAmino { const obj: any = {}; - obj.height = message.height ? message.height.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.inflation_rewards = message.inflationRewards ? Coin.toAmino(message.inflationRewards) : undefined; - obj.max_gas = message.maxGas ? message.maxGas.toString() : undefined; + obj.max_gas = message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; return obj; }, fromAminoMsg(object: BlockRewardsAminoMsg): BlockRewards { @@ -642,7 +643,7 @@ export const TxRewards = { feeRewards: Array.isArray(object?.feeRewards) ? object.feeRewards.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: TxRewards): unknown { + toJSON(message: TxRewards): JsonSafe { const obj: any = {}; message.txId !== undefined && (obj.txId = (message.txId || BigInt(0)).toString()); message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); @@ -673,12 +674,12 @@ export const TxRewards = { }, toAmino(message: TxRewards): TxRewardsAmino { const obj: any = {}; - obj.tx_id = message.txId ? message.txId.toString() : undefined; - obj.height = message.height ? message.height.toString() : undefined; + obj.tx_id = message.txId !== BigInt(0) ? message.txId.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; if (message.feeRewards) { obj.fee_rewards = message.feeRewards.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.fee_rewards = []; + obj.fee_rewards = message.feeRewards; } return obj; }, @@ -765,7 +766,7 @@ export const RewardsRecord = { calculatedTime: isSet(object.calculatedTime) ? fromJsonTimestamp(object.calculatedTime) : undefined }; }, - toJSON(message: RewardsRecord): unknown { + toJSON(message: RewardsRecord): JsonSafe { const obj: any = {}; message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.rewardsAddress !== undefined && (obj.rewardsAddress = message.rewardsAddress); @@ -806,14 +807,14 @@ export const RewardsRecord = { }, toAmino(message: RewardsRecord): RewardsRecordAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.rewards_address = message.rewardsAddress; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.rewards_address = message.rewardsAddress === "" ? undefined : message.rewardsAddress; if (message.rewards) { obj.rewards = message.rewards.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.rewards = []; + obj.rewards = message.rewards; } - obj.calculated_height = message.calculatedHeight ? message.calculatedHeight.toString() : undefined; + obj.calculated_height = message.calculatedHeight !== BigInt(0) ? message.calculatedHeight.toString() : undefined; obj.calculated_time = message.calculatedTime ? Timestamp.toAmino(message.calculatedTime) : undefined; return obj; }, @@ -876,7 +877,7 @@ export const FlatFee = { flatFee: isSet(object.flatFee) ? Coin.fromJSON(object.flatFee) : undefined }; }, - toJSON(message: FlatFee): unknown { + toJSON(message: FlatFee): JsonSafe { const obj: any = {}; message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); message.flatFee !== undefined && (obj.flatFee = message.flatFee ? Coin.toJSON(message.flatFee) : undefined); @@ -900,7 +901,7 @@ export const FlatFee = { }, toAmino(message: FlatFee): FlatFeeAmino { const obj: any = {}; - obj.contract_address = message.contractAddress; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; obj.flat_fee = message.flatFee ? Coin.toAmino(message.flatFee) : undefined; return obj; }, diff --git a/packages/arch3-proto/generated/archway/rewards/v1/tx.ts b/packages/arch3-proto/generated/archway/rewards/v1/tx.ts index eec1146..2cb89d5 100644 --- a/packages/arch3-proto/generated/archway/rewards/v1/tx.ts +++ b/packages/arch3-proto/generated/archway/rewards/v1/tx.ts @@ -3,6 +3,7 @@ import { ContractMetadata, ContractMetadataAmino, Params, ParamsAmino } from "./ import { Coin, CoinAmino } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; /** MsgSetContractMetadata is the request for Msg.SetContractMetadata. */ export interface MsgSetContractMetadata { /** sender_address is the msg sender address (bech32 encoded). */ @@ -266,7 +267,7 @@ export const MsgSetContractMetadata = { metadata: isSet(object.metadata) ? ContractMetadata.fromJSON(object.metadata) : undefined }; }, - toJSON(message: MsgSetContractMetadata): unknown { + toJSON(message: MsgSetContractMetadata): JsonSafe { const obj: any = {}; message.senderAddress !== undefined && (obj.senderAddress = message.senderAddress); message.metadata !== undefined && (obj.metadata = message.metadata ? ContractMetadata.toJSON(message.metadata) : undefined); @@ -290,7 +291,7 @@ export const MsgSetContractMetadata = { }, toAmino(message: MsgSetContractMetadata): MsgSetContractMetadataAmino { const obj: any = {}; - obj.sender_address = message.senderAddress; + obj.sender_address = message.senderAddress === "" ? undefined : message.senderAddress; obj.metadata = message.metadata ? ContractMetadata.toAmino(message.metadata) : undefined; return obj; }, @@ -335,7 +336,7 @@ export const MsgSetContractMetadataResponse = { fromJSON(_: any): MsgSetContractMetadataResponse { return {}; }, - toJSON(_: MsgSetContractMetadataResponse): unknown { + toJSON(_: MsgSetContractMetadataResponse): JsonSafe { const obj: any = {}; return obj; }, @@ -418,7 +419,7 @@ export const MsgWithdrawRewards = { recordIds: isSet(object.recordIds) ? MsgWithdrawRewards_RecordIDs.fromJSON(object.recordIds) : undefined }; }, - toJSON(message: MsgWithdrawRewards): unknown { + toJSON(message: MsgWithdrawRewards): JsonSafe { const obj: any = {}; message.rewardsAddress !== undefined && (obj.rewardsAddress = message.rewardsAddress); message.recordsLimit !== undefined && (obj.recordsLimit = message.recordsLimit ? MsgWithdrawRewards_RecordsLimit.toJSON(message.recordsLimit) : undefined); @@ -447,7 +448,7 @@ export const MsgWithdrawRewards = { }, toAmino(message: MsgWithdrawRewards): MsgWithdrawRewardsAmino { const obj: any = {}; - obj.rewards_address = message.rewardsAddress; + obj.rewards_address = message.rewardsAddress === "" ? undefined : message.rewardsAddress; obj.records_limit = message.recordsLimit ? MsgWithdrawRewards_RecordsLimit.toAmino(message.recordsLimit) : undefined; obj.record_ids = message.recordIds ? MsgWithdrawRewards_RecordIDs.toAmino(message.recordIds) : undefined; return obj; @@ -503,7 +504,7 @@ export const MsgWithdrawRewards_RecordsLimit = { limit: isSet(object.limit) ? BigInt(object.limit.toString()) : BigInt(0) }; }, - toJSON(message: MsgWithdrawRewards_RecordsLimit): unknown { + toJSON(message: MsgWithdrawRewards_RecordsLimit): JsonSafe { const obj: any = {}; message.limit !== undefined && (obj.limit = (message.limit || BigInt(0)).toString()); return obj; @@ -522,7 +523,7 @@ export const MsgWithdrawRewards_RecordsLimit = { }, toAmino(message: MsgWithdrawRewards_RecordsLimit): MsgWithdrawRewards_RecordsLimitAmino { const obj: any = {}; - obj.limit = message.limit ? message.limit.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; return obj; }, fromAminoMsg(object: MsgWithdrawRewards_RecordsLimitAminoMsg): MsgWithdrawRewards_RecordsLimit { @@ -585,7 +586,7 @@ export const MsgWithdrawRewards_RecordIDs = { ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => BigInt(e.toString())) : [] }; }, - toJSON(message: MsgWithdrawRewards_RecordIDs): unknown { + toJSON(message: MsgWithdrawRewards_RecordIDs): JsonSafe { const obj: any = {}; if (message.ids) { obj.ids = message.ids.map(e => (e || BigInt(0)).toString()); @@ -609,7 +610,7 @@ export const MsgWithdrawRewards_RecordIDs = { if (message.ids) { obj.ids = message.ids.map(e => e.toString()); } else { - obj.ids = []; + obj.ids = message.ids; } return obj; }, @@ -672,7 +673,7 @@ export const MsgWithdrawRewardsResponse = { totalRewards: Array.isArray(object?.totalRewards) ? object.totalRewards.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: MsgWithdrawRewardsResponse): unknown { + toJSON(message: MsgWithdrawRewardsResponse): JsonSafe { const obj: any = {}; message.recordsNum !== undefined && (obj.recordsNum = (message.recordsNum || BigInt(0)).toString()); if (message.totalRewards) { @@ -698,11 +699,11 @@ export const MsgWithdrawRewardsResponse = { }, toAmino(message: MsgWithdrawRewardsResponse): MsgWithdrawRewardsResponseAmino { const obj: any = {}; - obj.records_num = message.recordsNum ? message.recordsNum.toString() : undefined; + obj.records_num = message.recordsNum !== BigInt(0) ? message.recordsNum.toString() : undefined; if (message.totalRewards) { obj.total_rewards = message.totalRewards.map(e => e ? Coin.toAmino(e) : undefined); } else { - obj.total_rewards = []; + obj.total_rewards = message.totalRewards; } return obj; }, @@ -773,7 +774,7 @@ export const MsgSetFlatFee = { flatFeeAmount: isSet(object.flatFeeAmount) ? Coin.fromJSON(object.flatFeeAmount) : undefined }; }, - toJSON(message: MsgSetFlatFee): unknown { + toJSON(message: MsgSetFlatFee): JsonSafe { const obj: any = {}; message.senderAddress !== undefined && (obj.senderAddress = message.senderAddress); message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); @@ -802,8 +803,8 @@ export const MsgSetFlatFee = { }, toAmino(message: MsgSetFlatFee): MsgSetFlatFeeAmino { const obj: any = {}; - obj.sender_address = message.senderAddress; - obj.contract_address = message.contractAddress; + obj.sender_address = message.senderAddress === "" ? undefined : message.senderAddress; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; obj.flat_fee_amount = message.flatFeeAmount ? Coin.toAmino(message.flatFeeAmount) : undefined; return obj; }, @@ -848,7 +849,7 @@ export const MsgSetFlatFeeResponse = { fromJSON(_: any): MsgSetFlatFeeResponse { return {}; }, - toJSON(_: MsgSetFlatFeeResponse): unknown { + toJSON(_: MsgSetFlatFeeResponse): JsonSafe { const obj: any = {}; return obj; }, @@ -923,7 +924,7 @@ export const MsgUpdateParams = { params: isSet(object.params) ? Params.fromJSON(object.params) : undefined }; }, - toJSON(message: MsgUpdateParams): unknown { + toJSON(message: MsgUpdateParams): JsonSafe { const obj: any = {}; message.authority !== undefined && (obj.authority = message.authority); message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); @@ -947,7 +948,7 @@ export const MsgUpdateParams = { }, toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { const obj: any = {}; - obj.authority = message.authority; + obj.authority = message.authority === "" ? undefined : message.authority; obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; }, @@ -992,7 +993,7 @@ export const MsgUpdateParamsResponse = { fromJSON(_: any): MsgUpdateParamsResponse { return {}; }, - toJSON(_: MsgUpdateParamsResponse): unknown { + toJSON(_: MsgUpdateParamsResponse): JsonSafe { const obj: any = {}; return obj; }, diff --git a/packages/arch3-proto/generated/archway/tracking/v1/genesis.ts b/packages/arch3-proto/generated/archway/tracking/v1/genesis.ts index c00b2e4..12f6646 100644 --- a/packages/arch3-proto/generated/archway/tracking/v1/genesis.ts +++ b/packages/arch3-proto/generated/archway/tracking/v1/genesis.ts @@ -2,6 +2,7 @@ import { TxInfo, TxInfoAmino, ContractOperationInfo, ContractOperationInfoAmino } from "./tracking"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; /** GenesisState defines the initial state of the tracking module. */ export interface GenesisState { /** tx_info_last_id defines the last unique ID for a TxInfo objs. */ @@ -97,7 +98,7 @@ export const GenesisState = { contractOpInfos: Array.isArray(object?.contractOpInfos) ? object.contractOpInfos.map((e: any) => ContractOperationInfo.fromJSON(e)) : [] }; }, - toJSON(message: GenesisState): unknown { + toJSON(message: GenesisState): JsonSafe { const obj: any = {}; message.txInfoLastId !== undefined && (obj.txInfoLastId = (message.txInfoLastId || BigInt(0)).toString()); if (message.txInfos) { @@ -135,17 +136,17 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.tx_info_last_id = message.txInfoLastId ? message.txInfoLastId.toString() : undefined; + obj.tx_info_last_id = message.txInfoLastId !== BigInt(0) ? message.txInfoLastId.toString() : undefined; if (message.txInfos) { obj.tx_infos = message.txInfos.map(e => e ? TxInfo.toAmino(e) : undefined); } else { - obj.tx_infos = []; + obj.tx_infos = message.txInfos; } - obj.contract_op_info_last_id = message.contractOpInfoLastId ? message.contractOpInfoLastId.toString() : undefined; + obj.contract_op_info_last_id = message.contractOpInfoLastId !== BigInt(0) ? message.contractOpInfoLastId.toString() : undefined; if (message.contractOpInfos) { obj.contract_op_infos = message.contractOpInfos.map(e => e ? ContractOperationInfo.toAmino(e) : undefined); } else { - obj.contract_op_infos = []; + obj.contract_op_infos = message.contractOpInfos; } return obj; }, diff --git a/packages/arch3-proto/generated/archway/tracking/v1/query.ts b/packages/arch3-proto/generated/archway/tracking/v1/query.ts index 0b0723e..f0f3b77 100644 --- a/packages/arch3-proto/generated/archway/tracking/v1/query.ts +++ b/packages/arch3-proto/generated/archway/tracking/v1/query.ts @@ -1,6 +1,7 @@ /* eslint-disable */ import { BlockTracking, BlockTrackingAmino } from "./tracking"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { JsonSafe } from "../../../json-safe"; import { isSet } from "../../../helpers"; /** QueryBlockGasTrackingRequest is the request for Query.BlockGasTracking. */ export interface QueryBlockGasTrackingRequest {} @@ -55,7 +56,7 @@ export const QueryBlockGasTrackingRequest = { fromJSON(_: any): QueryBlockGasTrackingRequest { return {}; }, - toJSON(_: QueryBlockGasTrackingRequest): unknown { + toJSON(_: QueryBlockGasTrackingRequest): JsonSafe { const obj: any = {}; return obj; }, @@ -122,7 +123,7 @@ export const QueryBlockGasTrackingResponse = { block: isSet(object.block) ? BlockTracking.fromJSON(object.block) : undefined }; }, - toJSON(message: QueryBlockGasTrackingResponse): unknown { + toJSON(message: QueryBlockGasTrackingResponse): JsonSafe { const obj: any = {}; message.block !== undefined && (obj.block = message.block ? BlockTracking.toJSON(message.block) : undefined); return obj; diff --git a/packages/arch3-proto/generated/archway/tracking/v1/tracking.ts b/packages/arch3-proto/generated/archway/tracking/v1/tracking.ts index e732c79..fbb40b5 100644 --- a/packages/arch3-proto/generated/archway/tracking/v1/tracking.ts +++ b/packages/arch3-proto/generated/archway/tracking/v1/tracking.ts @@ -1,6 +1,7 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; /** ContractOperation denotes which operation consumed gas. */ export enum ContractOperation { /** CONTRACT_OPERATION_UNSPECIFIED - Invalid or unknown operation */ @@ -270,7 +271,7 @@ export const TxInfo = { totalGas: isSet(object.totalGas) ? BigInt(object.totalGas.toString()) : BigInt(0) }; }, - toJSON(message: TxInfo): unknown { + toJSON(message: TxInfo): JsonSafe { const obj: any = {}; message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); @@ -299,9 +300,9 @@ export const TxInfo = { }, toAmino(message: TxInfo): TxInfoAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.height = message.height ? message.height.toString() : undefined; - obj.total_gas = message.totalGas ? message.totalGas.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.total_gas = message.totalGas !== BigInt(0) ? message.totalGas.toString() : undefined; return obj; }, fromAminoMsg(object: TxInfoAminoMsg): TxInfo { @@ -395,7 +396,7 @@ export const ContractOperationInfo = { sdkGas: isSet(object.sdkGas) ? BigInt(object.sdkGas.toString()) : BigInt(0) }; }, - toJSON(message: ContractOperationInfo): unknown { + toJSON(message: ContractOperationInfo): JsonSafe { const obj: any = {}; message.id !== undefined && (obj.id = (message.id || BigInt(0)).toString()); message.txId !== undefined && (obj.txId = (message.txId || BigInt(0)).toString()); @@ -427,7 +428,7 @@ export const ContractOperationInfo = { message.contractAddress = object.contract_address; } if (object.operation_type !== undefined && object.operation_type !== null) { - message.operationType = contractOperationFromJSON(object.operation_type); + message.operationType = object.operation_type; } if (object.vm_gas !== undefined && object.vm_gas !== null) { message.vmGas = BigInt(object.vm_gas); @@ -439,12 +440,12 @@ export const ContractOperationInfo = { }, toAmino(message: ContractOperationInfo): ContractOperationInfoAmino { const obj: any = {}; - obj.id = message.id ? message.id.toString() : undefined; - obj.tx_id = message.txId ? message.txId.toString() : undefined; - obj.contract_address = message.contractAddress; - obj.operation_type = message.operationType; - obj.vm_gas = message.vmGas ? message.vmGas.toString() : undefined; - obj.sdk_gas = message.sdkGas ? message.sdkGas.toString() : undefined; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.tx_id = message.txId !== BigInt(0) ? message.txId.toString() : undefined; + obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; + obj.operation_type = message.operationType === 0 ? undefined : message.operationType; + obj.vm_gas = message.vmGas !== BigInt(0) ? message.vmGas.toString() : undefined; + obj.sdk_gas = message.sdkGas !== BigInt(0) ? message.sdkGas.toString() : undefined; return obj; }, fromAminoMsg(object: ContractOperationInfoAminoMsg): ContractOperationInfo { @@ -498,7 +499,7 @@ export const BlockTracking = { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => TxTracking.fromJSON(e)) : [] }; }, - toJSON(message: BlockTracking): unknown { + toJSON(message: BlockTracking): JsonSafe { const obj: any = {}; if (message.txs) { obj.txs = message.txs.map(e => e ? TxTracking.toJSON(e) : undefined); @@ -522,7 +523,7 @@ export const BlockTracking = { if (message.txs) { obj.txs = message.txs.map(e => e ? TxTracking.toAmino(e) : undefined); } else { - obj.txs = []; + obj.txs = message.txs; } return obj; }, @@ -585,7 +586,7 @@ export const TxTracking = { contractOperations: Array.isArray(object?.contractOperations) ? object.contractOperations.map((e: any) => ContractOperationInfo.fromJSON(e)) : [] }; }, - toJSON(message: TxTracking): unknown { + toJSON(message: TxTracking): JsonSafe { const obj: any = {}; message.info !== undefined && (obj.info = message.info ? TxInfo.toJSON(message.info) : undefined); if (message.contractOperations) { @@ -615,7 +616,7 @@ export const TxTracking = { if (message.contractOperations) { obj.contract_operations = message.contractOperations.map(e => e ? ContractOperationInfo.toAmino(e) : undefined); } else { - obj.contract_operations = []; + obj.contract_operations = message.contractOperations; } return obj; }, diff --git a/packages/arch3-proto/generated/binary.ts b/packages/arch3-proto/generated/binary.ts index 38c2949..4d35945 100644 --- a/packages/arch3-proto/generated/binary.ts +++ b/packages/arch3-proto/generated/binary.ts @@ -1,8 +1,8 @@ /* eslint-disable */ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain -* and run the transpile command or yarn proto command to regenerate this bundle. +* and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/packages/arch3-proto/generated/cosmos/base/query/v1beta1/pagination.ts b/packages/arch3-proto/generated/cosmos/base/query/v1beta1/pagination.ts index a7f883a..3874d08 100644 --- a/packages/arch3-proto/generated/cosmos/base/query/v1beta1/pagination.ts +++ b/packages/arch3-proto/generated/cosmos/base/query/v1beta1/pagination.ts @@ -1,6 +1,7 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { JsonSafe } from "../../../../json-safe"; /** * PageRequest is to be embedded in gRPC request messages for efficient * pagination. Ex: @@ -210,7 +211,7 @@ export const PageRequest = { reverse: isSet(object.reverse) ? Boolean(object.reverse) : false }; }, - toJSON(message: PageRequest): unknown { + toJSON(message: PageRequest): JsonSafe { const obj: any = {}; message.key !== undefined && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array())); message.offset !== undefined && (obj.offset = (message.offset || BigInt(0)).toString()); @@ -250,10 +251,10 @@ export const PageRequest = { toAmino(message: PageRequest): PageRequestAmino { const obj: any = {}; obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.offset = message.offset ? message.offset.toString() : undefined; - obj.limit = message.limit ? message.limit.toString() : undefined; - obj.count_total = message.countTotal; - obj.reverse = message.reverse; + obj.offset = message.offset !== BigInt(0) ? message.offset.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; + obj.count_total = message.countTotal === false ? undefined : message.countTotal; + obj.reverse = message.reverse === false ? undefined : message.reverse; return obj; }, fromAminoMsg(object: PageRequestAminoMsg): PageRequest { @@ -321,7 +322,7 @@ export const PageResponse = { total: isSet(object.total) ? BigInt(object.total.toString()) : BigInt(0) }; }, - toJSON(message: PageResponse): unknown { + toJSON(message: PageResponse): JsonSafe { const obj: any = {}; message.nextKey !== undefined && (obj.nextKey = base64FromBytes(message.nextKey !== undefined ? message.nextKey : new Uint8Array())); message.total !== undefined && (obj.total = (message.total || BigInt(0)).toString()); @@ -346,7 +347,7 @@ export const PageResponse = { toAmino(message: PageResponse): PageResponseAmino { const obj: any = {}; obj.next_key = message.nextKey ? base64FromBytes(message.nextKey) : undefined; - obj.total = message.total ? message.total.toString() : undefined; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; return obj; }, fromAminoMsg(object: PageResponseAminoMsg): PageResponse { diff --git a/packages/arch3-proto/generated/cosmos/base/v1beta1/coin.ts b/packages/arch3-proto/generated/cosmos/base/v1beta1/coin.ts index 5260f24..da9c2b1 100644 --- a/packages/arch3-proto/generated/cosmos/base/v1beta1/coin.ts +++ b/packages/arch3-proto/generated/cosmos/base/v1beta1/coin.ts @@ -1,6 +1,8 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../../binary"; import { isSet } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +import { Decimal } from "@cosmjs/math"; /** * Coin defines a token with a denomination and an amount. * @@ -57,7 +59,10 @@ export interface DecCoinAminoMsg { type: "cosmos-sdk/DecCoin"; value: DecCoinAmino; } -/** IntProto defines a Protobuf wrapper around an Int object. */ +/** + * IntProto defines a Protobuf wrapper around an Int object. + * Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. + */ export interface IntProto { int: string; } @@ -65,7 +70,10 @@ export interface IntProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.IntProto"; value: Uint8Array; } -/** IntProto defines a Protobuf wrapper around an Int object. */ +/** + * IntProto defines a Protobuf wrapper around an Int object. + * Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. + */ export interface IntProtoAmino { int?: string; } @@ -73,7 +81,10 @@ export interface IntProtoAminoMsg { type: "cosmos-sdk/IntProto"; value: IntProtoAmino; } -/** DecProto defines a Protobuf wrapper around a Dec object. */ +/** + * DecProto defines a Protobuf wrapper around a Dec object. + * Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. + */ export interface DecProto { dec: string; } @@ -81,7 +92,10 @@ export interface DecProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.DecProto"; value: Uint8Array; } -/** DecProto defines a Protobuf wrapper around a Dec object. */ +/** + * DecProto defines a Protobuf wrapper around a Dec object. + * Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. + */ export interface DecProtoAmino { dec?: string; } @@ -132,7 +146,7 @@ export const Coin = { amount: isSet(object.amount) ? String(object.amount) : "" }; }, - toJSON(message: Coin): unknown { + toJSON(message: Coin): JsonSafe { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); message.amount !== undefined && (obj.amount = message.amount); @@ -156,7 +170,7 @@ export const Coin = { }, toAmino(message: Coin): CoinAmino { const obj: any = {}; - obj.denom = message.denom; + obj.denom = message.denom === "" ? undefined : message.denom; obj.amount = message.amount ?? ""; return obj; }, @@ -195,7 +209,7 @@ export const DecCoin = { writer.uint32(10).string(message.denom); } if (message.amount !== "") { - writer.uint32(18).string(message.amount); + writer.uint32(18).string(Decimal.fromUserInput(message.amount, 18).atomics); } return writer; }, @@ -210,7 +224,7 @@ export const DecCoin = { message.denom = reader.string(); break; case 2: - message.amount = reader.string(); + message.amount = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -225,7 +239,7 @@ export const DecCoin = { amount: isSet(object.amount) ? String(object.amount) : "" }; }, - toJSON(message: DecCoin): unknown { + toJSON(message: DecCoin): JsonSafe { const obj: any = {}; message.denom !== undefined && (obj.denom = message.denom); message.amount !== undefined && (obj.amount = message.amount); @@ -249,8 +263,8 @@ export const DecCoin = { }, toAmino(message: DecCoin): DecCoinAmino { const obj: any = {}; - obj.denom = message.denom; - obj.amount = message.amount; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.amount = message.amount === "" ? undefined : message.amount; return obj; }, fromAminoMsg(object: DecCoinAminoMsg): DecCoin { @@ -310,7 +324,7 @@ export const IntProto = { int: isSet(object.int) ? String(object.int) : "" }; }, - toJSON(message: IntProto): unknown { + toJSON(message: IntProto): JsonSafe { const obj: any = {}; message.int !== undefined && (obj.int = message.int); return obj; @@ -329,7 +343,7 @@ export const IntProto = { }, toAmino(message: IntProto): IntProtoAmino { const obj: any = {}; - obj.int = message.int; + obj.int = message.int === "" ? undefined : message.int; return obj; }, fromAminoMsg(object: IntProtoAminoMsg): IntProto { @@ -363,7 +377,7 @@ export const DecProto = { typeUrl: "/cosmos.base.v1beta1.DecProto", encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.dec !== "") { - writer.uint32(10).string(message.dec); + writer.uint32(10).string(Decimal.fromUserInput(message.dec, 18).atomics); } return writer; }, @@ -375,7 +389,7 @@ export const DecProto = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dec = reader.string(); + message.dec = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -389,7 +403,7 @@ export const DecProto = { dec: isSet(object.dec) ? String(object.dec) : "" }; }, - toJSON(message: DecProto): unknown { + toJSON(message: DecProto): JsonSafe { const obj: any = {}; message.dec !== undefined && (obj.dec = message.dec); return obj; @@ -408,7 +422,7 @@ export const DecProto = { }, toAmino(message: DecProto): DecProtoAmino { const obj: any = {}; - obj.dec = message.dec; + obj.dec = message.dec === "" ? undefined : message.dec; return obj; }, fromAminoMsg(object: DecProtoAminoMsg): DecProto { diff --git a/packages/arch3-proto/generated/cosmos/bundle.ts b/packages/arch3-proto/generated/cosmos/bundle.ts index aa24eb9..8bdac39 100644 --- a/packages/arch3-proto/generated/cosmos/bundle.ts +++ b/packages/arch3-proto/generated/cosmos/bundle.ts @@ -1,21 +1,21 @@ /* eslint-disable */ -import * as _9 from "./base/query/v1beta1/pagination"; -import * as _10 from "./base/v1beta1/coin"; -import * as _11 from "./msg/v1/msg"; +import * as _28 from "./base/query/v1beta1/pagination"; +import * as _29 from "./base/v1beta1/coin"; +import * as _30 from "./msg/v1/msg"; export namespace cosmos { export namespace base { export namespace query { export const v1beta1 = { - ..._9 + ..._28 }; } export const v1beta1 = { - ..._10 + ..._29 }; } export namespace msg { export const v1 = { - ..._11 + ..._30 }; } } \ No newline at end of file diff --git a/packages/arch3-proto/generated/cosmos/upgrade/v1beta1/upgrade.ts b/packages/arch3-proto/generated/cosmos/upgrade/v1beta1/upgrade.ts new file mode 100644 index 0000000..29bbb46 --- /dev/null +++ b/packages/arch3-proto/generated/cosmos/upgrade/v1beta1/upgrade.ts @@ -0,0 +1,616 @@ +/* eslint-disable */ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Any, AnyAmino } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { isSet, fromJsonTimestamp, fromTimestamp } from "../../../helpers"; +import { JsonSafe } from "../../../json-safe"; +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface Plan { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + time: Timestamp; + /** The height at which the upgrade must be performed. */ + height: bigint; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgradedClientState?: Any; +} +export interface PlanProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.Plan"; + value: Uint8Array; +} +/** Plan specifies information about a planned upgrade and when it should occur. */ +export interface PlanAmino { + /** + * Sets the name for the upgrade. This name will be used by the upgraded + * version of the software to apply any special "on-upgrade" commands during + * the first BeginBlock method after the upgrade is applied. It is also used + * to detect whether a software version can handle a given upgrade. If no + * upgrade handler with this name has been set in the software, it will be + * assumed that the software is out-of-date when the upgrade Time or Height is + * reached and the software will exit. + */ + name?: string; + /** + * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + * has been removed from the SDK. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + time: string; + /** The height at which the upgrade must be performed. */ + height?: string; + /** + * Any application specific upgrade info to be included on-chain + * such as a git commit that validators could automatically upgrade to + */ + info?: string; + /** + * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + * moved to the IBC module in the sub module 02-client. + * If this field is not empty, an error will be thrown. + */ + /** @deprecated */ + upgraded_client_state?: AnyAmino; +} +export interface PlanAminoMsg { + type: "cosmos-sdk/Plan"; + value: PlanAmino; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; + /** plan of the proposal */ + plan: Plan; +} +export interface SoftwareUpgradeProposalProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * SoftwareUpgradeProposal is a gov Content type for initiating a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. + */ +/** @deprecated */ +export interface SoftwareUpgradeProposalAmino { + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; + /** plan of the proposal */ + plan: PlanAmino; +} +export interface SoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/SoftwareUpgradeProposal"; + value: SoftwareUpgradeProposalAmino; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposal { + $typeUrl?: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + /** title of the proposal */ + title: string; + /** description of the proposal */ + description: string; +} +export interface CancelSoftwareUpgradeProposalProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal"; + value: Uint8Array; +} +/** + * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software + * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. + */ +/** @deprecated */ +export interface CancelSoftwareUpgradeProposalAmino { + /** title of the proposal */ + title?: string; + /** description of the proposal */ + description?: string; +} +export interface CancelSoftwareUpgradeProposalAminoMsg { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal"; + value: CancelSoftwareUpgradeProposalAmino; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersion { + /** name of the app module */ + name: string; + /** consensus version of the app module */ + version: bigint; +} +export interface ModuleVersionProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion"; + value: Uint8Array; +} +/** + * ModuleVersion specifies a module and its consensus version. + * + * Since: cosmos-sdk 0.43 + */ +export interface ModuleVersionAmino { + /** name of the app module */ + name?: string; + /** consensus version of the app module */ + version?: string; +} +export interface ModuleVersionAminoMsg { + type: "cosmos-sdk/ModuleVersion"; + value: ModuleVersionAmino; +} +function createBasePlan(): Plan { + return { + name: "", + time: Timestamp.fromPartial({}), + height: BigInt(0), + info: "", + upgradedClientState: undefined + }; +} +export const Plan = { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + encode(message: Plan, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.time !== undefined) { + Timestamp.encode(message.time, writer.uint32(18).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Plan { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePlan(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.time = Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Plan { + return { + name: isSet(object.name) ? String(object.name) : "", + time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined, + height: isSet(object.height) ? BigInt(object.height.toString()) : BigInt(0), + info: isSet(object.info) ? String(object.info) : "", + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined + }; + }, + toJSON(message: Plan): JsonSafe { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.time !== undefined && (obj.time = fromTimestamp(message.time).toISOString()); + message.height !== undefined && (obj.height = (message.height || BigInt(0)).toString()); + message.info !== undefined && (obj.info = message.info); + message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + fromPartial(object: Partial): Plan { + const message = createBasePlan(); + message.name = object.name ?? ""; + message.time = object.time !== undefined && object.time !== null ? Timestamp.fromPartial(object.time) : undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.info = object.info ?? ""; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: PlanAmino): Plan { + const message = createBasePlan(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.time !== undefined && object.time !== null) { + message.time = Timestamp.fromAmino(object.time); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: Plan): PlanAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.time = message.time ? Timestamp.toAmino(message.time) : Timestamp.toAmino(Timestamp.fromPartial({})); + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.info = message.info === "" ? undefined : message.info; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + return obj; + }, + fromAminoMsg(object: PlanAminoMsg): Plan { + return Plan.fromAmino(object.value); + }, + toAminoMsg(message: Plan): PlanAminoMsg { + return { + type: "cosmos-sdk/Plan", + value: Plan.toAmino(message) + }; + }, + fromProtoMsg(message: PlanProtoMsg): Plan { + return Plan.decode(message.value); + }, + toProto(message: Plan): Uint8Array { + return Plan.encode(message).finish(); + }, + toProtoMsg(message: Plan): PlanProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.Plan", + value: Plan.encode(message).finish() + }; + } +}; +function createBaseSoftwareUpgradeProposal(): SoftwareUpgradeProposal { + return { + $typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + title: "", + description: "", + plan: Plan.fromPartial({}) + }; +} +export const SoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + encode(message: SoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): SoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined + }; + }, + toJSON(message: SoftwareUpgradeProposal): JsonSafe { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + return obj; + }, + fromPartial(object: Partial): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: SoftwareUpgradeProposalAmino): SoftwareUpgradeProposal { + const message = createBaseSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.toAmino(Plan.fromPartial({})); + return obj; + }, + fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SoftwareUpgradeProposalProtoMsg): SoftwareUpgradeProposal { + return SoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: SoftwareUpgradeProposal): Uint8Array { + return SoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: SoftwareUpgradeProposal): SoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", + value: SoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +function createBaseCancelSoftwareUpgradeProposal(): CancelSoftwareUpgradeProposal { + return { + $typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + title: "", + description: "" + }; +} +export const CancelSoftwareUpgradeProposal = { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + encode(message: CancelSoftwareUpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CancelSoftwareUpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCancelSoftwareUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): CancelSoftwareUpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "" + }; + }, + toJSON(message: CancelSoftwareUpgradeProposal): JsonSafe { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + return obj; + }, + fromPartial(object: Partial): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + return message; + }, + fromAmino(object: CancelSoftwareUpgradeProposalAmino): CancelSoftwareUpgradeProposal { + const message = createBaseCancelSoftwareUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + return message; + }, + toAmino(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + return obj; + }, + fromAminoMsg(object: CancelSoftwareUpgradeProposalAminoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: CancelSoftwareUpgradeProposalProtoMsg): CancelSoftwareUpgradeProposal { + return CancelSoftwareUpgradeProposal.decode(message.value); + }, + toProto(message: CancelSoftwareUpgradeProposal): Uint8Array { + return CancelSoftwareUpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: CancelSoftwareUpgradeProposal): CancelSoftwareUpgradeProposalProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", + value: CancelSoftwareUpgradeProposal.encode(message).finish() + }; + } +}; +function createBaseModuleVersion(): ModuleVersion { + return { + name: "", + version: BigInt(0) + }; +} +export const ModuleVersion = { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + encode(message: ModuleVersion, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.version !== BigInt(0)) { + writer.uint32(16).uint64(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleVersion { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleVersion(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.version = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ModuleVersion { + return { + name: isSet(object.name) ? String(object.name) : "", + version: isSet(object.version) ? BigInt(object.version.toString()) : BigInt(0) + }; + }, + toJSON(message: ModuleVersion): JsonSafe { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.version !== undefined && (obj.version = (message.version || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): ModuleVersion { + const message = createBaseModuleVersion(); + message.name = object.name ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ModuleVersionAmino): ModuleVersion { + const message = createBaseModuleVersion(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + return message; + }, + toAmino(message: ModuleVersion): ModuleVersionAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ModuleVersionAminoMsg): ModuleVersion { + return ModuleVersion.fromAmino(object.value); + }, + toAminoMsg(message: ModuleVersion): ModuleVersionAminoMsg { + return { + type: "cosmos-sdk/ModuleVersion", + value: ModuleVersion.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleVersionProtoMsg): ModuleVersion { + return ModuleVersion.decode(message.value); + }, + toProto(message: ModuleVersion): Uint8Array { + return ModuleVersion.encode(message).finish(); + }, + toProtoMsg(message: ModuleVersion): ModuleVersionProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.ModuleVersion", + value: ModuleVersion.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/gogoproto/bundle.ts b/packages/arch3-proto/generated/gogoproto/bundle.ts index 8c0655c..843fe03 100644 --- a/packages/arch3-proto/generated/gogoproto/bundle.ts +++ b/packages/arch3-proto/generated/gogoproto/bundle.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -import * as _12 from "./gogo"; +import * as _31 from "./gogo"; export const gogoproto = { - ..._12 + ..._31 }; \ No newline at end of file diff --git a/packages/arch3-proto/generated/google/api/http.ts b/packages/arch3-proto/generated/google/api/http.ts index e12c964..8df1450 100644 --- a/packages/arch3-proto/generated/google/api/http.ts +++ b/packages/arch3-proto/generated/google/api/http.ts @@ -1,6 +1,7 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet } from "../../helpers"; +import { JsonSafe } from "../../json-safe"; /** * Defines the HTTP configuration for an API service. It contains a list of * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method @@ -780,7 +781,7 @@ export const Http = { fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) ? Boolean(object.fullyDecodeReservedExpansion) : false }; }, - toJSON(message: Http): unknown { + toJSON(message: Http): JsonSafe { const obj: any = {}; if (message.rules) { obj.rules = message.rules.map(e => e ? HttpRule.toJSON(e) : undefined); @@ -809,9 +810,9 @@ export const Http = { if (message.rules) { obj.rules = message.rules.map(e => e ? HttpRule.toAmino(e) : undefined); } else { - obj.rules = []; + obj.rules = message.rules; } - obj.fully_decode_reserved_expansion = message.fullyDecodeReservedExpansion; + obj.fully_decode_reserved_expansion = message.fullyDecodeReservedExpansion === false ? undefined : message.fullyDecodeReservedExpansion; return obj; }, fromAminoMsg(object: HttpAminoMsg): Http { @@ -937,7 +938,7 @@ export const HttpRule = { additionalBindings: Array.isArray(object?.additionalBindings) ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) : [] }; }, - toJSON(message: HttpRule): unknown { + toJSON(message: HttpRule): JsonSafe { const obj: any = {}; message.selector !== undefined && (obj.selector = message.selector); message.get !== undefined && (obj.get = message.get); @@ -1003,19 +1004,19 @@ export const HttpRule = { }, toAmino(message: HttpRule): HttpRuleAmino { const obj: any = {}; - obj.selector = message.selector; - obj.get = message.get; - obj.put = message.put; - obj.post = message.post; - obj.delete = message.delete; - obj.patch = message.patch; + obj.selector = message.selector === "" ? undefined : message.selector; + obj.get = message.get === null ? undefined : message.get; + obj.put = message.put === null ? undefined : message.put; + obj.post = message.post === null ? undefined : message.post; + obj.delete = message.delete === null ? undefined : message.delete; + obj.patch = message.patch === null ? undefined : message.patch; obj.custom = message.custom ? CustomHttpPattern.toAmino(message.custom) : undefined; - obj.body = message.body; - obj.response_body = message.responseBody; + obj.body = message.body === "" ? undefined : message.body; + obj.response_body = message.responseBody === "" ? undefined : message.responseBody; if (message.additionalBindings) { obj.additional_bindings = message.additionalBindings.map(e => e ? HttpRule.toAmino(e) : undefined); } else { - obj.additional_bindings = []; + obj.additional_bindings = message.additionalBindings; } return obj; }, @@ -1078,7 +1079,7 @@ export const CustomHttpPattern = { path: isSet(object.path) ? String(object.path) : "" }; }, - toJSON(message: CustomHttpPattern): unknown { + toJSON(message: CustomHttpPattern): JsonSafe { const obj: any = {}; message.kind !== undefined && (obj.kind = message.kind); message.path !== undefined && (obj.path = message.path); @@ -1102,8 +1103,8 @@ export const CustomHttpPattern = { }, toAmino(message: CustomHttpPattern): CustomHttpPatternAmino { const obj: any = {}; - obj.kind = message.kind; - obj.path = message.path; + obj.kind = message.kind === "" ? undefined : message.kind; + obj.path = message.path === "" ? undefined : message.path; return obj; }, fromAminoMsg(object: CustomHttpPatternAminoMsg): CustomHttpPattern { diff --git a/packages/arch3-proto/generated/google/bundle.ts b/packages/arch3-proto/generated/google/bundle.ts index 99247b1..101f211 100644 --- a/packages/arch3-proto/generated/google/bundle.ts +++ b/packages/arch3-proto/generated/google/bundle.ts @@ -1,11 +1,11 @@ /* eslint-disable */ -import * as _13 from "./protobuf/descriptor"; -import * as _14 from "./protobuf/any"; -import * as _15 from "./protobuf/timestamp"; +import * as _34 from "./protobuf/descriptor"; +import * as _35 from "./protobuf/any"; +import * as _36 from "./protobuf/timestamp"; export namespace google { export const protobuf = { - ..._13, - ..._14, - ..._15 + ..._34, + ..._35, + ..._36 }; } \ No newline at end of file diff --git a/packages/arch3-proto/generated/google/protobuf/any.ts b/packages/arch3-proto/generated/google/protobuf/any.ts index 8eb4832..700ba12 100644 --- a/packages/arch3-proto/generated/google/protobuf/any.ts +++ b/packages/arch3-proto/generated/google/protobuf/any.ts @@ -1,6 +1,7 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; +import { JsonSafe } from "../../json-safe"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. @@ -284,7 +285,7 @@ export const Any = { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() }; }, - toJSON(message: Any): unknown { + toJSON(message: Any): JsonSafe { const obj: any = {}; message.typeUrl !== undefined && (obj.typeUrl = message.typeUrl); message.value !== undefined && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array())); diff --git a/packages/arch3-proto/generated/google/protobuf/descriptor.ts b/packages/arch3-proto/generated/google/protobuf/descriptor.ts index 60aab9b..4748486 100644 --- a/packages/arch3-proto/generated/google/protobuf/descriptor.ts +++ b/packages/arch3-proto/generated/google/protobuf/descriptor.ts @@ -1,5 +1,6 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../binary"; +import { JsonSafe } from "../../json-safe"; import { isSet, bytesFromBase64, base64FromBytes } from "../../helpers"; export enum FieldDescriptorProto_Type { /** @@ -30,6 +31,7 @@ export enum FieldDescriptorProto_Type { * treat group fields as unknown fields. */ TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ TYPE_MESSAGE = 11, /** TYPE_BYTES - New in version 2. */ TYPE_BYTES = 12, @@ -189,12 +191,9 @@ export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_La } /** Generated classes can be optimized for speed or code size. */ export enum FileOptions_OptimizeMode { - /** - * SPEED - Generate complete code for parsing, serialization, - * etc. - */ + /** SPEED - Generate complete code for parsing, serialization, */ SPEED = 1, - /** CODE_SIZE - Use ReflectionOps to implement these methods. */ + /** CODE_SIZE - etc. */ CODE_SIZE = 2, /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ LITE_RUNTIME = 3, @@ -379,6 +378,7 @@ export interface FileDescriptorSetAminoMsg { export interface FileDescriptorProto { /** file name, relative to root of source tree */ name: string; + /** e.g. "foo", "foo.bar", etc. */ package: string; /** Names of files imported by this file. */ dependency: string[]; @@ -416,6 +416,7 @@ export interface FileDescriptorProtoProtoMsg { export interface FileDescriptorProtoAmino { /** file name, relative to root of source tree */ name?: string; + /** e.g. "foo", "foo.bar", etc. */ package?: string; /** Names of files imported by this file. */ dependency?: string[]; @@ -1998,7 +1999,7 @@ export const FileDescriptorSet = { file: Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [] }; }, - toJSON(message: FileDescriptorSet): unknown { + toJSON(message: FileDescriptorSet): JsonSafe { const obj: any = {}; if (message.file) { obj.file = message.file.map(e => e ? FileDescriptorProto.toJSON(e) : undefined); @@ -2022,7 +2023,7 @@ export const FileDescriptorSet = { if (message.file) { obj.file = message.file.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); } else { - obj.file = []; + obj.file = message.file; } return obj; }, @@ -2183,7 +2184,7 @@ export const FileDescriptorProto = { syntax: isSet(object.syntax) ? String(object.syntax) : "" }; }, - toJSON(message: FileDescriptorProto): unknown { + toJSON(message: FileDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.package !== undefined && (obj.package = message.package); @@ -2271,46 +2272,46 @@ export const FileDescriptorProto = { }, toAmino(message: FileDescriptorProto): FileDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; - obj.package = message.package; + obj.name = message.name === "" ? undefined : message.name; + obj.package = message.package === "" ? undefined : message.package; if (message.dependency) { obj.dependency = message.dependency.map(e => e); } else { - obj.dependency = []; + obj.dependency = message.dependency; } if (message.publicDependency) { obj.public_dependency = message.publicDependency.map(e => e); } else { - obj.public_dependency = []; + obj.public_dependency = message.publicDependency; } if (message.weakDependency) { obj.weak_dependency = message.weakDependency.map(e => e); } else { - obj.weak_dependency = []; + obj.weak_dependency = message.weakDependency; } if (message.messageType) { obj.message_type = message.messageType.map(e => e ? DescriptorProto.toAmino(e) : undefined); } else { - obj.message_type = []; + obj.message_type = message.messageType; } if (message.enumType) { obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); } else { - obj.enum_type = []; + obj.enum_type = message.enumType; } if (message.service) { obj.service = message.service.map(e => e ? ServiceDescriptorProto.toAmino(e) : undefined); } else { - obj.service = []; + obj.service = message.service; } if (message.extension) { obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); } else { - obj.extension = []; + obj.extension = message.extension; } obj.options = message.options ? FileOptions.toAmino(message.options) : undefined; obj.source_code_info = message.sourceCodeInfo ? SourceCodeInfo.toAmino(message.sourceCodeInfo) : undefined; - obj.syntax = message.syntax; + obj.syntax = message.syntax === "" ? undefined : message.syntax; return obj; }, fromAminoMsg(object: FileDescriptorProtoAminoMsg): FileDescriptorProto { @@ -2436,7 +2437,7 @@ export const DescriptorProto = { reservedName: Array.isArray(object?.reservedName) ? object.reservedName.map((e: any) => String(e)) : [] }; }, - toJSON(message: DescriptorProto): unknown { + toJSON(message: DescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); if (message.field) { @@ -2516,47 +2517,47 @@ export const DescriptorProto = { }, toAmino(message: DescriptorProto): DescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; if (message.field) { obj.field = message.field.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); } else { - obj.field = []; + obj.field = message.field; } if (message.extension) { obj.extension = message.extension.map(e => e ? FieldDescriptorProto.toAmino(e) : undefined); } else { - obj.extension = []; + obj.extension = message.extension; } if (message.nestedType) { obj.nested_type = message.nestedType.map(e => e ? DescriptorProto.toAmino(e) : undefined); } else { - obj.nested_type = []; + obj.nested_type = message.nestedType; } if (message.enumType) { obj.enum_type = message.enumType.map(e => e ? EnumDescriptorProto.toAmino(e) : undefined); } else { - obj.enum_type = []; + obj.enum_type = message.enumType; } if (message.extensionRange) { obj.extension_range = message.extensionRange.map(e => e ? DescriptorProto_ExtensionRange.toAmino(e) : undefined); } else { - obj.extension_range = []; + obj.extension_range = message.extensionRange; } if (message.oneofDecl) { obj.oneof_decl = message.oneofDecl.map(e => e ? OneofDescriptorProto.toAmino(e) : undefined); } else { - obj.oneof_decl = []; + obj.oneof_decl = message.oneofDecl; } obj.options = message.options ? MessageOptions.toAmino(message.options) : undefined; if (message.reservedRange) { obj.reserved_range = message.reservedRange.map(e => e ? DescriptorProto_ReservedRange.toAmino(e) : undefined); } else { - obj.reserved_range = []; + obj.reserved_range = message.reservedRange; } if (message.reservedName) { obj.reserved_name = message.reservedName.map(e => e); } else { - obj.reserved_name = []; + obj.reserved_name = message.reservedName; } return obj; }, @@ -2627,7 +2628,7 @@ export const DescriptorProto_ExtensionRange = { options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined }; }, - toJSON(message: DescriptorProto_ExtensionRange): unknown { + toJSON(message: DescriptorProto_ExtensionRange): JsonSafe { const obj: any = {}; message.start !== undefined && (obj.start = Math.round(message.start)); message.end !== undefined && (obj.end = Math.round(message.end)); @@ -2656,8 +2657,8 @@ export const DescriptorProto_ExtensionRange = { }, toAmino(message: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRangeAmino { const obj: any = {}; - obj.start = message.start; - obj.end = message.end; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; obj.options = message.options ? ExtensionRangeOptions.toAmino(message.options) : undefined; return obj; }, @@ -2720,7 +2721,7 @@ export const DescriptorProto_ReservedRange = { end: isSet(object.end) ? Number(object.end) : 0 }; }, - toJSON(message: DescriptorProto_ReservedRange): unknown { + toJSON(message: DescriptorProto_ReservedRange): JsonSafe { const obj: any = {}; message.start !== undefined && (obj.start = Math.round(message.start)); message.end !== undefined && (obj.end = Math.round(message.end)); @@ -2744,8 +2745,8 @@ export const DescriptorProto_ReservedRange = { }, toAmino(message: DescriptorProto_ReservedRange): DescriptorProto_ReservedRangeAmino { const obj: any = {}; - obj.start = message.start; - obj.end = message.end; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; return obj; }, fromAminoMsg(object: DescriptorProto_ReservedRangeAminoMsg): DescriptorProto_ReservedRange { @@ -2799,7 +2800,7 @@ export const ExtensionRangeOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: ExtensionRangeOptions): unknown { + toJSON(message: ExtensionRangeOptions): JsonSafe { const obj: any = {}; if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); @@ -2823,7 +2824,7 @@ export const ExtensionRangeOptions = { if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -2950,7 +2951,7 @@ export const FieldDescriptorProto = { options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined }; }, - toJSON(message: FieldDescriptorProto): unknown { + toJSON(message: FieldDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.number !== undefined && (obj.number = Math.round(message.number)); @@ -2987,10 +2988,10 @@ export const FieldDescriptorProto = { message.number = object.number; } if (object.label !== undefined && object.label !== null) { - message.label = fieldDescriptorProto_LabelFromJSON(object.label); + message.label = object.label; } if (object.type !== undefined && object.type !== null) { - message.type = fieldDescriptorProto_TypeFromJSON(object.type); + message.type = object.type; } if (object.type_name !== undefined && object.type_name !== null) { message.typeName = object.type_name; @@ -3014,15 +3015,15 @@ export const FieldDescriptorProto = { }, toAmino(message: FieldDescriptorProto): FieldDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; - obj.number = message.number; - obj.label = message.label; - obj.type = message.type; - obj.type_name = message.typeName; - obj.extendee = message.extendee; - obj.default_value = message.defaultValue; - obj.oneof_index = message.oneofIndex; - obj.json_name = message.jsonName; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; + obj.label = message.label === 1 ? undefined : message.label; + obj.type = message.type === 1 ? undefined : message.type; + obj.type_name = message.typeName === "" ? undefined : message.typeName; + obj.extendee = message.extendee === "" ? undefined : message.extendee; + obj.default_value = message.defaultValue === "" ? undefined : message.defaultValue; + obj.oneof_index = message.oneofIndex === 0 ? undefined : message.oneofIndex; + obj.json_name = message.jsonName === "" ? undefined : message.jsonName; obj.options = message.options ? FieldOptions.toAmino(message.options) : undefined; return obj; }, @@ -3085,7 +3086,7 @@ export const OneofDescriptorProto = { options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined }; }, - toJSON(message: OneofDescriptorProto): unknown { + toJSON(message: OneofDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.options !== undefined && (obj.options = message.options ? OneofOptions.toJSON(message.options) : undefined); @@ -3109,7 +3110,7 @@ export const OneofDescriptorProto = { }, toAmino(message: OneofDescriptorProto): OneofDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; obj.options = message.options ? OneofOptions.toAmino(message.options) : undefined; return obj; }, @@ -3196,7 +3197,7 @@ export const EnumDescriptorProto = { reservedName: Array.isArray(object?.reservedName) ? object.reservedName.map((e: any) => String(e)) : [] }; }, - toJSON(message: EnumDescriptorProto): unknown { + toJSON(message: EnumDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); if (message.value) { @@ -3241,22 +3242,22 @@ export const EnumDescriptorProto = { }, toAmino(message: EnumDescriptorProto): EnumDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; if (message.value) { obj.value = message.value.map(e => e ? EnumValueDescriptorProto.toAmino(e) : undefined); } else { - obj.value = []; + obj.value = message.value; } obj.options = message.options ? EnumOptions.toAmino(message.options) : undefined; if (message.reservedRange) { obj.reserved_range = message.reservedRange.map(e => e ? EnumDescriptorProto_EnumReservedRange.toAmino(e) : undefined); } else { - obj.reserved_range = []; + obj.reserved_range = message.reservedRange; } if (message.reservedName) { obj.reserved_name = message.reservedName.map(e => e); } else { - obj.reserved_name = []; + obj.reserved_name = message.reservedName; } return obj; }, @@ -3319,7 +3320,7 @@ export const EnumDescriptorProto_EnumReservedRange = { end: isSet(object.end) ? Number(object.end) : 0 }; }, - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + toJSON(message: EnumDescriptorProto_EnumReservedRange): JsonSafe { const obj: any = {}; message.start !== undefined && (obj.start = Math.round(message.start)); message.end !== undefined && (obj.end = Math.round(message.end)); @@ -3343,8 +3344,8 @@ export const EnumDescriptorProto_EnumReservedRange = { }, toAmino(message: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRangeAmino { const obj: any = {}; - obj.start = message.start; - obj.end = message.end; + obj.start = message.start === 0 ? undefined : message.start; + obj.end = message.end === 0 ? undefined : message.end; return obj; }, fromAminoMsg(object: EnumDescriptorProto_EnumReservedRangeAminoMsg): EnumDescriptorProto_EnumReservedRange { @@ -3414,7 +3415,7 @@ export const EnumValueDescriptorProto = { options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined }; }, - toJSON(message: EnumValueDescriptorProto): unknown { + toJSON(message: EnumValueDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.number !== undefined && (obj.number = Math.round(message.number)); @@ -3443,8 +3444,8 @@ export const EnumValueDescriptorProto = { }, toAmino(message: EnumValueDescriptorProto): EnumValueDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; - obj.number = message.number; + obj.name = message.name === "" ? undefined : message.name; + obj.number = message.number === 0 ? undefined : message.number; obj.options = message.options ? EnumValueOptions.toAmino(message.options) : undefined; return obj; }, @@ -3515,7 +3516,7 @@ export const ServiceDescriptorProto = { options: isSet(object.options) ? ServiceOptions.fromJSON(object.options) : undefined }; }, - toJSON(message: ServiceDescriptorProto): unknown { + toJSON(message: ServiceDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); if (message.method) { @@ -3546,11 +3547,11 @@ export const ServiceDescriptorProto = { }, toAmino(message: ServiceDescriptorProto): ServiceDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; + obj.name = message.name === "" ? undefined : message.name; if (message.method) { obj.method = message.method.map(e => e ? MethodDescriptorProto.toAmino(e) : undefined); } else { - obj.method = []; + obj.method = message.method; } obj.options = message.options ? ServiceOptions.toAmino(message.options) : undefined; return obj; @@ -3646,7 +3647,7 @@ export const MethodDescriptorProto = { serverStreaming: isSet(object.serverStreaming) ? Boolean(object.serverStreaming) : false }; }, - toJSON(message: MethodDescriptorProto): unknown { + toJSON(message: MethodDescriptorProto): JsonSafe { const obj: any = {}; message.name !== undefined && (obj.name = message.name); message.inputType !== undefined && (obj.inputType = message.inputType); @@ -3690,12 +3691,12 @@ export const MethodDescriptorProto = { }, toAmino(message: MethodDescriptorProto): MethodDescriptorProtoAmino { const obj: any = {}; - obj.name = message.name; - obj.input_type = message.inputType; - obj.output_type = message.outputType; + obj.name = message.name === "" ? undefined : message.name; + obj.input_type = message.inputType === "" ? undefined : message.inputType; + obj.output_type = message.outputType === "" ? undefined : message.outputType; obj.options = message.options ? MethodOptions.toAmino(message.options) : undefined; - obj.client_streaming = message.clientStreaming; - obj.server_streaming = message.serverStreaming; + obj.client_streaming = message.clientStreaming === false ? undefined : message.clientStreaming; + obj.server_streaming = message.serverStreaming === false ? undefined : message.serverStreaming; return obj; }, fromAminoMsg(object: MethodDescriptorProtoAminoMsg): MethodDescriptorProto { @@ -3909,7 +3910,7 @@ export const FileOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: FileOptions): unknown { + toJSON(message: FileOptions): JsonSafe { const obj: any = {}; message.javaPackage !== undefined && (obj.javaPackage = message.javaPackage); message.javaOuterClassname !== undefined && (obj.javaOuterClassname = message.javaOuterClassname); @@ -3981,7 +3982,7 @@ export const FileOptions = { message.javaStringCheckUtf8 = object.java_string_check_utf8; } if (object.optimize_for !== undefined && object.optimize_for !== null) { - message.optimizeFor = fileOptions_OptimizeModeFromJSON(object.optimize_for); + message.optimizeFor = object.optimize_for; } if (object.go_package !== undefined && object.go_package !== null) { message.goPackage = object.go_package; @@ -4030,30 +4031,30 @@ export const FileOptions = { }, toAmino(message: FileOptions): FileOptionsAmino { const obj: any = {}; - obj.java_package = message.javaPackage; - obj.java_outer_classname = message.javaOuterClassname; - obj.java_multiple_files = message.javaMultipleFiles; - obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash; - obj.java_string_check_utf8 = message.javaStringCheckUtf8; - obj.optimize_for = message.optimizeFor; - obj.go_package = message.goPackage; - obj.cc_generic_services = message.ccGenericServices; - obj.java_generic_services = message.javaGenericServices; - obj.py_generic_services = message.pyGenericServices; - obj.php_generic_services = message.phpGenericServices; - obj.deprecated = message.deprecated; - obj.cc_enable_arenas = message.ccEnableArenas; - obj.objc_class_prefix = message.objcClassPrefix; - obj.csharp_namespace = message.csharpNamespace; - obj.swift_prefix = message.swiftPrefix; - obj.php_class_prefix = message.phpClassPrefix; - obj.php_namespace = message.phpNamespace; - obj.php_metadata_namespace = message.phpMetadataNamespace; - obj.ruby_package = message.rubyPackage; + obj.java_package = message.javaPackage === "" ? undefined : message.javaPackage; + obj.java_outer_classname = message.javaOuterClassname === "" ? undefined : message.javaOuterClassname; + obj.java_multiple_files = message.javaMultipleFiles === false ? undefined : message.javaMultipleFiles; + obj.java_generate_equals_and_hash = message.javaGenerateEqualsAndHash === false ? undefined : message.javaGenerateEqualsAndHash; + obj.java_string_check_utf8 = message.javaStringCheckUtf8 === false ? undefined : message.javaStringCheckUtf8; + obj.optimize_for = message.optimizeFor === 1 ? undefined : message.optimizeFor; + obj.go_package = message.goPackage === "" ? undefined : message.goPackage; + obj.cc_generic_services = message.ccGenericServices === false ? undefined : message.ccGenericServices; + obj.java_generic_services = message.javaGenericServices === false ? undefined : message.javaGenericServices; + obj.py_generic_services = message.pyGenericServices === false ? undefined : message.pyGenericServices; + obj.php_generic_services = message.phpGenericServices === false ? undefined : message.phpGenericServices; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.cc_enable_arenas = message.ccEnableArenas === false ? undefined : message.ccEnableArenas; + obj.objc_class_prefix = message.objcClassPrefix === "" ? undefined : message.objcClassPrefix; + obj.csharp_namespace = message.csharpNamespace === "" ? undefined : message.csharpNamespace; + obj.swift_prefix = message.swiftPrefix === "" ? undefined : message.swiftPrefix; + obj.php_class_prefix = message.phpClassPrefix === "" ? undefined : message.phpClassPrefix; + obj.php_namespace = message.phpNamespace === "" ? undefined : message.phpNamespace; + obj.php_metadata_namespace = message.phpMetadataNamespace === "" ? undefined : message.phpMetadataNamespace; + obj.ruby_package = message.rubyPackage === "" ? undefined : message.rubyPackage; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4140,7 +4141,7 @@ export const MessageOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: MessageOptions): unknown { + toJSON(message: MessageOptions): JsonSafe { const obj: any = {}; message.messageSetWireFormat !== undefined && (obj.messageSetWireFormat = message.messageSetWireFormat); message.noStandardDescriptorAccessor !== undefined && (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); @@ -4181,14 +4182,14 @@ export const MessageOptions = { }, toAmino(message: MessageOptions): MessageOptionsAmino { const obj: any = {}; - obj.message_set_wire_format = message.messageSetWireFormat; - obj.no_standard_descriptor_accessor = message.noStandardDescriptorAccessor; - obj.deprecated = message.deprecated; - obj.map_entry = message.mapEntry; + obj.message_set_wire_format = message.messageSetWireFormat === false ? undefined : message.messageSetWireFormat; + obj.no_standard_descriptor_accessor = message.noStandardDescriptorAccessor === false ? undefined : message.noStandardDescriptorAccessor; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.map_entry = message.mapEntry === false ? undefined : message.mapEntry; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4291,7 +4292,7 @@ export const FieldOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: FieldOptions): unknown { + toJSON(message: FieldOptions): JsonSafe { const obj: any = {}; message.ctype !== undefined && (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); message.packed !== undefined && (obj.packed = message.packed); @@ -4320,13 +4321,13 @@ export const FieldOptions = { fromAmino(object: FieldOptionsAmino): FieldOptions { const message = createBaseFieldOptions(); if (object.ctype !== undefined && object.ctype !== null) { - message.ctype = fieldOptions_CTypeFromJSON(object.ctype); + message.ctype = object.ctype; } if (object.packed !== undefined && object.packed !== null) { message.packed = object.packed; } if (object.jstype !== undefined && object.jstype !== null) { - message.jstype = fieldOptions_JSTypeFromJSON(object.jstype); + message.jstype = object.jstype; } if (object.lazy !== undefined && object.lazy !== null) { message.lazy = object.lazy; @@ -4342,16 +4343,16 @@ export const FieldOptions = { }, toAmino(message: FieldOptions): FieldOptionsAmino { const obj: any = {}; - obj.ctype = message.ctype; - obj.packed = message.packed; - obj.jstype = message.jstype; - obj.lazy = message.lazy; - obj.deprecated = message.deprecated; - obj.weak = message.weak; + obj.ctype = message.ctype === 1 ? undefined : message.ctype; + obj.packed = message.packed === false ? undefined : message.packed; + obj.jstype = message.jstype === 1 ? undefined : message.jstype; + obj.lazy = message.lazy === false ? undefined : message.lazy; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.weak = message.weak === false ? undefined : message.weak; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4406,7 +4407,7 @@ export const OneofOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: OneofOptions): unknown { + toJSON(message: OneofOptions): JsonSafe { const obj: any = {}; if (message.uninterpretedOption) { obj.uninterpretedOption = message.uninterpretedOption.map(e => e ? UninterpretedOption.toJSON(e) : undefined); @@ -4430,7 +4431,7 @@ export const OneofOptions = { if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4501,7 +4502,7 @@ export const EnumOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: EnumOptions): unknown { + toJSON(message: EnumOptions): JsonSafe { const obj: any = {}; message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); message.deprecated !== undefined && (obj.deprecated = message.deprecated); @@ -4532,12 +4533,12 @@ export const EnumOptions = { }, toAmino(message: EnumOptions): EnumOptionsAmino { const obj: any = {}; - obj.allow_alias = message.allowAlias; - obj.deprecated = message.deprecated; + obj.allow_alias = message.allowAlias === false ? undefined : message.allowAlias; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4600,7 +4601,7 @@ export const EnumValueOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: EnumValueOptions): unknown { + toJSON(message: EnumValueOptions): JsonSafe { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); if (message.uninterpretedOption) { @@ -4626,11 +4627,11 @@ export const EnumValueOptions = { }, toAmino(message: EnumValueOptions): EnumValueOptionsAmino { const obj: any = {}; - obj.deprecated = message.deprecated; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4693,7 +4694,7 @@ export const ServiceOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: ServiceOptions): unknown { + toJSON(message: ServiceOptions): JsonSafe { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); if (message.uninterpretedOption) { @@ -4719,11 +4720,11 @@ export const ServiceOptions = { }, toAmino(message: ServiceOptions): ServiceOptionsAmino { const obj: any = {}; - obj.deprecated = message.deprecated; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4794,7 +4795,7 @@ export const MethodOptions = { uninterpretedOption: Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) : [] }; }, - toJSON(message: MethodOptions): unknown { + toJSON(message: MethodOptions): JsonSafe { const obj: any = {}; message.deprecated !== undefined && (obj.deprecated = message.deprecated); message.idempotencyLevel !== undefined && (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel)); @@ -4818,19 +4819,19 @@ export const MethodOptions = { message.deprecated = object.deprecated; } if (object.idempotency_level !== undefined && object.idempotency_level !== null) { - message.idempotencyLevel = methodOptions_IdempotencyLevelFromJSON(object.idempotency_level); + message.idempotencyLevel = object.idempotency_level; } message.uninterpretedOption = object.uninterpreted_option?.map(e => UninterpretedOption.fromAmino(e)) || []; return message; }, toAmino(message: MethodOptions): MethodOptionsAmino { const obj: any = {}; - obj.deprecated = message.deprecated; - obj.idempotency_level = message.idempotencyLevel; + obj.deprecated = message.deprecated === false ? undefined : message.deprecated; + obj.idempotency_level = message.idempotencyLevel === 1 ? undefined : message.idempotencyLevel; if (message.uninterpretedOption) { obj.uninterpreted_option = message.uninterpretedOption.map(e => e ? UninterpretedOption.toAmino(e) : undefined); } else { - obj.uninterpreted_option = []; + obj.uninterpreted_option = message.uninterpretedOption; } return obj; }, @@ -4933,7 +4934,7 @@ export const UninterpretedOption = { aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "" }; }, - toJSON(message: UninterpretedOption): unknown { + toJSON(message: UninterpretedOption): JsonSafe { const obj: any = {}; if (message.name) { obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toJSON(e) : undefined); @@ -4987,14 +4988,14 @@ export const UninterpretedOption = { if (message.name) { obj.name = message.name.map(e => e ? UninterpretedOption_NamePart.toAmino(e) : undefined); } else { - obj.name = []; + obj.name = message.name; } - obj.identifier_value = message.identifierValue; - obj.positive_int_value = message.positiveIntValue ? message.positiveIntValue.toString() : undefined; - obj.negative_int_value = message.negativeIntValue ? message.negativeIntValue.toString() : undefined; - obj.double_value = message.doubleValue; + obj.identifier_value = message.identifierValue === "" ? undefined : message.identifierValue; + obj.positive_int_value = message.positiveIntValue !== BigInt(0) ? message.positiveIntValue.toString() : undefined; + obj.negative_int_value = message.negativeIntValue !== BigInt(0) ? message.negativeIntValue.toString() : undefined; + obj.double_value = message.doubleValue === 0 ? undefined : message.doubleValue; obj.string_value = message.stringValue ? base64FromBytes(message.stringValue) : undefined; - obj.aggregate_value = message.aggregateValue; + obj.aggregate_value = message.aggregateValue === "" ? undefined : message.aggregateValue; return obj; }, fromAminoMsg(object: UninterpretedOptionAminoMsg): UninterpretedOption { @@ -5056,7 +5057,7 @@ export const UninterpretedOption_NamePart = { isExtension: isSet(object.isExtension) ? Boolean(object.isExtension) : false }; }, - toJSON(message: UninterpretedOption_NamePart): unknown { + toJSON(message: UninterpretedOption_NamePart): JsonSafe { const obj: any = {}; message.namePart !== undefined && (obj.namePart = message.namePart); message.isExtension !== undefined && (obj.isExtension = message.isExtension); @@ -5080,8 +5081,8 @@ export const UninterpretedOption_NamePart = { }, toAmino(message: UninterpretedOption_NamePart): UninterpretedOption_NamePartAmino { const obj: any = {}; - obj.name_part = message.namePart; - obj.is_extension = message.isExtension; + obj.name_part = message.namePart === "" ? undefined : message.namePart; + obj.is_extension = message.isExtension === false ? undefined : message.isExtension; return obj; }, fromAminoMsg(object: UninterpretedOption_NamePartAminoMsg): UninterpretedOption_NamePart { @@ -5135,7 +5136,7 @@ export const SourceCodeInfo = { location: Array.isArray(object?.location) ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) : [] }; }, - toJSON(message: SourceCodeInfo): unknown { + toJSON(message: SourceCodeInfo): JsonSafe { const obj: any = {}; if (message.location) { obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toJSON(e) : undefined); @@ -5159,7 +5160,7 @@ export const SourceCodeInfo = { if (message.location) { obj.location = message.location.map(e => e ? SourceCodeInfo_Location.toAmino(e) : undefined); } else { - obj.location = []; + obj.location = message.location; } return obj; }, @@ -5264,7 +5265,7 @@ export const SourceCodeInfo_Location = { leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) ? object.leadingDetachedComments.map((e: any) => String(e)) : [] }; }, - toJSON(message: SourceCodeInfo_Location): unknown { + toJSON(message: SourceCodeInfo_Location): JsonSafe { const obj: any = {}; if (message.path) { obj.path = message.path.map(e => Math.round(e)); @@ -5312,19 +5313,19 @@ export const SourceCodeInfo_Location = { if (message.path) { obj.path = message.path.map(e => e); } else { - obj.path = []; + obj.path = message.path; } if (message.span) { obj.span = message.span.map(e => e); } else { - obj.span = []; + obj.span = message.span; } - obj.leading_comments = message.leadingComments; - obj.trailing_comments = message.trailingComments; + obj.leading_comments = message.leadingComments === "" ? undefined : message.leadingComments; + obj.trailing_comments = message.trailingComments === "" ? undefined : message.trailingComments; if (message.leadingDetachedComments) { obj.leading_detached_comments = message.leadingDetachedComments.map(e => e); } else { - obj.leading_detached_comments = []; + obj.leading_detached_comments = message.leadingDetachedComments; } return obj; }, @@ -5379,7 +5380,7 @@ export const GeneratedCodeInfo = { annotation: Array.isArray(object?.annotation) ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) : [] }; }, - toJSON(message: GeneratedCodeInfo): unknown { + toJSON(message: GeneratedCodeInfo): JsonSafe { const obj: any = {}; if (message.annotation) { obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined); @@ -5403,7 +5404,7 @@ export const GeneratedCodeInfo = { if (message.annotation) { obj.annotation = message.annotation.map(e => e ? GeneratedCodeInfo_Annotation.toAmino(e) : undefined); } else { - obj.annotation = []; + obj.annotation = message.annotation; } return obj; }, @@ -5491,7 +5492,7 @@ export const GeneratedCodeInfo_Annotation = { end: isSet(object.end) ? Number(object.end) : 0 }; }, - toJSON(message: GeneratedCodeInfo_Annotation): unknown { + toJSON(message: GeneratedCodeInfo_Annotation): JsonSafe { const obj: any = {}; if (message.path) { obj.path = message.path.map(e => Math.round(e)); @@ -5530,11 +5531,11 @@ export const GeneratedCodeInfo_Annotation = { if (message.path) { obj.path = message.path.map(e => e); } else { - obj.path = []; + obj.path = message.path; } - obj.source_file = message.sourceFile; - obj.begin = message.begin; - obj.end = message.end; + obj.source_file = message.sourceFile === "" ? undefined : message.sourceFile; + obj.begin = message.begin === 0 ? undefined : message.begin; + obj.end = message.end === 0 ? undefined : message.end; return obj; }, fromAminoMsg(object: GeneratedCodeInfo_AnnotationAminoMsg): GeneratedCodeInfo_Annotation { diff --git a/packages/arch3-proto/generated/google/protobuf/timestamp.ts b/packages/arch3-proto/generated/google/protobuf/timestamp.ts index 1f28718..baf5b96 100644 --- a/packages/arch3-proto/generated/google/protobuf/timestamp.ts +++ b/packages/arch3-proto/generated/google/protobuf/timestamp.ts @@ -1,6 +1,7 @@ /* eslint-disable */ import { BinaryReader, BinaryWriter } from "../../binary"; import { isSet, fromJsonTimestamp, fromTimestamp } from "../../helpers"; +import { JsonSafe } from "../../json-safe"; /** * A Timestamp represents a point in time independent of any time zone or local * calendar, encoded as a count of seconds and fractions of seconds at @@ -236,7 +237,7 @@ export const Timestamp = { nanos: isSet(object.nanos) ? Number(object.nanos) : 0 }; }, - toJSON(message: Timestamp): unknown { + toJSON(message: Timestamp): JsonSafe { const obj: any = {}; message.seconds !== undefined && (obj.seconds = (message.seconds || BigInt(0)).toString()); message.nanos !== undefined && (obj.nanos = Math.round(message.nanos)); diff --git a/packages/arch3-proto/generated/helpers.ts b/packages/arch3-proto/generated/helpers.ts index 3086258..ac96219 100644 --- a/packages/arch3-proto/generated/helpers.ts +++ b/packages/arch3-proto/generated/helpers.ts @@ -1,8 +1,8 @@ /* eslint-disable */ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain -* and run the transpile command or yarn proto command to regenerate this bundle. +* and run the transpile command or npm scripts command that is used to regenerate this bundle. */ @@ -47,7 +47,7 @@ export interface AminoHeight { readonly revision_height?: string; } -export function omitDefault( +export function omitDefault( input: T ): T | undefined { if (typeof input === 'string') { @@ -58,6 +58,10 @@ export function omitDefault( return input === 0 ? undefined : input; } + if (typeof input === "boolean"){ + return input === false ? undefined : input; + } + if (typeof input === 'bigint') { return input === BigInt(0) ? undefined : input; } diff --git a/packages/arch3-proto/generated/ibc/bundle.ts b/packages/arch3-proto/generated/ibc/bundle.ts new file mode 100644 index 0000000..767422c --- /dev/null +++ b/packages/arch3-proto/generated/ibc/bundle.ts @@ -0,0 +1,17 @@ +/* eslint-disable */ +import * as _32 from "./core/channel/v1/channel"; +import * as _33 from "./core/client/v1/client"; +export namespace ibc { + export namespace core { + export namespace channel { + export const v1 = { + ..._32 + }; + } + export namespace client { + export const v1 = { + ..._33 + }; + } + } +} \ No newline at end of file diff --git a/packages/arch3-proto/generated/ibc/core/channel/v1/channel.ts b/packages/arch3-proto/generated/ibc/core/channel/v1/channel.ts new file mode 100644 index 0000000..dc79220 --- /dev/null +++ b/packages/arch3-proto/generated/ibc/core/channel/v1/channel.ts @@ -0,0 +1,1300 @@ +/* eslint-disable */ +import { Height, HeightAmino } from "../../client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +import { JsonSafe } from "../../../../json-safe"; +/** + * State defines if a channel is in one of the following states: + * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + */ +export enum State { + /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ + STATE_UNINITIALIZED_UNSPECIFIED = 0, + /** STATE_INIT - A channel has just started the opening handshake. */ + STATE_INIT = 1, + /** STATE_TRYOPEN - A channel has acknowledged the handshake step on the counterparty chain. */ + STATE_TRYOPEN = 2, + /** + * STATE_OPEN - A channel has completed the handshake. Open channels are + * ready to send and receive packets. + */ + STATE_OPEN = 3, + /** + * STATE_CLOSED - A channel has been closed and can no longer be used to send or receive + * packets. + */ + STATE_CLOSED = 4, + UNRECOGNIZED = -1, +} +export const StateAmino = State; +export function stateFromJSON(object: any): State { + switch (object) { + case 0: + case "STATE_UNINITIALIZED_UNSPECIFIED": + return State.STATE_UNINITIALIZED_UNSPECIFIED; + case 1: + case "STATE_INIT": + return State.STATE_INIT; + case 2: + case "STATE_TRYOPEN": + return State.STATE_TRYOPEN; + case 3: + case "STATE_OPEN": + return State.STATE_OPEN; + case 4: + case "STATE_CLOSED": + return State.STATE_CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return State.UNRECOGNIZED; + } +} +export function stateToJSON(object: State): string { + switch (object) { + case State.STATE_UNINITIALIZED_UNSPECIFIED: + return "STATE_UNINITIALIZED_UNSPECIFIED"; + case State.STATE_INIT: + return "STATE_INIT"; + case State.STATE_TRYOPEN: + return "STATE_TRYOPEN"; + case State.STATE_OPEN: + return "STATE_OPEN"; + case State.STATE_CLOSED: + return "STATE_CLOSED"; + case State.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** Order defines if a channel is ORDERED or UNORDERED */ +export enum Order { + /** ORDER_NONE_UNSPECIFIED - zero-value for channel ordering */ + ORDER_NONE_UNSPECIFIED = 0, + /** + * ORDER_UNORDERED - packets can be delivered in any order, which may differ from the order in + * which they were sent. + */ + ORDER_UNORDERED = 1, + /** ORDER_ORDERED - packets are delivered exactly in the order which they were sent */ + ORDER_ORDERED = 2, + UNRECOGNIZED = -1, +} +export const OrderAmino = Order; +export function orderFromJSON(object: any): Order { + switch (object) { + case 0: + case "ORDER_NONE_UNSPECIFIED": + return Order.ORDER_NONE_UNSPECIFIED; + case 1: + case "ORDER_UNORDERED": + return Order.ORDER_UNORDERED; + case 2: + case "ORDER_ORDERED": + return Order.ORDER_ORDERED; + case -1: + case "UNRECOGNIZED": + default: + return Order.UNRECOGNIZED; + } +} +export function orderToJSON(object: Order): string { + switch (object) { + case Order.ORDER_NONE_UNSPECIFIED: + return "ORDER_NONE_UNSPECIFIED"; + case Order.ORDER_UNORDERED: + return "ORDER_UNORDERED"; + case Order.ORDER_ORDERED: + return "ORDER_ORDERED"; + case Order.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface Channel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; +} +export interface ChannelProtoMsg { + typeUrl: "/ibc.core.channel.v1.Channel"; + value: Uint8Array; +} +/** + * Channel defines pipeline for exactly-once packet delivery between specific + * modules on separate blockchains, which has at least one end capable of + * sending packets and one end capable of receiving packets. + */ +export interface ChannelAmino { + /** current state of the channel end */ + state?: State; + /** whether the channel is ordered or unordered */ + ordering?: Order; + /** counterparty channel end */ + counterparty?: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; +} +export interface ChannelAminoMsg { + type: "cosmos-sdk/Channel"; + value: ChannelAmino; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannel { + /** current state of the channel end */ + state: State; + /** whether the channel is ordered or unordered */ + ordering: Order; + /** counterparty channel end */ + counterparty: Counterparty; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connectionHops: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version: string; + /** port identifier */ + portId: string; + /** channel identifier */ + channelId: string; +} +export interface IdentifiedChannelProtoMsg { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; + value: Uint8Array; +} +/** + * IdentifiedChannel defines a channel with additional port and channel + * identifier fields. + */ +export interface IdentifiedChannelAmino { + /** current state of the channel end */ + state?: State; + /** whether the channel is ordered or unordered */ + ordering?: Order; + /** counterparty channel end */ + counterparty?: CounterpartyAmino; + /** + * list of connection identifiers, in order, along which packets sent on + * this channel will travel + */ + connection_hops?: string[]; + /** opaque channel version, which is agreed upon during the handshake */ + version?: string; + /** port identifier */ + port_id?: string; + /** channel identifier */ + channel_id?: string; +} +export interface IdentifiedChannelAminoMsg { + type: "cosmos-sdk/IdentifiedChannel"; + value: IdentifiedChannelAmino; +} +/** Counterparty defines a channel end counterparty */ +export interface Counterparty { + /** port on the counterparty chain which owns the other end of the channel. */ + portId: string; + /** channel end on the counterparty chain */ + channelId: string; +} +export interface CounterpartyProtoMsg { + typeUrl: "/ibc.core.channel.v1.Counterparty"; + value: Uint8Array; +} +/** Counterparty defines a channel end counterparty */ +export interface CounterpartyAmino { + /** port on the counterparty chain which owns the other end of the channel. */ + port_id?: string; + /** channel end on the counterparty chain */ + channel_id?: string; +} +export interface CounterpartyAminoMsg { + type: "cosmos-sdk/Counterparty"; + value: CounterpartyAmino; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface Packet { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence: bigint; + /** identifies the port on the sending chain. */ + sourcePort: string; + /** identifies the channel end on the sending chain. */ + sourceChannel: string; + /** identifies the port on the receiving chain. */ + destinationPort: string; + /** identifies the channel end on the receiving chain. */ + destinationChannel: string; + /** actual opaque bytes transferred directly to the application module */ + data: Uint8Array; + /** block height after which the packet times out */ + timeoutHeight: Height; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeoutTimestamp: bigint; +} +export interface PacketProtoMsg { + typeUrl: "/ibc.core.channel.v1.Packet"; + value: Uint8Array; +} +/** Packet defines a type that carries data across different chains through IBC */ +export interface PacketAmino { + /** + * number corresponds to the order of sends and receives, where a Packet + * with an earlier sequence number must be sent and received before a Packet + * with a later sequence number. + */ + sequence?: string; + /** identifies the port on the sending chain. */ + source_port?: string; + /** identifies the channel end on the sending chain. */ + source_channel?: string; + /** identifies the port on the receiving chain. */ + destination_port?: string; + /** identifies the channel end on the receiving chain. */ + destination_channel?: string; + /** actual opaque bytes transferred directly to the application module */ + data?: string; + /** block height after which the packet times out */ + timeout_height?: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet times out */ + timeout_timestamp?: string; +} +export interface PacketAminoMsg { + type: "cosmos-sdk/Packet"; + value: PacketAmino; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketState { + /** channel port identifier. */ + portId: string; + /** channel unique identifier. */ + channelId: string; + /** packet sequence. */ + sequence: bigint; + /** embedded data that represents packet state. */ + data: Uint8Array; +} +export interface PacketStateProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketState"; + value: Uint8Array; +} +/** + * PacketState defines the generic type necessary to retrieve and store + * packet commitments, acknowledgements, and receipts. + * Caller is responsible for knowing the context necessary to interpret this + * state as a commitment, acknowledgement, or a receipt. + */ +export interface PacketStateAmino { + /** channel port identifier. */ + port_id?: string; + /** channel unique identifier. */ + channel_id?: string; + /** packet sequence. */ + sequence?: string; + /** embedded data that represents packet state. */ + data?: string; +} +export interface PacketStateAminoMsg { + type: "cosmos-sdk/PacketState"; + value: PacketStateAmino; +} +/** + * PacketId is an identifer for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketId { + /** channel port identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; + /** packet sequence */ + sequence: bigint; +} +export interface PacketIdProtoMsg { + typeUrl: "/ibc.core.channel.v1.PacketId"; + value: Uint8Array; +} +/** + * PacketId is an identifer for a unique Packet + * Source chains refer to packets by source port/channel + * Destination chains refer to packets by destination port/channel + */ +export interface PacketIdAmino { + /** channel port identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; + /** packet sequence */ + sequence?: string; +} +export interface PacketIdAminoMsg { + type: "cosmos-sdk/PacketId"; + value: PacketIdAmino; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface Acknowledgement { + result?: Uint8Array; + error?: string; +} +export interface AcknowledgementProtoMsg { + typeUrl: "/ibc.core.channel.v1.Acknowledgement"; + value: Uint8Array; +} +/** + * Acknowledgement is the recommended acknowledgement format to be used by + * app-specific protocols. + * NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental + * conflicts with other protobuf message formats used for acknowledgements. + * The first byte of any message with this format will be the non-ASCII values + * `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: + * https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope + */ +export interface AcknowledgementAmino { + result?: string; + error?: string; +} +export interface AcknowledgementAminoMsg { + type: "cosmos-sdk/Acknowledgement"; + value: AcknowledgementAmino; +} +function createBaseChannel(): Channel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "" + }; +} +export const Channel = { + typeUrl: "/ibc.core.channel.v1.Channel", + encode(message: Channel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Channel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = (reader.int32() as any); + break; + case 2: + message.ordering = (reader.int32() as any); + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Channel { + return { + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "" + }; + }, + toJSON(message: Channel): JsonSafe { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map(e => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + return obj; + }, + fromPartial(object: Partial): Channel { + const message = createBaseChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: ChannelAmino): Channel { + const message = createBaseChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: Channel): ChannelAmino { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: ChannelAminoMsg): Channel { + return Channel.fromAmino(object.value); + }, + toAminoMsg(message: Channel): ChannelAminoMsg { + return { + type: "cosmos-sdk/Channel", + value: Channel.toAmino(message) + }; + }, + fromProtoMsg(message: ChannelProtoMsg): Channel { + return Channel.decode(message.value); + }, + toProto(message: Channel): Uint8Array { + return Channel.encode(message).finish(); + }, + toProtoMsg(message: Channel): ChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Channel", + value: Channel.encode(message).finish() + }; + } +}; +function createBaseIdentifiedChannel(): IdentifiedChannel { + return { + state: 0, + ordering: 0, + counterparty: Counterparty.fromPartial({}), + connectionHops: [], + version: "", + portId: "", + channelId: "" + }; +} +export const IdentifiedChannel = { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + encode(message: IdentifiedChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.state !== 0) { + writer.uint32(8).int32(message.state); + } + if (message.ordering !== 0) { + writer.uint32(16).int32(message.ordering); + } + if (message.counterparty !== undefined) { + Counterparty.encode(message.counterparty, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.connectionHops) { + writer.uint32(34).string(v!); + } + if (message.version !== "") { + writer.uint32(42).string(message.version); + } + if (message.portId !== "") { + writer.uint32(50).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(58).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = (reader.int32() as any); + break; + case 2: + message.ordering = (reader.int32() as any); + break; + case 3: + message.counterparty = Counterparty.decode(reader, reader.uint32()); + break; + case 4: + message.connectionHops.push(reader.string()); + break; + case 5: + message.version = reader.string(); + break; + case 6: + message.portId = reader.string(); + break; + case 7: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IdentifiedChannel { + return { + state: isSet(object.state) ? stateFromJSON(object.state) : -1, + ordering: isSet(object.ordering) ? orderFromJSON(object.ordering) : -1, + counterparty: isSet(object.counterparty) ? Counterparty.fromJSON(object.counterparty) : undefined, + connectionHops: Array.isArray(object?.connectionHops) ? object.connectionHops.map((e: any) => String(e)) : [], + version: isSet(object.version) ? String(object.version) : "", + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: IdentifiedChannel): JsonSafe { + const obj: any = {}; + message.state !== undefined && (obj.state = stateToJSON(message.state)); + message.ordering !== undefined && (obj.ordering = orderToJSON(message.ordering)); + message.counterparty !== undefined && (obj.counterparty = message.counterparty ? Counterparty.toJSON(message.counterparty) : undefined); + if (message.connectionHops) { + obj.connectionHops = message.connectionHops.map(e => e); + } else { + obj.connectionHops = []; + } + message.version !== undefined && (obj.version = message.version); + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + fromPartial(object: Partial): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + message.state = object.state ?? 0; + message.ordering = object.ordering ?? 0; + message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { + const message = createBaseIdentifiedChannel(); + if (object.state !== undefined && object.state !== null) { + message.state = object.state; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + if (object.counterparty !== undefined && object.counterparty !== null) { + message.counterparty = Counterparty.fromAmino(object.counterparty); + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { + const obj: any = {}; + obj.state = message.state === 0 ? undefined : message.state; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + obj.counterparty = message.counterparty ? Counterparty.toAmino(message.counterparty) : undefined; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + obj.version = message.version === "" ? undefined : message.version; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { + return IdentifiedChannel.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedChannel): IdentifiedChannelAminoMsg { + return { + type: "cosmos-sdk/IdentifiedChannel", + value: IdentifiedChannel.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedChannelProtoMsg): IdentifiedChannel { + return IdentifiedChannel.decode(message.value); + }, + toProto(message: IdentifiedChannel): Uint8Array { + return IdentifiedChannel.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedChannel): IdentifiedChannelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.IdentifiedChannel", + value: IdentifiedChannel.encode(message).finish() + }; + } +}; +function createBaseCounterparty(): Counterparty { + return { + portId: "", + channelId: "" + }; +} +export const Counterparty = { + typeUrl: "/ibc.core.channel.v1.Counterparty", + encode(message: Counterparty, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Counterparty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCounterparty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Counterparty { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "" + }; + }, + toJSON(message: Counterparty): JsonSafe { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + return obj; + }, + fromPartial(object: Partial): Counterparty { + const message = createBaseCounterparty(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: CounterpartyAmino): Counterparty { + const message = createBaseCounterparty(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: Counterparty): CounterpartyAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: CounterpartyAminoMsg): Counterparty { + return Counterparty.fromAmino(object.value); + }, + toAminoMsg(message: Counterparty): CounterpartyAminoMsg { + return { + type: "cosmos-sdk/Counterparty", + value: Counterparty.toAmino(message) + }; + }, + fromProtoMsg(message: CounterpartyProtoMsg): Counterparty { + return Counterparty.decode(message.value); + }, + toProto(message: Counterparty): Uint8Array { + return Counterparty.encode(message).finish(); + }, + toProtoMsg(message: Counterparty): CounterpartyProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Counterparty", + value: Counterparty.encode(message).finish() + }; + } +}; +function createBasePacket(): Packet { + return { + sequence: BigInt(0), + sourcePort: "", + sourceChannel: "", + destinationPort: "", + destinationChannel: "", + data: new Uint8Array(), + timeoutHeight: Height.fromPartial({}), + timeoutTimestamp: BigInt(0) + }; +} +export const Packet = { + typeUrl: "/ibc.core.channel.v1.Packet", + encode(message: Packet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.sourcePort !== "") { + writer.uint32(18).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(26).string(message.sourceChannel); + } + if (message.destinationPort !== "") { + writer.uint32(34).string(message.destinationPort); + } + if (message.destinationChannel !== "") { + writer.uint32(42).string(message.destinationChannel); + } + if (message.data.length !== 0) { + writer.uint32(50).bytes(message.data); + } + if (message.timeoutHeight !== undefined) { + Height.encode(message.timeoutHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.timeoutTimestamp !== BigInt(0)) { + writer.uint32(64).uint64(message.timeoutTimestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Packet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacket(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.sourcePort = reader.string(); + break; + case 3: + message.sourceChannel = reader.string(); + break; + case 4: + message.destinationPort = reader.string(); + break; + case 5: + message.destinationChannel = reader.string(); + break; + case 6: + message.data = reader.bytes(); + break; + case 7: + message.timeoutHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.timeoutTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Packet { + return { + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + sourcePort: isSet(object.sourcePort) ? String(object.sourcePort) : "", + sourceChannel: isSet(object.sourceChannel) ? String(object.sourceChannel) : "", + destinationPort: isSet(object.destinationPort) ? String(object.destinationPort) : "", + destinationChannel: isSet(object.destinationChannel) ? String(object.destinationChannel) : "", + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(), + timeoutHeight: isSet(object.timeoutHeight) ? Height.fromJSON(object.timeoutHeight) : undefined, + timeoutTimestamp: isSet(object.timeoutTimestamp) ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0) + }; + }, + toJSON(message: Packet): JsonSafe { + const obj: any = {}; + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.sourcePort !== undefined && (obj.sourcePort = message.sourcePort); + message.sourceChannel !== undefined && (obj.sourceChannel = message.sourceChannel); + message.destinationPort !== undefined && (obj.destinationPort = message.destinationPort); + message.destinationChannel !== undefined && (obj.destinationChannel = message.destinationChannel); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + message.timeoutHeight !== undefined && (obj.timeoutHeight = message.timeoutHeight ? Height.toJSON(message.timeoutHeight) : undefined); + message.timeoutTimestamp !== undefined && (obj.timeoutTimestamp = (message.timeoutTimestamp || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Packet { + const message = createBasePacket(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.destinationPort = object.destinationPort ?? ""; + message.destinationChannel = object.destinationChannel ?? ""; + message.data = object.data ?? new Uint8Array(); + message.timeoutHeight = object.timeoutHeight !== undefined && object.timeoutHeight !== null ? Height.fromPartial(object.timeoutHeight) : undefined; + message.timeoutTimestamp = object.timeoutTimestamp !== undefined && object.timeoutTimestamp !== null ? BigInt(object.timeoutTimestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketAmino): Packet { + const message = createBasePacket(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + if (object.destination_port !== undefined && object.destination_port !== null) { + message.destinationPort = object.destination_port; + } + if (object.destination_channel !== undefined && object.destination_channel !== null) { + message.destinationChannel = object.destination_channel; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timeout_height !== undefined && object.timeout_height !== null) { + message.timeoutHeight = Height.fromAmino(object.timeout_height); + } + if (object.timeout_timestamp !== undefined && object.timeout_timestamp !== null) { + message.timeoutTimestamp = BigInt(object.timeout_timestamp); + } + return message; + }, + toAmino(message: Packet): PacketAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; + obj.destination_port = message.destinationPort === "" ? undefined : message.destinationPort; + obj.destination_channel = message.destinationChannel === "" ? undefined : message.destinationChannel; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; + obj.timeout_timestamp = message.timeoutTimestamp !== BigInt(0) ? message.timeoutTimestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketAminoMsg): Packet { + return Packet.fromAmino(object.value); + }, + toAminoMsg(message: Packet): PacketAminoMsg { + return { + type: "cosmos-sdk/Packet", + value: Packet.toAmino(message) + }; + }, + fromProtoMsg(message: PacketProtoMsg): Packet { + return Packet.decode(message.value); + }, + toProto(message: Packet): Uint8Array { + return Packet.encode(message).finish(); + }, + toProtoMsg(message: Packet): PacketProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Packet", + value: Packet.encode(message).finish() + }; + } +}; +function createBasePacketState(): PacketState { + return { + portId: "", + channelId: "", + sequence: BigInt(0), + data: new Uint8Array() + }; +} +export const PacketState = { + typeUrl: "/ibc.core.channel.v1.PacketState", + encode(message: PacketState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + if (message.data.length !== 0) { + writer.uint32(34).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + case 4: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PacketState { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0), + data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array() + }; + }, + toJSON(message: PacketState): JsonSafe { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + message.data !== undefined && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array())); + return obj; + }, + fromPartial(object: Partial): PacketState { + const message = createBasePacketState(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: PacketStateAmino): PacketState { + const message = createBasePacketState(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: PacketState): PacketStateAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: PacketStateAminoMsg): PacketState { + return PacketState.fromAmino(object.value); + }, + toAminoMsg(message: PacketState): PacketStateAminoMsg { + return { + type: "cosmos-sdk/PacketState", + value: PacketState.toAmino(message) + }; + }, + fromProtoMsg(message: PacketStateProtoMsg): PacketState { + return PacketState.decode(message.value); + }, + toProto(message: PacketState): Uint8Array { + return PacketState.encode(message).finish(); + }, + toProtoMsg(message: PacketState): PacketStateProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketState", + value: PacketState.encode(message).finish() + }; + } +}; +function createBasePacketId(): PacketId { + return { + portId: "", + channelId: "", + sequence: BigInt(0) + }; +} +export const PacketId = { + typeUrl: "/ibc.core.channel.v1.PacketId", + encode(message: PacketId, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(24).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PacketId { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePacketId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): PacketId { + return { + portId: isSet(object.portId) ? String(object.portId) : "", + channelId: isSet(object.channelId) ? String(object.channelId) : "", + sequence: isSet(object.sequence) ? BigInt(object.sequence.toString()) : BigInt(0) + }; + }, + toJSON(message: PacketId): JsonSafe { + const obj: any = {}; + message.portId !== undefined && (obj.portId = message.portId); + message.channelId !== undefined && (obj.channelId = message.channelId); + message.sequence !== undefined && (obj.sequence = (message.sequence || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): PacketId { + const message = createBasePacketId(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: PacketIdAmino): PacketId { + const message = createBasePacketId(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: PacketId): PacketIdAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: PacketIdAminoMsg): PacketId { + return PacketId.fromAmino(object.value); + }, + toAminoMsg(message: PacketId): PacketIdAminoMsg { + return { + type: "cosmos-sdk/PacketId", + value: PacketId.toAmino(message) + }; + }, + fromProtoMsg(message: PacketIdProtoMsg): PacketId { + return PacketId.decode(message.value); + }, + toProto(message: PacketId): Uint8Array { + return PacketId.encode(message).finish(); + }, + toProtoMsg(message: PacketId): PacketIdProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.PacketId", + value: PacketId.encode(message).finish() + }; + } +}; +function createBaseAcknowledgement(): Acknowledgement { + return { + result: undefined, + error: undefined + }; +} +export const Acknowledgement = { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + encode(message: Acknowledgement, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + writer.uint32(170).bytes(message.result); + } + if (message.error !== undefined) { + writer.uint32(178).string(message.error); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Acknowledgement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcknowledgement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 21: + message.result = reader.bytes(); + break; + case 22: + message.error = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Acknowledgement { + return { + result: isSet(object.result) ? bytesFromBase64(object.result) : undefined, + error: isSet(object.error) ? String(object.error) : undefined + }; + }, + toJSON(message: Acknowledgement): JsonSafe { + const obj: any = {}; + message.result !== undefined && (obj.result = message.result !== undefined ? base64FromBytes(message.result) : undefined); + message.error !== undefined && (obj.error = message.error); + return obj; + }, + fromPartial(object: Partial): Acknowledgement { + const message = createBaseAcknowledgement(); + message.result = object.result ?? undefined; + message.error = object.error ?? undefined; + return message; + }, + fromAmino(object: AcknowledgementAmino): Acknowledgement { + const message = createBaseAcknowledgement(); + if (object.result !== undefined && object.result !== null) { + message.result = bytesFromBase64(object.result); + } + if (object.error !== undefined && object.error !== null) { + message.error = object.error; + } + return message; + }, + toAmino(message: Acknowledgement): AcknowledgementAmino { + const obj: any = {}; + obj.result = message.result ? base64FromBytes(message.result) : undefined; + obj.error = message.error === null ? undefined : message.error; + return obj; + }, + fromAminoMsg(object: AcknowledgementAminoMsg): Acknowledgement { + return Acknowledgement.fromAmino(object.value); + }, + toAminoMsg(message: Acknowledgement): AcknowledgementAminoMsg { + return { + type: "cosmos-sdk/Acknowledgement", + value: Acknowledgement.toAmino(message) + }; + }, + fromProtoMsg(message: AcknowledgementProtoMsg): Acknowledgement { + return Acknowledgement.decode(message.value); + }, + toProto(message: Acknowledgement): Uint8Array { + return Acknowledgement.encode(message).finish(); + }, + toProtoMsg(message: Acknowledgement): AcknowledgementProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Acknowledgement", + value: Acknowledgement.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/ibc/core/client/v1/client.ts b/packages/arch3-proto/generated/ibc/core/client/v1/client.ts new file mode 100644 index 0000000..e453aba --- /dev/null +++ b/packages/arch3-proto/generated/ibc/core/client/v1/client.ts @@ -0,0 +1,955 @@ +/* eslint-disable */ +import { Any, AnyAmino } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { isSet } from "../../../../helpers"; +import { JsonSafe } from "../../../../json-safe"; +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientState { + /** client identifier */ + clientId: string; + /** client state */ + clientState?: Any; +} +export interface IdentifiedClientStateProtoMsg { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState"; + value: Uint8Array; +} +/** + * IdentifiedClientState defines a client state with an additional client + * identifier field. + */ +export interface IdentifiedClientStateAmino { + /** client identifier */ + client_id?: string; + /** client state */ + client_state?: AnyAmino; +} +export interface IdentifiedClientStateAminoMsg { + type: "cosmos-sdk/IdentifiedClientState"; + value: IdentifiedClientStateAmino; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeight { + /** consensus state height */ + height: Height; + /** consensus state */ + consensusState?: Any; +} +export interface ConsensusStateWithHeightProtoMsg { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight"; + value: Uint8Array; +} +/** + * ConsensusStateWithHeight defines a consensus state with an additional height + * field. + */ +export interface ConsensusStateWithHeightAmino { + /** consensus state height */ + height?: HeightAmino; + /** consensus state */ + consensus_state?: AnyAmino; +} +export interface ConsensusStateWithHeightAminoMsg { + type: "cosmos-sdk/ConsensusStateWithHeight"; + value: ConsensusStateWithHeightAmino; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStates { + /** client identifier */ + clientId: string; + /** consensus states and their heights associated with the client */ + consensusStates: ConsensusStateWithHeight[]; +} +export interface ClientConsensusStatesProtoMsg { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates"; + value: Uint8Array; +} +/** + * ClientConsensusStates defines all the stored consensus states for a given + * client. + */ +export interface ClientConsensusStatesAmino { + /** client identifier */ + client_id?: string; + /** consensus states and their heights associated with the client */ + consensus_states?: ConsensusStateWithHeightAmino[]; +} +export interface ClientConsensusStatesAminoMsg { + type: "cosmos-sdk/ClientConsensusStates"; + value: ClientConsensusStatesAmino; +} +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposal { + $typeUrl?: "/ibc.core.client.v1.ClientUpdateProposal"; + /** the title of the update proposal */ + title: string; + /** the description of the proposal */ + description: string; + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substituteClientId: string; +} +export interface ClientUpdateProposalProtoMsg { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal"; + value: Uint8Array; +} +/** + * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * client's latest consensus state is copied over to the subject client. The proposal + * handler may fail if the subject and the substitute do not match in client and + * chain parameters (with exception to latest height, frozen height, and chain-id). + */ +export interface ClientUpdateProposalAmino { + /** the title of the update proposal */ + title?: string; + /** the description of the proposal */ + description?: string; + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client standing in for the subject + * client + */ + substitute_client_id?: string; +} +export interface ClientUpdateProposalAminoMsg { + type: "cosmos-sdk/ClientUpdateProposal"; + value: ClientUpdateProposalAmino; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposal { + $typeUrl?: "/ibc.core.client.v1.UpgradeProposal"; + title: string; + description: string; + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgradedClientState?: Any; +} +export interface UpgradeProposalProtoMsg { + typeUrl: "/ibc.core.client.v1.UpgradeProposal"; + value: Uint8Array; +} +/** + * UpgradeProposal is a gov Content type for initiating an IBC breaking + * upgrade. + */ +export interface UpgradeProposalAmino { + title?: string; + description?: string; + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades + */ + upgraded_client_state?: AnyAmino; +} +export interface UpgradeProposalAminoMsg { + type: "cosmos-sdk/UpgradeProposal"; + value: UpgradeProposalAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +function createBaseIdentifiedClientState(): IdentifiedClientState { + return { + clientId: "", + clientState: undefined + }; +} +export const IdentifiedClientState = { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + encode(message: IdentifiedClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.clientState !== undefined) { + Any.encode(message.clientState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIdentifiedClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.clientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): IdentifiedClientState { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + clientState: isSet(object.clientState) ? Any.fromJSON(object.clientState) : undefined + }; + }, + toJSON(message: IdentifiedClientState): JsonSafe { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + message.clientState !== undefined && (obj.clientState = message.clientState ? Any.toJSON(message.clientState) : undefined); + return obj; + }, + fromPartial(object: Partial): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + message.clientId = object.clientId ?? ""; + message.clientState = object.clientState !== undefined && object.clientState !== null ? Any.fromPartial(object.clientState) : undefined; + return message; + }, + fromAmino(object: IdentifiedClientStateAmino): IdentifiedClientState { + const message = createBaseIdentifiedClientState(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.client_state !== undefined && object.client_state !== null) { + message.clientState = Any.fromAmino(object.client_state); + } + return message; + }, + toAmino(message: IdentifiedClientState): IdentifiedClientStateAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.client_state = message.clientState ? Any.toAmino(message.clientState) : undefined; + return obj; + }, + fromAminoMsg(object: IdentifiedClientStateAminoMsg): IdentifiedClientState { + return IdentifiedClientState.fromAmino(object.value); + }, + toAminoMsg(message: IdentifiedClientState): IdentifiedClientStateAminoMsg { + return { + type: "cosmos-sdk/IdentifiedClientState", + value: IdentifiedClientState.toAmino(message) + }; + }, + fromProtoMsg(message: IdentifiedClientStateProtoMsg): IdentifiedClientState { + return IdentifiedClientState.decode(message.value); + }, + toProto(message: IdentifiedClientState): Uint8Array { + return IdentifiedClientState.encode(message).finish(); + }, + toProtoMsg(message: IdentifiedClientState): IdentifiedClientStateProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.IdentifiedClientState", + value: IdentifiedClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusStateWithHeight(): ConsensusStateWithHeight { + return { + height: Height.fromPartial({}), + consensusState: undefined + }; +} +export const ConsensusStateWithHeight = { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + encode(message: ConsensusStateWithHeight, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.consensusState !== undefined) { + Any.encode(message.consensusState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusStateWithHeight { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusStateWithHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.consensusState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ConsensusStateWithHeight { + return { + height: isSet(object.height) ? Height.fromJSON(object.height) : undefined, + consensusState: isSet(object.consensusState) ? Any.fromJSON(object.consensusState) : undefined + }; + }, + toJSON(message: ConsensusStateWithHeight): JsonSafe { + const obj: any = {}; + message.height !== undefined && (obj.height = message.height ? Height.toJSON(message.height) : undefined); + message.consensusState !== undefined && (obj.consensusState = message.consensusState ? Any.toJSON(message.consensusState) : undefined); + return obj; + }, + fromPartial(object: Partial): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? Any.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ConsensusStateWithHeightAmino): ConsensusStateWithHeight { + const message = createBaseConsensusStateWithHeight(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = Any.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ConsensusStateWithHeight): ConsensusStateWithHeightAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : undefined; + obj.consensus_state = message.consensusState ? Any.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateWithHeightAminoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightAminoMsg { + return { + type: "cosmos-sdk/ConsensusStateWithHeight", + value: ConsensusStateWithHeight.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateWithHeightProtoMsg): ConsensusStateWithHeight { + return ConsensusStateWithHeight.decode(message.value); + }, + toProto(message: ConsensusStateWithHeight): Uint8Array { + return ConsensusStateWithHeight.encode(message).finish(); + }, + toProtoMsg(message: ConsensusStateWithHeight): ConsensusStateWithHeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ConsensusStateWithHeight", + value: ConsensusStateWithHeight.encode(message).finish() + }; + } +}; +function createBaseClientConsensusStates(): ClientConsensusStates { + return { + clientId: "", + consensusStates: [] + }; +} +export const ClientConsensusStates = { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + encode(message: ClientConsensusStates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + for (const v of message.consensusStates) { + ConsensusStateWithHeight.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientConsensusStates { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientConsensusStates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.consensusStates.push(ConsensusStateWithHeight.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientConsensusStates { + return { + clientId: isSet(object.clientId) ? String(object.clientId) : "", + consensusStates: Array.isArray(object?.consensusStates) ? object.consensusStates.map((e: any) => ConsensusStateWithHeight.fromJSON(e)) : [] + }; + }, + toJSON(message: ClientConsensusStates): JsonSafe { + const obj: any = {}; + message.clientId !== undefined && (obj.clientId = message.clientId); + if (message.consensusStates) { + obj.consensusStates = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toJSON(e) : undefined); + } else { + obj.consensusStates = []; + } + return obj; + }, + fromPartial(object: Partial): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + message.clientId = object.clientId ?? ""; + message.consensusStates = object.consensusStates?.map(e => ConsensusStateWithHeight.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ClientConsensusStatesAmino): ClientConsensusStates { + const message = createBaseClientConsensusStates(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + message.consensusStates = object.consensus_states?.map(e => ConsensusStateWithHeight.fromAmino(e)) || []; + return message; + }, + toAmino(message: ClientConsensusStates): ClientConsensusStatesAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + if (message.consensusStates) { + obj.consensus_states = message.consensusStates.map(e => e ? ConsensusStateWithHeight.toAmino(e) : undefined); + } else { + obj.consensus_states = message.consensusStates; + } + return obj; + }, + fromAminoMsg(object: ClientConsensusStatesAminoMsg): ClientConsensusStates { + return ClientConsensusStates.fromAmino(object.value); + }, + toAminoMsg(message: ClientConsensusStates): ClientConsensusStatesAminoMsg { + return { + type: "cosmos-sdk/ClientConsensusStates", + value: ClientConsensusStates.toAmino(message) + }; + }, + fromProtoMsg(message: ClientConsensusStatesProtoMsg): ClientConsensusStates { + return ClientConsensusStates.decode(message.value); + }, + toProto(message: ClientConsensusStates): Uint8Array { + return ClientConsensusStates.encode(message).finish(); + }, + toProtoMsg(message: ClientConsensusStates): ClientConsensusStatesProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ClientConsensusStates", + value: ClientConsensusStates.encode(message).finish() + }; + } +}; +function createBaseClientUpdateProposal(): ClientUpdateProposal { + return { + $typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + title: "", + description: "", + subjectClientId: "", + substituteClientId: "" + }; +} +export const ClientUpdateProposal = { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + encode(message: ClientUpdateProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.subjectClientId !== "") { + writer.uint32(26).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(34).string(message.substituteClientId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientUpdateProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientUpdateProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.subjectClientId = reader.string(); + break; + case 4: + message.substituteClientId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): ClientUpdateProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + subjectClientId: isSet(object.subjectClientId) ? String(object.subjectClientId) : "", + substituteClientId: isSet(object.substituteClientId) ? String(object.substituteClientId) : "" + }; + }, + toJSON(message: ClientUpdateProposal): JsonSafe { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.subjectClientId !== undefined && (obj.subjectClientId = message.subjectClientId); + message.substituteClientId !== undefined && (obj.substituteClientId = message.substituteClientId); + return obj; + }, + fromPartial(object: Partial): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + return message; + }, + fromAmino(object: ClientUpdateProposalAmino): ClientUpdateProposal { + const message = createBaseClientUpdateProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + return message; + }, + toAmino(message: ClientUpdateProposal): ClientUpdateProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.subject_client_id = message.subjectClientId === "" ? undefined : message.subjectClientId; + obj.substitute_client_id = message.substituteClientId === "" ? undefined : message.substituteClientId; + return obj; + }, + fromAminoMsg(object: ClientUpdateProposalAminoMsg): ClientUpdateProposal { + return ClientUpdateProposal.fromAmino(object.value); + }, + toAminoMsg(message: ClientUpdateProposal): ClientUpdateProposalAminoMsg { + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ClientUpdateProposalProtoMsg): ClientUpdateProposal { + return ClientUpdateProposal.decode(message.value); + }, + toProto(message: ClientUpdateProposal): Uint8Array { + return ClientUpdateProposal.encode(message).finish(); + }, + toProtoMsg(message: ClientUpdateProposal): ClientUpdateProposalProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(message).finish() + }; + } +}; +function createBaseUpgradeProposal(): UpgradeProposal { + return { + $typeUrl: "/ibc.core.client.v1.UpgradeProposal", + title: "", + description: "", + plan: Plan.fromPartial({}), + upgradedClientState: undefined + }; +} +export const UpgradeProposal = { + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + encode(message: UpgradeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(26).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 4: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): UpgradeProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + plan: isSet(object.plan) ? Plan.fromJSON(object.plan) : undefined, + upgradedClientState: isSet(object.upgradedClientState) ? Any.fromJSON(object.upgradedClientState) : undefined + }; + }, + toJSON(message: UpgradeProposal): JsonSafe { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + message.plan !== undefined && (obj.plan = message.plan ? Plan.toJSON(message.plan) : undefined); + message.upgradedClientState !== undefined && (obj.upgradedClientState = message.upgradedClientState ? Any.toJSON(message.upgradedClientState) : undefined); + return obj; + }, + fromPartial(object: Partial): UpgradeProposal { + const message = createBaseUpgradeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + return message; + }, + fromAmino(object: UpgradeProposalAmino): UpgradeProposal { + const message = createBaseUpgradeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + return message; + }, + toAmino(message: UpgradeProposal): UpgradeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + return obj; + }, + fromAminoMsg(object: UpgradeProposalAminoMsg): UpgradeProposal { + return UpgradeProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpgradeProposal): UpgradeProposalAminoMsg { + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeProposalProtoMsg): UpgradeProposal { + return UpgradeProposal.decode(message.value); + }, + toProto(message: UpgradeProposal): Uint8Array { + return UpgradeProposal.encode(message).finish(); + }, + toProtoMsg(message: UpgradeProposal): UpgradeProposalProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(message).finish() + }; + } +}; +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Height { + return { + revisionNumber: isSet(object.revisionNumber) ? BigInt(object.revisionNumber.toString()) : BigInt(0), + revisionHeight: isSet(object.revisionHeight) ? BigInt(object.revisionHeight.toString()) : BigInt(0) + }; + }, + toJSON(message: Height): JsonSafe { + const obj: any = {}; + message.revisionNumber !== undefined && (obj.revisionNumber = (message.revisionNumber || BigInt(0)).toString()); + message.revisionHeight !== undefined && (obj.revisionHeight = (message.revisionHeight || BigInt(0)).toString()); + return obj; + }, + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HeightAmino): Height { + return { + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0") + }; + }, + toAmino(message: Height): HeightAmino { + const obj: any = {}; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); + }, + toAminoMsg(message: Height): HeightAminoMsg { + return { + type: "cosmos-sdk/Height", + value: Height.toAmino(message) + }; + }, + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); + }, + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); + }, + toProtoMsg(message: Height): HeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Height", + value: Height.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + allowedClients: [] + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromJSON(object: any): Params { + return { + allowedClients: Array.isArray(object?.allowedClients) ? object.allowedClients.map((e: any) => String(e)) : [] + }; + }, + toJSON(message: Params): JsonSafe { + const obj: any = {}; + if (message.allowedClients) { + obj.allowedClients = message.allowedClients.map(e => e); + } else { + obj.allowedClients = []; + } + return obj; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map(e => e); + } else { + obj.allowed_clients = message.allowedClients; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/packages/arch3-proto/generated/index.ts b/packages/arch3-proto/generated/index.ts index 9cb3dd6..3df363b 100644 --- a/packages/arch3-proto/generated/index.ts +++ b/packages/arch3-proto/generated/index.ts @@ -1,8 +1,8 @@ /* eslint-disable */ /** - * This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12 + * This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain - * and run the transpile command or yarn proto command to regenerate this bundle. + * and run the transpile command or npm scripts command that is used to regenerate this bundle. */ export * from "./amino/bundle"; @@ -10,7 +10,9 @@ export * from "./archway/bundle"; export * from "./archway/client"; export * from "./cosmos/bundle"; export * from "./gogoproto/bundle"; +export * from "./ibc/bundle"; export * from "./google/bundle"; +export * from "./json-safe"; export * from "./varint"; export * from "./utf8"; export * from "./binary"; diff --git a/packages/arch3-proto/generated/json-safe.ts b/packages/arch3-proto/generated/json-safe.ts new file mode 100644 index 0000000..67a540f --- /dev/null +++ b/packages/arch3-proto/generated/json-safe.ts @@ -0,0 +1,11 @@ +/* eslint-disable */ +/** +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 +* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain +* and run the transpile command or npm scripts command that is used to regenerate this bundle. +*/ + + +export type JsonSafe = { + [Prop in keyof T]: T[Prop] extends Uint8Array | bigint | Date ? string : T[Prop]; +} diff --git a/packages/arch3-proto/generated/types.ts b/packages/arch3-proto/generated/types.ts index 72d1689..cda23c1 100644 --- a/packages/arch3-proto/generated/types.ts +++ b/packages/arch3-proto/generated/types.ts @@ -1,8 +1,8 @@ /* eslint-disable */ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain -* and run the transpile command or yarn proto command to regenerate this bundle. +* and run the transpile command or npm scripts command that is used to regenerate this bundle. */ import { IBinaryReader, IBinaryWriter } from "./binary"; diff --git a/packages/arch3-proto/generated/utf8.ts b/packages/arch3-proto/generated/utf8.ts index d20a671..2054c52 100644 --- a/packages/arch3-proto/generated/utf8.ts +++ b/packages/arch3-proto/generated/utf8.ts @@ -1,8 +1,8 @@ /* eslint-disable */ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain -* and run the transpile command or yarn proto command to regenerate this bundle. +* and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/packages/arch3-proto/generated/varint.ts b/packages/arch3-proto/generated/varint.ts index 2c7fc71..07c151b 100644 --- a/packages/arch3-proto/generated/varint.ts +++ b/packages/arch3-proto/generated/varint.ts @@ -1,8 +1,8 @@ /* eslint-disable */ /** -* This file and any referenced files were automatically generated by @cosmology/telescope@1.4.12 +* This file and any referenced files were automatically generated by @cosmology/telescope@1.8.3 * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain -* and run the transpile command or yarn proto command to regenerate this bundle. +* and run the transpile command or npm scripts command that is used to regenerate this bundle. */ diff --git a/packages/arch3-proto/package.json b/packages/arch3-proto/package.json index f5808d7..239f60e 100644 --- a/packages/arch3-proto/package.json +++ b/packages/arch3-proto/package.json @@ -58,10 +58,10 @@ "@cosmjs/proto-signing": "^0.32.4", "@cosmjs/stargate": "^0.32.4", "@cosmjs/tendermint-rpc": "^0.32.4", - "protobufjs": "^7.2.5" + "protobufjs": "^7.4.0" }, "devDependencies": { - "@cosmology/telescope": "^1.4.12", + "@cosmology/telescope": "^1.8.3", "@types/jest": "^29.5.7", "@types/node": "^20.8.10", "@types/webgl2": "^0.0.9", @@ -77,7 +77,7 @@ "jest": "^29.7.0", "prettier": "^3.0.3", "prettier-eslint": "^16.1.2", - "regenerator-runtime": "^0.14.0", + "regenerator-runtime": "^0.14.1", "rimraf": "^5.0.5", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", diff --git a/packages/arch3-proto/proto/amino/amino.proto b/packages/arch3-proto/proto/amino/amino.proto index e1cc692..fb099b8 100644 --- a/packages/arch3-proto/proto/amino/amino.proto +++ b/packages/arch3-proto/proto/amino/amino.proto @@ -76,4 +76,9 @@ extend google.protobuf.FieldOptions { // out := AminoJSONEncoder(&f); // out == {"baz":""} bool dont_omitempty = 11110005; -} + + // oneof_name sets the type name for the given field oneof field. This is used + // by the Amino JSON encoder to encode the type of the oneof field, and must be the same string in + // the RegisterConcrete() method usage used to register the concrete type. + string oneof_name = 11110006; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/callback/v1/callback.proto b/packages/arch3-proto/proto/archway/callback/v1/callback.proto new file mode 100644 index 0000000..513b6fe --- /dev/null +++ b/packages/arch3-proto/proto/archway/callback/v1/callback.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package archway.callback.v1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/archway-network/archway/x/callback/types"; + +// Callback defines the callback structure. +message Callback { + // contract_address is the address of the contract which is requesting the callback (bech32 encoded). + string contract_address = 1; + // job_id is an identifier the callback requestor can pass in to identify the callback when it happens. + uint64 job_id = 2; + // callback_height is the height at which the callback is executed. + int64 callback_height = 3; + // fee_split is the breakdown of the fees paid by the contract to reserve the callback + CallbackFeesFeeSplit fee_split = 4; + // reserved_by is the address which reserved the callback (bech32 encoded). + string reserved_by = 5; + // callback_gas_limit is the maximum gas that can be consumed by this callback. + uint64 max_gas_limit = 6; +} + +// CallbackFeesFeeSplit is the breakdown of all the fees that need to be paid by the contract to reserve a callback +message CallbackFeesFeeSplit { + // transaction_fees is the transaction fees for the callback based on its gas consumption + cosmos.base.v1beta1.Coin transaction_fees = 1; + // block_reservation_fees is the block reservation fees portion of the callback reservation fees + cosmos.base.v1beta1.Coin block_reservation_fees = 2; + // future_reservation_fees is the future reservation fees portion of the callback reservation fees + cosmos.base.v1beta1.Coin future_reservation_fees = 3; + // surplus_fees is any extra fees passed in for the registration of the callback + cosmos.base.v1beta1.Coin surplus_fees = 4; + } + +// Params defines the module parameters. +message Params { + // callback_gas_limit is the maximum gas that can be consumed by a callback. + uint64 callback_gas_limit = 1; + // max_block_reservation_limit is the maximum number of callbacks which can be registered in a given block. + uint64 max_block_reservation_limit = 2; + // max_future_reservation_limit is the maximum number of blocks in the future that a contract can request a callback in. + uint64 max_future_reservation_limit = 3; + // block_reservation_fee_multiplier is used to calculate a part of the reservation fees which will need to be paid when requesting the callback. + string block_reservation_fee_multiplier = 4 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; + // future_reservation_fee_multiplier is used to calculate a part of the reservation fees which will need to be paid while requesting the callback. + string future_reservation_fee_multiplier = 5 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/callback/v1/errors.proto b/packages/arch3-proto/proto/archway/callback/v1/errors.proto new file mode 100644 index 0000000..0139a78 --- /dev/null +++ b/packages/arch3-proto/proto/archway/callback/v1/errors.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package archway.callback.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/archway-network/archway/x/callback/types"; + +// ModuleErrors defines the module level error codes +enum ModuleErrors { + // ERR_UNKNOWN is the default error code + ERR_UNKNOWN = 0; + // ERR_OUT_OF_GAS is the error code when the contract callback exceeds the gas limit allowed by the module + ERR_OUT_OF_GAS = 1; + // ERR_CONTRACT_EXECUTION_FAILED is the error code when the contract callback execution fails + ERR_CONTRACT_EXECUTION_FAILED = 2; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/callback/v1/events.proto b/packages/arch3-proto/proto/archway/callback/v1/events.proto new file mode 100644 index 0000000..669175b --- /dev/null +++ b/packages/arch3-proto/proto/archway/callback/v1/events.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package archway.callback.v1; + +option go_package = "github.com/archway-network/archway/x/callback/types"; + +import "archway/callback/v1/callback.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; + +// CallbackRegisteredEvent is emitted when a callback is registered. +message CallbackRegisteredEvent { + // contract_address is the address of the contract for which callback is being registered (bech32 encoded). + string contract_address = 1; + // job_id is an identifier of the callback. + uint64 job_id = 2; + // callback_height is the height at which the callback is executed. + int64 callback_height = 3; + // fee_split is the breakdown of the fees paid by the contract to reserve the callback + CallbackFeesFeeSplit fee_split = 4; + // reserved_by is the address which reserved the callback (bech32 encoded). + string reserved_by = 5; +} + +// CallbackCancelledEvent is emitted when a callback is cancelled. +message CallbackCancelledEvent { + // cancelled_by is the address of the contract whose callback is being cancelled (bech32 encoded) + string cancelled_by = 1; + // contract_address is the address of the contract (bech32 encoded) + string contract_address = 2; + // job_id is an identifier the callback requestor had passed during registration of the callback + uint64 job_id = 3; + // callback_height is the height at which the callback requestor had registered the callback + int64 callback_height = 4; + // refund_amount is the amount of fees which was refunded on cancellation + cosmos.base.v1beta1.Coin refund_amount = 5 [ (gogoproto.nullable) = false ]; +} + +// CallbackExecutedSuccessEvent is emitted when a callback is executed successfully. +message CallbackExecutedSuccessEvent { + // contract_address is the address of the contract for which callback is being executed (bech32 encoded). + string contract_address = 1; + // job_id is an identifier of the callback. + uint64 job_id = 2; + // sudo_msg is the input passed by the module to the contract + string sudo_msg = 3; + // gas_used is the amount of gas consumed during the callback execution + uint64 gas_used = 4; +} + +// CallbackExecutedFailedEvent is emitted when a callback execution fails. +message CallbackExecutedFailedEvent { + // contract_address is the address of the contract for which callback is being executed (bech32 encoded). + string contract_address = 1; + // job_id is an identifier of the callback. + uint64 job_id = 2; + // sudo_msg is the input passed by the module to the contract + string sudo_msg = 3; + // gas_used is the amount of gas consumed during the callback execution + uint64 gas_used = 4; + // error is the error returned during the callback execution + string error = 5; +} diff --git a/packages/arch3-proto/proto/archway/callback/v1/genesis.proto b/packages/arch3-proto/proto/archway/callback/v1/genesis.proto new file mode 100644 index 0000000..d81c594 --- /dev/null +++ b/packages/arch3-proto/proto/archway/callback/v1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package archway.callback.v1; + +option go_package = "github.com/archway-network/archway/x/callback/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "archway/callback/v1/callback.proto"; + +// GenesisState defines the initial state of the callback module. +message GenesisState { + // params defines all the module parameters. + Params params = 1 [ (gogoproto.nullable) = false ]; + // callbacks defines all the callbacks which are yet to be executed + repeated Callback callbacks = 2; +} diff --git a/packages/arch3-proto/proto/archway/callback/v1/query.proto b/packages/arch3-proto/proto/archway/callback/v1/query.proto new file mode 100644 index 0000000..3714dec --- /dev/null +++ b/packages/arch3-proto/proto/archway/callback/v1/query.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; +package archway.callback.v1; + +option go_package = "github.com/archway-network/archway/x/callback/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "archway/callback/v1/callback.proto"; + +// Query service for the callback module. +service Query { + // Params returns module parameters + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/archway/callback/v1/params"; + } + // EstimateCallbackFees returns the total amount of callback fees a contract needs to pay to register the callback + rpc EstimateCallbackFees(QueryEstimateCallbackFeesRequest) returns (QueryEstimateCallbackFeesResponse) { + option (google.api.http).get = "/archway/callback/v1/estimate_callback_fees"; + } + // Callbacks returns all the callbacks registered at a given height + rpc Callbacks(QueryCallbacksRequest) returns (QueryCallbacksResponse) { + option (google.api.http).get = "/archway/callback/v1/callbacks"; + } +} + +// QueryParamsRequest is the request for Query.Params. +message QueryParamsRequest {} + +// QueryParamsResponse is the response for Query.Params. +message QueryParamsResponse { + // params defines all the module parameters. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryEstimateCallbackFeesRequest is the request for Query.EstimateCallbackFees. +message QueryEstimateCallbackFeesRequest{ + // block_height is the height at which to estimate the callback fees + int64 block_height = 1; +} + +// QueryEstimateCallbackFeesResponse is the response for Query.EstimateCallbackFees. +message QueryEstimateCallbackFeesResponse{ + // total_fees is the total fees that needs to be paid by the contract to reserve a callback + cosmos.base.v1beta1.Coin total_fees = 1; + // fee_split is the breakdown of the total_fees + CallbackFeesFeeSplit fee_split = 2; +} + +// QueryCallbacksRequest is the request for Query.Callbacks. +message QueryCallbacksRequest{ + // block_height is the height at which to query the callbacks + int64 block_height = 1; +} + +// QueryCallbacksResponse is the response for Query.Callbacks. +message QueryCallbacksResponse{ + // callbacks is the list of callbacks registered at the given height + repeated Callback callbacks = 1; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/callback/v1/tx.proto b/packages/arch3-proto/proto/archway/callback/v1/tx.proto new file mode 100644 index 0000000..1903458 --- /dev/null +++ b/packages/arch3-proto/proto/archway/callback/v1/tx.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; +package archway.callback.v1; + +option go_package = "github.com/archway-network/archway/x/callback/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "archway/callback/v1/callback.proto"; + +// Msg defines the module messaging service. +service Msg { + option (cosmos.msg.v1.service) = true; + // UpdateParams defines a governance operation for updating the x/callback + // module parameters. The authority is defined in the keeper. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // RequestCallback defines a message for registering a callback at a specific height by a given contract + rpc RequestCallback(MsgRequestCallback) returns (MsgRequestCallbackResponse); + + // CancelCallback defines a message for cancelling an existing callback + rpc CancelCallback(MsgCancelCallback) returns (MsgCancelCallbackResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + // params defines the x/callback parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "params,omitempty"]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. +message MsgUpdateParamsResponse {} + +// MsgRequestCallback is the Msg/RequestCallback request type. +message MsgRequestCallback { + option (cosmos.msg.v1.signer) = "sender"; + // sender is the address who is requesting the callback (bech32 encoded) + string sender = 1; + // contract_address is the address of the contract which is requesting the callback (bech32 encoded) + string contract_address = 2; + // job_id is an identifier the callback requestor can pass in to identify the callback when it happens + uint64 job_id = 3; + // callback_height is the height at which the callback is executed. + int64 callback_height = 4; + // fees is the amount of fees being paid to register the contract + cosmos.base.v1beta1.Coin fees = 5 [ (gogoproto.nullable) = false ]; +} + + +// MsgRequestCallbackResponse defines the response structure for executing a MsgRequestCallback message. +message MsgRequestCallbackResponse {} + +// MsgCancelCallback is the Msg/CancelCallback request type. +message MsgCancelCallback{ + option (cosmos.msg.v1.signer) = "sender"; + // sender is the address of the contract which is cancelling the callback (bech32 encoded) + string sender = 1; + // contract_address is the address of the contract (bech32 encoded) + string contract_address = 2; + // job_id is an identifier the callback requestor had passed during registration of the callback + uint64 job_id = 3; + // callback_height is the height at which the callback requestor had registered the callback + int64 callback_height = 4; +} + + +// MsgCancelCallbackResponse defines the response structure for executing a MsgCancelCallback message. +message MsgCancelCallbackResponse { + // refund is the amount of fees being refunded due to the cancellation of the callback + cosmos.base.v1beta1.Coin refund = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwerrors/v1/cwerrors.proto b/packages/arch3-proto/proto/archway/cwerrors/v1/cwerrors.proto new file mode 100644 index 0000000..ded53ea --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwerrors/v1/cwerrors.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package archway.cwerrors.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/archway-network/archway/x/cwerrors/types"; + +// SudoError defines the sudo message for the error callback +message SudoError { + // module_name is the name of the module throwing the error + string module_name = 1; + // error_code is the module level error code + int32 error_code = 2; + // contract_address is the address of the contract which will receive the + // error callback + string contract_address = 3; + // input_payload is any input which caused the error + string input_payload = 4; + // error_message is the error message + string error_message = 5; +} + +// ModuleErrors defines the module level error codes +enum ModuleErrors { + // ERR_UNKNOWN is the default error code + ERR_UNKNOWN = 0; + // ERR_CALLBACK_EXECUTION_FAILED is the error code for when the error callback fails + ERR_CALLBACK_EXECUTION_FAILED = 1; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwerrors/v1/events.proto b/packages/arch3-proto/proto/archway/cwerrors/v1/events.proto new file mode 100644 index 0000000..58ca6bb --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwerrors/v1/events.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package archway.cwerrors.v1; + +import "gogoproto/gogo.proto"; +import "archway/cwerrors/v1/params.proto"; +import "archway/cwerrors/v1/cwerrors.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/archway-network/archway/x/cwerrors/types"; + +// ParamsUpdatedEvent defines the event which is thrown when the module +// parameters are updated +message ParamsUpdatedEvent { + // new_params are the new parameters for the module + Params new_params = 1 [ (gogoproto.nullable) = false ]; + // authority is the address of the authority that updated the parameters + string authority = 2; +} + +// SubscribedToErrorsEvent defines the event which is thrown when a contract +// subscribes to errors +message SubscribedToErrorsEvent { + // sender is the address which initiated the subscription + string sender = 1; + // contract_address is the address of the contract which is subscribed to + // errors + string contract_address = 2; + // fees_paid is the fees paid for the subscription + cosmos.base.v1beta1.Coin fees_paid = 3 [ (gogoproto.nullable) = false ]; + // subscription_valid_till is the block height till which the subscription is + // valid + int64 subscription_valid_till = 4; +} + +// StoringErrorEvent defines the event which is thrown when an error is stored +message StoringErrorEvent { + // error is the error which is stored + SudoError error = 1 [ (gogoproto.nullable) = false ]; + // deletion_block_height is the block height at which the error will be pruned + // from the state + int64 deletion_block_height = 2; +} + +// SudoErrorCallbackFailedEvent defines the event which is thrown when a sudo +// error callback fails +message SudoErrorCallbackFailedEvent { + // error is the error for which the callback is executed + SudoError error = 1 [ (gogoproto.nullable) = false ]; + // callback_error_message is the error message of why the callback failed + string callback_error_message = 2; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwerrors/v1/genesis.proto b/packages/arch3-proto/proto/archway/cwerrors/v1/genesis.proto new file mode 100644 index 0000000..96d572d --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwerrors/v1/genesis.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package archway.cwerrors.v1; + +import "gogoproto/gogo.proto"; +import "archway/cwerrors/v1/params.proto"; +import "archway/cwerrors/v1/cwerrors.proto"; + +option go_package = "github.com/archway-network/archway/x/cwerrors/types"; + +// GenesisState defines the cwerrors module's genesis state. +message GenesisState { + // params defines all the module parameters. + Params params = 1 [ (gogoproto.nullable) = false ]; + // errors defines all the sudo errors currently registered. + repeated SudoError errors = 2 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwerrors/v1/params.proto b/packages/arch3-proto/proto/archway/cwerrors/v1/params.proto new file mode 100644 index 0000000..a167594 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwerrors/v1/params.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package archway.cwerrors.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/archway-network/archway/x/cwerrors/types"; + +// Params defines the set of parameters for the cwerrors module. +message Params { + // error_stored_time is the block height until which error is stored + int64 error_stored_time = 1; + // subsciption_fee is the fee required to subscribe to error callbacks + cosmos.base.v1beta1.Coin subscription_fee = 2 + [ (gogoproto.nullable) = false ]; + // subscription_period is the period for which the subscription is valid + int64 subscription_period = 3; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwerrors/v1/query.proto b/packages/arch3-proto/proto/archway/cwerrors/v1/query.proto new file mode 100644 index 0000000..a1d2150 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwerrors/v1/query.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; +package archway.cwerrors.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "archway/cwerrors/v1/cwerrors.proto"; +import "archway/cwerrors/v1/params.proto"; + +option go_package = "github.com/archway-network/archway/x/cwerrors/types"; + +// Query service for the cwerrors module. +service Query { + // Params queries all the module parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/archway/cwerrors/v1/params"; + } + + // Errors queries all the errors for a given contract. + rpc Errors(QueryErrorsRequest) returns (QueryErrorsResponse) { + option (google.api.http).get = "/archway/cwerrors/v1/errors"; + } + + // IsSubscribed queries if a contract is subscribed to sudo error callbacks. + rpc IsSubscribed(QueryIsSubscribedRequest) + returns (QueryIsSubscribedResponse) { + option (google.api.http).get = "/archway/cwerrors/v1/is_subscribed"; + } +} + +// QueryParamsRequest is the request for Query.Params. +message QueryParamsRequest {} + +// QueryParamsResponse is the response for Query.Params. +message QueryParamsResponse { + // params defines all the module parameters. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryErrorsRequest is the request for Query.Errors. +message QueryErrorsRequest { + // contract_address is the address of the contract whose errors to query for + string contract_address = 1; +} + +// QueryErrorsResponse is the response for Query.Errors. +message QueryErrorsResponse { + // errors defines all the contract errors which will be returned + repeated SudoError errors = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryIsSubscribedRequest is the request for Query.IsSubscribed. +message QueryIsSubscribedRequest { + // contract_address is the address of the contract to query if subscribed + string contract_address = 1; +} + +// QueryIsSubscribedResponse is the response for Query.IsSubscribed. +message QueryIsSubscribedResponse { + // subscribed defines if the contract is subscribed to sudo error callbacks + bool subscribed = 1; + // subscription_valid_till defines the block height till which the + // subscription is valid + int64 subscription_valid_till = 2; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwerrors/v1/tx.proto b/packages/arch3-proto/proto/archway/cwerrors/v1/tx.proto new file mode 100644 index 0000000..a755ec0 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwerrors/v1/tx.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package archway.cwerrors.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "archway/cwerrors/v1/params.proto"; + +option go_package = "github.com/archway-network/archway/x/cwerrors/types"; + +// Msg defines the cwerrors Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // UpdateParams defines a governance operation for updating the x/cwerrors + // module parameters. The authority is defined in the keeper. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // SubscribeToError defines an operation which will register a contract for a + // sudo callback on errors + rpc SubscribeToError(MsgSubscribeToError) + returns (MsgSubscribeToErrorResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1; + // params defines the x/cwerrors parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "params,omitempty" + ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} + +// MsgSubscribeToError is the Msg/SubscribeToError request type. +message MsgSubscribeToError { + option (cosmos.msg.v1.signer) = "sender"; + // sender is the address of who is registering the contarcts for callback on + // error + string sender = 1; + // contract is the address of the contract that will be called on error + string contract_address = 2; + // fee is the subscription fee for the feature (current no fee is charged for + // this feature) + cosmos.base.v1beta1.Coin fee = 3 [ (gogoproto.nullable) = false ]; +} + +// MsgSubscribeToErrorResponse defines the response structure for executing a +// MsgSubscribeToError message. +message MsgSubscribeToErrorResponse { + // subscription_valid_till is the block height till which the subscription is + // valid + int64 subscription_valid_till = 1; +} diff --git a/packages/arch3-proto/proto/archway/cwfees/v1/cwfees.proto b/packages/arch3-proto/proto/archway/cwfees/v1/cwfees.proto new file mode 100644 index 0000000..3bf230c --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwfees/v1/cwfees.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; +package archway.cwfees.v1; + +import "google/protobuf/any.proto"; + +import "cosmos/msg/v1/msg.proto"; + + +option go_package = "github.com/archway-network/archway/x/cwfees/types"; + +service Msg { + option (cosmos.msg.v1.service) = true; + // RegisterAsGranter allows a cosmwasm contract to register itself as a fee granter. + rpc RegisterAsGranter(MsgRegisterAsGranter) returns (MsgRegisterAsGranterResponse); + // UnregisterAsGranter allows a cosmwasm contract to unregister itself as a fee granter. + rpc UnregisterAsGranter(MsgUnregisterAsGranter) returns (MsgUnregisterAsGranterResponse); +} + +// MsgRegisterAsGranter allows a contract to register itself as a fee granter. +message MsgRegisterAsGranter { + option (cosmos.msg.v1.signer) = "granting_contract"; + string granting_contract = 1; +} + +// MsgRegisterAsGranterResponse defines the response of RegisterAsGranter. +message MsgRegisterAsGranterResponse {} + +// MsgUnregisterAsGranter can be used by a cosmwasm contract to unregister itself as a fee granter. +message MsgUnregisterAsGranter { + option (cosmos.msg.v1.signer) = "granting_contract"; + string granting_contract = 1; +} + +// MsgUnregisterAsGranterResponse defines the response of UnregisterAsGranter. +message MsgUnregisterAsGranterResponse {} + +service Query { + // IsGrantingContract can be used to check if a contract is a granting contract. + rpc IsGrantingContract(IsGrantingContractRequest) returns (IsGrantingContractResponse); +} + +// IsGrantingContract is the request type of IsGrantingContract RPC. +message IsGrantingContractRequest { + // contract_address defines the address of the contract + // which we want to check if it is a granter or not. + string contract_address = 1; +} + +// IsGrantingContractResponse is the response type of IsGRantingContract RPC. +message IsGrantingContractResponse { + // is_granting_contract report if the contract is a granter or not. + bool is_granting_contract = 1; +} + +// GenesisState represents the genesis state of the cwfeesant module. +message GenesisState { + repeated string granting_contracts = 1; +} diff --git a/packages/arch3-proto/proto/archway/cwica/v1/errors.proto b/packages/arch3-proto/proto/archway/cwica/v1/errors.proto new file mode 100644 index 0000000..890bb11 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwica/v1/errors.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package archway.cwica.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/archway-network/archway/x/cwica/types"; + +// ModuleErrors defines the module level error codes +enum ModuleErrors { + // ERR_UNKNOWN is the default error code + ERR_UNKNOWN = 0; + // ERR_PACKET_TIMEOUT is the error code for packet timeout + ERR_PACKET_TIMEOUT = 1; + // ERR_EXEC_FAILURE is the error code for tx execution failure + ERR_EXEC_FAILURE = 2; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwica/v1/genesis.proto b/packages/arch3-proto/proto/archway/cwica/v1/genesis.proto new file mode 100644 index 0000000..0073fe2 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwica/v1/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package archway.cwica.v1; + +import "gogoproto/gogo.proto"; +import "archway/cwica/v1/params.proto"; + +option go_package = "github.com/archway-network/archway/x/cwica/types"; + +// GenesisState defines the cwica module's genesis state. +message GenesisState { + // params defines all the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwica/v1/params.proto b/packages/arch3-proto/proto/archway/cwica/v1/params.proto new file mode 100644 index 0000000..9925b17 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwica/v1/params.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package archway.cwica.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/archway-network/archway/x/cwica/types"; + +// Params defines the parameters for the module. +message Params { + // Defines maximum amount of messages which can be passed in MsgSendTx + uint64 msg_send_tx_max_messages = 1; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwica/v1/query.proto b/packages/arch3-proto/proto/archway/cwica/v1/query.proto new file mode 100644 index 0000000..2fa6466 --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwica/v1/query.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package archway.cwica.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "archway/cwica/v1/params.proto"; + +option go_package = "github.com/archway-network/archway/x/cwica/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the module parameters + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/archway/cwica/params"; + } +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters for the module + Params params = 1 [ (gogoproto.nullable) = false ]; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwica/v1/sudo.proto b/packages/arch3-proto/proto/archway/cwica/v1/sudo.proto new file mode 100644 index 0000000..a998bce --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwica/v1/sudo.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package archway.cwica.v1; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +option go_package = "github.com/archway-network/archway/x/cwica/types"; + +// Sudopayload is the payload for the sudo call sent by the cwica module on IBC +// actions +message SudoPayload { + // ICA is the message which carries the success responses + ICASuccess ica = 1; +} + +// ICASuccess is the success message after the ICA operation has taken place +message ICASuccess { + // account_registered is the message which carries the success response after + // the ica account has been registered + AccountRegistered account_registered = 1; + // tx_executed is the message which carries the success response after the ica + // tx has been executed + TxExecuted tx_executed = 2; +} + +// AccountRegistered is contains the address of the registered account on the +// counterparty chain +message AccountRegistered { + // counterparty_address is the address of the account on the counterparty + // chain + string counterparty_address = 1; +} + +// TxExecuted is the response message after the execute of the ICA tx +message TxExecuted { + // packet is the ibc packet which was executed + ibc.core.channel.v1.Packet packet = 1; + // data is the response data after the tx has been executed + bytes data = 2; +} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/cwica/v1/tx.proto b/packages/arch3-proto/proto/archway/cwica/v1/tx.proto new file mode 100644 index 0000000..945067e --- /dev/null +++ b/packages/arch3-proto/proto/archway/cwica/v1/tx.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; +package archway.cwica.v1; + +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/api/http.proto"; +import "google/protobuf/any.proto"; +import "archway/cwica/v1/params.proto"; + +option go_package = "github.com/archway-network/archway/x/cwica/types"; + +// Msg defines the Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + // RegisterInterchainAccount registers an account on the counterparty chain. + rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) + returns (MsgRegisterInterchainAccountResponse) {} + // SendTx submits a transaction with msgs to the counterparty chain. + rpc SendTx(MsgSendTx) returns (MsgSendTxResponse) {} + // UpdateParams updates the cwica module parameters. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgRegisterInterchainAccount defines the Msg/RegisterInterchainAccount +// request type. +message MsgRegisterInterchainAccount { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "contract_address"; + // contract_address is the address of the contrat who wants to register an ica + // account on the counterparty chain + string contract_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // connection_id is the connection id between the two chains + string connection_id = 2 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ]; +} + +// MsgRegisterInterchainAccountResponse defines the response for +// Msg/RegisterInterchainAccount +message MsgRegisterInterchainAccountResponse {} + +// MsgSendTx defines the Msg/SendTx request type. +message MsgSendTx { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "contract_address"; + // contract_address is the address of the who wants to submit a transaction to + // the counterparty chain + string contract_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // connection_id is the connection id between the two chains + string connection_id = 2; + // msgs are the messages to be submitted to the counterparty chain + repeated google.protobuf.Any msgs = 3; + // memo is the memo to be included in the packet + string memo = 4; + // timeout in seconds after which the packet times out + uint64 timeout = 5; +} + +// MsgSendTxResponse defines the response for Msg/SendTx +message MsgSendTxResponse { + // sequence_id is the channel's sequence_id for outgoing ibc packet. Unique + // per a channel. + uint64 sequence_id = 1; + // channel is the channel id the transaction was submitted from + string channel = 2; +} + +// MsgUpdateParams is the MsgUpdateParams request type. +message MsgUpdateParams { + option (amino.name) = "cwica/MsgUpdateParams"; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the authority that is allowed to update the + // cwica module parameters. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // params deines the module parmeters to update + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse is the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/packages/arch3-proto/proto/archway/rewards/v1/query.proto b/packages/arch3-proto/proto/archway/rewards/v1/query.proto index c824087..c991836 100644 --- a/packages/arch3-proto/proto/archway/rewards/v1/query.proto +++ b/packages/arch3-proto/proto/archway/rewards/v1/query.proto @@ -126,8 +126,6 @@ message QueryEstimateTxFeesResponse { // BlockTracking is the tracking information for a block. message BlockTracking { - option (gogoproto.goproto_stringer) = false; - // inflation_rewards defines the inflation rewards for the block. BlockRewards inflation_rewards = 1 [ (gogoproto.nullable) = false ]; // tx_rewards defines the transaction rewards for the block. diff --git a/packages/arch3-proto/proto/archway/rewards/v1/rewards.proto b/packages/arch3-proto/proto/archway/rewards/v1/rewards.proto index d369930..c945f67 100644 --- a/packages/arch3-proto/proto/archway/rewards/v1/rewards.proto +++ b/packages/arch3-proto/proto/archway/rewards/v1/rewards.proto @@ -6,22 +6,23 @@ option go_package = "github.com/archway-network/archway/x/rewards/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; // Params defines the module parameters. message Params { - option (gogoproto.goproto_stringer) = false; - // inflation_rewards_ratio defines the percentage of minted inflation tokens // that are used for dApp rewards [0.0, 1.0]. If set to 0.0, no inflation // rewards are distributed. string inflation_rewards_ratio = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // tx_fee_rebate_ratio defines the percentage of tx fees that are used for // dApp rewards [0.0, 1.0]. If set to 0.0, no fee rewards are distributed. string tx_fee_rebate_ratio = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // max_withdraw_records defines the maximum number of RewardsRecord objects @@ -40,8 +41,6 @@ message Params { // ContractMetadata defines the contract rewards distribution options for a // particular contract. message ContractMetadata { - option (gogoproto.goproto_stringer) = false; - // contract_address defines the contract address (bech32 encoded). string contract_address = 1; // owner_address is the contract owner address that can modify contract reward @@ -60,8 +59,6 @@ message ContractMetadata { // BlockRewards defines block related rewards distribution data. message BlockRewards { - option (gogoproto.goproto_stringer) = false; - // height defines the block height. int64 height = 1; // inflation_rewards is the rewards to be distributed. @@ -74,8 +71,6 @@ message BlockRewards { // TxRewards defines transaction related rewards distribution data. message TxRewards { - option (gogoproto.goproto_stringer) = false; - // tx_id is the tracking transaction ID (x/tracking is the data source for // this value). uint64 tx_id = 1; @@ -93,8 +88,6 @@ message TxRewards { // bindings. For a contract to trigger rewards transfer, contract address must // be set as the rewards_address in a corresponding ContractMetadata. message RewardsRecord { - option (gogoproto.goproto_stringer) = false; - // id is the unique ID of the record. uint64 id = 1; // rewards_address is the address to distribute rewards to (bech32 encoded). @@ -111,8 +104,6 @@ message RewardsRecord { // FlatFee defines the flat fee for a particular contract. message FlatFee { - option (gogoproto.goproto_stringer) = false; - // contract_address defines the contract address (bech32 encoded). string contract_address = 1; // flat_fee defines the minimum flat fee set by the contract_owner diff --git a/packages/arch3-proto/proto/archway/rewards/v1/tx.proto b/packages/arch3-proto/proto/archway/rewards/v1/tx.proto index 8368de9..982d266 100644 --- a/packages/arch3-proto/proto/archway/rewards/v1/tx.proto +++ b/packages/arch3-proto/proto/archway/rewards/v1/tx.proto @@ -10,6 +10,7 @@ import "archway/rewards/v1/rewards.proto"; // Msg defines the module messaging service. service Msg { + option (cosmos.msg.v1.service) = true; // SetContractMetadata creates or updates an existing contract metadata. // Method is authorized to the contract owner (admin if no metadata exists). rpc SetContractMetadata(MsgSetContractMetadata) diff --git a/packages/arch3-proto/proto/archway/tracking/v1/tracking.proto b/packages/arch3-proto/proto/archway/tracking/v1/tracking.proto index effbbca..a390bc8 100644 --- a/packages/arch3-proto/proto/archway/tracking/v1/tracking.proto +++ b/packages/arch3-proto/proto/archway/tracking/v1/tracking.proto @@ -20,8 +20,6 @@ enum ContractOperation { // TxInfo keeps a transaction gas tracking data. // Object is being created at the module EndBlocker. message TxInfo { - option (gogoproto.goproto_stringer) = false; - // id defines the unique transaction ID. uint64 id = 1; // height defines the block height of the transaction. @@ -34,8 +32,6 @@ message TxInfo { // ContractOperationInfo keeps a single contract operation gas consumption data. // Object is being created by the IngestGasRecord call from the wasmd. message ContractOperationInfo { - option (gogoproto.goproto_stringer) = false; - // id defines the unique operation ID. uint64 id = 1; // tx_id defines a transaction ID operation relates to (TxInfo.id). @@ -55,16 +51,12 @@ message ContractOperationInfo { // BlockTracking is the tracking information for a block. message BlockTracking { - option (gogoproto.goproto_stringer) = false; - // txs defines the list of transactions tracked in the block. repeated TxTracking txs = 1 [ (gogoproto.nullable) = false ]; } // TxTracking is the tracking information for a single transaction. message TxTracking { - option (gogoproto.goproto_stringer) = false; - // info defines the transaction details. TxInfo info = 1 [ (gogoproto.nullable) = false ]; // contract_operations defines the list of contract operations consumed by the diff --git a/packages/arch3-proto/proto/cosmos/base/v1beta1/coin.proto b/packages/arch3-proto/proto/cosmos/base/v1beta1/coin.proto index 69c96f6..1447d64 100644 --- a/packages/arch3-proto/proto/cosmos/base/v1beta1/coin.proto +++ b/packages/arch3-proto/proto/cosmos/base/v1beta1/coin.proto @@ -19,7 +19,7 @@ message Coin { string denom = 1; string amount = 2 [ (cosmos_proto.scalar) = "cosmos.Int", - (gogoproto.customtype) = "Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; @@ -33,16 +33,29 @@ message DecCoin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 - [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // IntProto defines a Protobuf wrapper around an Int object. +// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. message IntProto { - string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string int = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; } // DecProto defines a Protobuf wrapper around a Dec object. +// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. message DecProto { - string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string dec = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } diff --git a/packages/arch3-proto/proto/cosmos/upgrade/v1beta1/upgrade.proto b/packages/arch3-proto/proto/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 0000000..5dfb289 --- /dev/null +++ b/packages/arch3-proto/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,94 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "cosmossdk.io/x/upgrade/types"; +option (gogoproto.goproto_getters_all) = false; + +// Plan specifies information about a planned upgrade and when it should occur. +message Plan { + option (amino.name) = "cosmos-sdk/Plan"; + option (gogoproto.equal) = true; + + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 + [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // The height at which the upgrade must be performed. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; +} + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. +message SoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; + + // plan of the proposal + Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. +message CancelSoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + + // title of the proposal + string title = 1; + + // description of the proposal + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +message ModuleVersion { + option (gogoproto.equal) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/packages/arch3-proto/proto/ibc/core/channel/v1/channel.proto b/packages/arch3-proto/proto/ibc/core/channel/v1/channel.proto new file mode 100644 index 0000000..05c7dba --- /dev/null +++ b/packages/arch3-proto/proto/ibc/core/channel/v1/channel.proto @@ -0,0 +1,161 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// Channel defines pipeline for exactly-once packet delivery between specific +// modules on separate blockchains, which has at least one end capable of +// sending packets and one end capable of receiving packets. +message Channel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + // list of connection identifiers, in order, along which packets sent on + // this channel will travel + repeated string connection_hops = 4; + // opaque channel version, which is agreed upon during the handshake + string version = 5; +} + +// IdentifiedChannel defines a channel with additional port and channel +// identifier fields. +message IdentifiedChannel { + option (gogoproto.goproto_getters) = false; + + // current state of the channel end + State state = 1; + // whether the channel is ordered or unordered + Order ordering = 2; + // counterparty channel end + Counterparty counterparty = 3 [(gogoproto.nullable) = false]; + // list of connection identifiers, in order, along which packets sent on + // this channel will travel + repeated string connection_hops = 4; + // opaque channel version, which is agreed upon during the handshake + string version = 5; + // port identifier + string port_id = 6; + // channel identifier + string channel_id = 7; +} + +// State defines if a channel is in one of the following states: +// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +enum State { + option (gogoproto.goproto_enum_prefix) = false; + + // Default State + STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; + // A channel has just started the opening handshake. + STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; + // A channel has acknowledged the handshake step on the counterparty chain. + STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; + // A channel has completed the handshake. Open channels are + // ready to send and receive packets. + STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; + // A channel has been closed and can no longer be used to send or receive + // packets. + STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; +} + +// Order defines if a channel is ORDERED or UNORDERED +enum Order { + option (gogoproto.goproto_enum_prefix) = false; + + // zero-value for channel ordering + ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; + // packets can be delivered in any order, which may differ from the order in + // which they were sent. + ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; + // packets are delivered exactly in the order which they were sent + ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; +} + +// Counterparty defines a channel end counterparty +message Counterparty { + option (gogoproto.goproto_getters) = false; + + // port on the counterparty chain which owns the other end of the channel. + string port_id = 1; + // channel end on the counterparty chain + string channel_id = 2; +} + +// Packet defines a type that carries data across different chains through IBC +message Packet { + option (gogoproto.goproto_getters) = false; + + // number corresponds to the order of sends and receives, where a Packet + // with an earlier sequence number must be sent and received before a Packet + // with a later sequence number. + uint64 sequence = 1; + // identifies the port on the sending chain. + string source_port = 2; + // identifies the channel end on the sending chain. + string source_channel = 3; + // identifies the port on the receiving chain. + string destination_port = 4; + // identifies the channel end on the receiving chain. + string destination_channel = 5; + // actual opaque bytes transferred directly to the application module + bytes data = 6; + // block height after which the packet times out + ibc.core.client.v1.Height timeout_height = 7 [(gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet times out + uint64 timeout_timestamp = 8; +} + +// PacketState defines the generic type necessary to retrieve and store +// packet commitments, acknowledgements, and receipts. +// Caller is responsible for knowing the context necessary to interpret this +// state as a commitment, acknowledgement, or a receipt. +message PacketState { + option (gogoproto.goproto_getters) = false; + + // channel port identifier. + string port_id = 1; + // channel unique identifier. + string channel_id = 2; + // packet sequence. + uint64 sequence = 3; + // embedded data that represents packet state. + bytes data = 4; +} + +// PacketId is an identifer for a unique Packet +// Source chains refer to packets by source port/channel +// Destination chains refer to packets by destination port/channel +message PacketId { + option (gogoproto.goproto_getters) = false; + + // channel port identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; + // packet sequence + uint64 sequence = 3; +} + +// Acknowledgement is the recommended acknowledgement format to be used by +// app-specific protocols. +// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +// conflicts with other protobuf message formats used for acknowledgements. +// The first byte of any message with this format will be the non-ASCII values +// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope +message Acknowledgement { + // response contains either a result or an error and must be non-empty + oneof response { + bytes result = 21; + string error = 22; + } +} diff --git a/packages/arch3-proto/proto/ibc/core/client/v1/client.proto b/packages/arch3-proto/proto/ibc/core/client/v1/client.proto new file mode 100644 index 0000000..9c9178d --- /dev/null +++ b/packages/arch3-proto/proto/ibc/core/client/v1/client.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos_proto/cosmos.proto"; + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +message IdentifiedClientState { + // client identifier + string client_id = 1; + // client state + google.protobuf.Any client_state = 2; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // consensus state + google.protobuf.Any consensus_state = 2; +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +message ClientConsensusStates { + // client identifier + string client_id = 1; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; +} + +// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// client's latest consensus state is copied over to the subject client. The proposal +// handler may fail if the subject and the substitute do not match in client and +// chain parameters (with exception to latest height, frozen height, and chain-id). +message ClientUpdateProposal { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // the client identifier for the client to be updated if the proposal passes + string subject_client_id = 3; + // the substitute client identifier for the client standing in for the subject + // client + string substitute_client_id = 4; +} + +// UpgradeProposal is a gov Content type for initiating an IBC breaking +// upgrade. +message UpgradeProposal { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false]; + + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades + google.protobuf.Any upgraded_client_state = 4; +} + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1; + // the height within the given revision + uint64 revision_height = 2; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types which can be created + // and interacted with. If a client type is removed from the allowed clients list, usage + // of this client will be disabled until it is added again to the list. + repeated string allowed_clients = 1; +} diff --git a/yarn.lock b/yarn.lock index 14a29db..59d4c4c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -79,7 +79,7 @@ __metadata: "@cosmjs/proto-signing": "npm:^0.32.4" "@cosmjs/stargate": "npm:^0.32.4" "@cosmjs/tendermint-rpc": "npm:^0.32.4" - "@cosmology/telescope": "npm:^1.4.12" + "@cosmology/telescope": "npm:^1.8.3" "@types/jest": "npm:^29.5.7" "@types/node": "npm:^20.8.10" "@types/webgl2": "npm:^0.0.9" @@ -95,8 +95,8 @@ __metadata: jest: "npm:^29.7.0" prettier: "npm:^3.0.3" prettier-eslint: "npm:^16.1.2" - protobufjs: "npm:^7.2.5" - regenerator-runtime: "npm:^0.14.0" + protobufjs: "npm:^7.4.0" + regenerator-runtime: "npm:^0.14.1" rimraf: "npm:^5.0.5" ts-jest: "npm:^29.1.1" ts-node: "npm:^10.9.1" @@ -2071,38 +2071,38 @@ __metadata: languageName: node linkType: hard -"@cosmology/ast@npm:^1.4.8": - version: 1.4.8 - resolution: "@cosmology/ast@npm:1.4.8" +"@cosmology/ast@npm:^1.8.1": + version: 1.8.1 + resolution: "@cosmology/ast@npm:1.8.1" dependencies: - "@babel/parser": "npm:^7.23.6" "@babel/types": "npm:7.23.6" - "@cosmology/types": "npm:^1.4.2" - "@cosmology/utils": "npm:^1.4.2" + "@cosmology/types": "npm:^1.8.1" + "@cosmology/utils": "npm:^1.8.1" case: "npm:1.6.3" dotty: "npm:0.1.2" - checksum: 693da42a8c313dd1cb8eccac5d24012d78cd9cbdcec9f6f2bfe454bb292e1e88dc2fbb213591f683183175be45d19674a9dc7459fd5bd083f91768c6d19c318e + checksum: 54abd734d60c6bd2d41944be6712f8e18fda439a16ee249acd653fc4b9400c91f16e3947df5f925f11134deeecbd5779bebff8981b786752706d2e8a04ae4148 languageName: node linkType: hard -"@cosmology/proto-parser@npm:^1.4.4": - version: 1.4.4 - resolution: "@cosmology/proto-parser@npm:1.4.4" +"@cosmology/proto-parser@npm:^1.8.1": + version: 1.8.1 + resolution: "@cosmology/proto-parser@npm:1.8.1" dependencies: - "@cosmology/protobufjs": "npm:6.11.6" - "@cosmology/types": "npm:^1.4.2" - "@cosmology/utils": "npm:^1.4.2" + "@cosmology/protobufjs": "npm:7.3.2" + "@cosmology/types": "npm:^1.8.1" + "@cosmology/utils": "npm:^1.8.1" dotty: "npm:0.1.2" + fast-json-patch: "npm:3.1.1" glob: "npm:8.0.3" minimatch: "npm:5.1.0" mkdirp: "npm:3.0.0" - checksum: 58c38573197c16f45aa0c58c875d938ffd9b498cfc318bf998cf6ce88d29d1c404dec266b5c67c75120d515ca304333b922006b395b12b352b238e9d695aef7b + checksum: 1ddd1d6fdfbef2ebb2af2c1aa7155c62a662dccb294995c313a007871de9aca1991d3be768f1fcb2540e0ff396c62d25fd479949356fe0117b2102ad3d4dcb3b languageName: node linkType: hard -"@cosmology/protobufjs@npm:6.11.6": - version: 6.11.6 - resolution: "@cosmology/protobufjs@npm:6.11.6" +"@cosmology/protobufjs@npm:7.3.2": + version: 7.3.2 + resolution: "@cosmology/protobufjs@npm:7.3.2" dependencies: "@protobufjs/aspromise": "npm:^1.1.2" "@protobufjs/base64": "npm:^1.1.2" @@ -2114,29 +2114,26 @@ __metadata: "@protobufjs/path": "npm:^1.1.2" "@protobufjs/pool": "npm:^1.1.0" "@protobufjs/utf8": "npm:^1.1.0" - "@types/long": "npm:^4.0.1" + "@types/long": "npm:^5.0.0" "@types/node": "npm:>=13.7.0" - long: "npm:^4.0.0" - bin: - pbjs: bin/pbjs - pbts: bin/pbts - checksum: 893a1cd63df04852ddf37c5912f36ea1f5f7f60b7d81faa1403421d68c310c337103ddba5d595681128c8eb5119aea42fb0499ae1f1d20dc85df3f2953faa67d + long: "npm:^5.0.0" + checksum: 91cb5a8eb2436d8492f0f92951246f86815d171de8f749fb12e3e5980805bdd88e94148a683a95a061d42e07c1205cc285b4ea25a795547f836d80eb8d9032c4 languageName: node linkType: hard -"@cosmology/telescope@npm:^1.4.12": - version: 1.4.12 - resolution: "@cosmology/telescope@npm:1.4.12" +"@cosmology/telescope@npm:^1.8.3": + version: 1.8.3 + resolution: "@cosmology/telescope@npm:1.8.3" dependencies: "@babel/generator": "npm:^7.23.6" "@babel/parser": "npm:^7.23.6" "@babel/traverse": "npm:7.23.6" "@babel/types": "npm:7.23.6" - "@cosmology/ast": "npm:^1.4.8" - "@cosmology/proto-parser": "npm:^1.4.4" - "@cosmology/types": "npm:^1.4.2" - "@cosmology/utils": "npm:^1.4.2" - "@cosmwasm/ts-codegen": "npm:0.34.0" + "@cosmology/ast": "npm:^1.8.1" + "@cosmology/proto-parser": "npm:^1.8.1" + "@cosmology/types": "npm:^1.8.1" + "@cosmology/utils": "npm:^1.8.1" + "@cosmwasm/ts-codegen": "npm:0.35.7" "@types/parse-package-name": "npm:0.1.0" case: "npm:1.6.3" dargs: "npm:7.0.0" @@ -2151,35 +2148,36 @@ __metadata: mkdirp: "npm:3.0.0" parse-package-name: "npm:1.0.0" rimraf: "npm:5.0.0" - shelljs: "npm:0.8.5" + yaml: "npm:^2.3.4" bin: telescope: main/telescope.js - checksum: 540f55e7c7abbf9b5ab0fd42a43188772f84fde11aa9a811c8409f96fed4f412e193790d5b852ff6a55a715ff64ad8e0a7dece768890e3d7b42c4975cbd6876e + checksum: f0d153242315dcf6c201b4cc931c57314b9729a9f2508d220f46abe39f5ab87658a536ceacd29ac2cb5fb6ed5e98fa6a63836efe0c399505e3c5ee58bcab7d11 languageName: node linkType: hard -"@cosmology/types@npm:^1.4.2": - version: 1.4.2 - resolution: "@cosmology/types@npm:1.4.2" +"@cosmology/types@npm:^1.8.1": + version: 1.8.1 + resolution: "@cosmology/types@npm:1.8.1" dependencies: case: "npm:1.6.3" - checksum: 9a3363373d2d622a844178162868bfc559d58770e8e927ce9d9cc21698cdaeae86d31e888680ad08162fa4a5be5a0b1bb614eee32d5522c52b13e7fcc03f2b46 + fast-json-patch: "npm:3.1.1" + checksum: e10b43421420b8e49d8d85221535e9aa54754e0d3b7b719f5efdc188335c266bab3d7c4731ce2f0976c275b82e0c851584d80fad773ad1840e0ea706b73d791c languageName: node linkType: hard -"@cosmology/utils@npm:^1.4.2": - version: 1.4.2 - resolution: "@cosmology/utils@npm:1.4.2" +"@cosmology/utils@npm:^1.8.1": + version: 1.8.1 + resolution: "@cosmology/utils@npm:1.8.1" dependencies: - "@cosmology/types": "npm:^1.4.2" + "@cosmology/types": "npm:^1.8.1" dotty: "npm:0.1.2" - checksum: d51d1f62e6c0458081fbbf3833725e5f717d8bd3bd21ec7706df67763d141dc95cee473203ad580b592991774f67613982b6699775a396e5cdeff4629734fb70 + checksum: 2cdb7dc67b63336493da35a03bba6a2b83f439a81c44ac0b81c5ce44c96578d7f187fb9f27ab4302a18cffe26c0ef3d056d8af41ff560609c197665cfa0e86cc languageName: node linkType: hard -"@cosmwasm/ts-codegen@npm:0.34.0": - version: 0.34.0 - resolution: "@cosmwasm/ts-codegen@npm:0.34.0" +"@cosmwasm/ts-codegen@npm:0.35.7": + version: 0.35.7 + resolution: "@cosmwasm/ts-codegen@npm:0.35.7" dependencies: "@babel/core": "npm:7.18.10" "@babel/generator": "npm:7.18.12" @@ -2207,10 +2205,10 @@ __metadata: parse-package-name: "npm:1.0.0" rimraf: "npm:3.0.2" shelljs: "npm:0.8.5" - wasm-ast-types: "npm:^0.25.0" + wasm-ast-types: "npm:^0.26.4" bin: cosmwasm-ts-codegen: main/ts-codegen.js - checksum: 6bc4ba773448be52fdf4a39d7e7ead5443a571ae33d4f129a772db44c001efc068a7e542f308bd1de2f85ad7eb4264b8a51b211d6e613d2de8efb67a6d272888 + checksum: a0bad6d3115d35286afb4df732318a25d4ce489132b77349edac459d848fa8dfdcb2dabb2d0ac45b7affe03cae73bdaae7c09eca2a7f6aa3e76930538dffe601 languageName: node linkType: hard @@ -3137,6 +3135,15 @@ __metadata: languageName: node linkType: hard +"@types/long@npm:^5.0.0": + version: 5.0.0 + resolution: "@types/long@npm:5.0.0" + dependencies: + long: "npm:*" + checksum: 1483b703bd6257cff1c9921cdc80e36f83985bed1f7bf9a64919e29df0038c3eb5acc82b70cd0cf15e4fdd639f79976eed5f7f9053e8db152b21b9e5d202845c + languageName: node + linkType: hard + "@types/minimatch@npm:*": version: 5.1.2 resolution: "@types/minimatch@npm:5.1.2" @@ -5850,6 +5857,13 @@ __metadata: languageName: node linkType: hard +"fast-json-patch@npm:3.1.1": + version: 3.1.1 + resolution: "fast-json-patch@npm:3.1.1" + checksum: 3e56304e1c95ad1862a50e5b3f557a74c65c0ff2ba5b15caab983b43e70e86ddbc5bc887e9f7064f0aacfd0f0435a29ab2f000fe463379e72b906486345e6671 + languageName: node + linkType: hard + "fast-json-stable-stringify@npm:2.x, fast-json-stable-stringify@npm:^2.0.0, fast-json-stable-stringify@npm:^2.1.0": version: 2.1.0 resolution: "fast-json-stable-stringify@npm:2.1.0" @@ -8119,6 +8133,13 @@ __metadata: languageName: node linkType: hard +"long@npm:*, long@npm:^5.0.0, long@npm:^5.2.0, long@npm:^5.2.1": + version: 5.2.3 + resolution: "long@npm:5.2.3" + checksum: 9167ec6947a825b827c30da169a7384eec6c0c9ec2f0b9c74da2e93d81159bbe39fb09c3f13dae9721d4b807ccfa09797a7dd1012f5d478e3e33ca3c78b608e6 + languageName: node + linkType: hard + "long@npm:^4.0.0": version: 4.0.0 resolution: "long@npm:4.0.0" @@ -8126,13 +8147,6 @@ __metadata: languageName: node linkType: hard -"long@npm:^5.0.0, long@npm:^5.2.0, long@npm:^5.2.1": - version: 5.2.3 - resolution: "long@npm:5.2.3" - checksum: 9167ec6947a825b827c30da169a7384eec6c0c9ec2f0b9c74da2e93d81159bbe39fb09c3f13dae9721d4b807ccfa09797a7dd1012f5d478e3e33ca3c78b608e6 - languageName: node - linkType: hard - "lowercase-keys@npm:^2.0.0": version: 2.0.0 resolution: "lowercase-keys@npm:2.0.0" @@ -9213,9 +9227,9 @@ __metadata: languageName: node linkType: hard -"protobufjs@npm:^7.2.5": - version: 7.2.5 - resolution: "protobufjs@npm:7.2.5" +"protobufjs@npm:^7.4.0": + version: 7.4.0 + resolution: "protobufjs@npm:7.4.0" dependencies: "@protobufjs/aspromise": "npm:^1.1.2" "@protobufjs/base64": "npm:^1.1.2" @@ -9229,7 +9243,7 @@ __metadata: "@protobufjs/utf8": "npm:^1.1.0" "@types/node": "npm:>=13.7.0" long: "npm:^5.0.0" - checksum: 6c5aa62b61dff843f585f3acd9cb7a82d566de2dbf167a300b39afee91b04298c4b4aec61354b7c00308b40596f5f3f4b07d6246cfb4ee0abeaea25101033315 + checksum: 408423506610f70858d7593632f4a6aa4f05796c90fd632be9b9252457c795acc71aa6d3b54bb7f48a890141728fee4ca3906723ccea6c202ad71f21b3879b8b languageName: node linkType: hard @@ -9398,10 +9412,10 @@ __metadata: languageName: node linkType: hard -"regenerator-runtime@npm:^0.14.0": - version: 0.14.0 - resolution: "regenerator-runtime@npm:0.14.0" - checksum: 6c19495baefcf5fbb18a281b56a97f0197b5f219f42e571e80877f095320afac0bdb31dab8f8186858e6126950068c3f17a1226437881e3e70446ea66751897c +"regenerator-runtime@npm:^0.14.1": + version: 0.14.1 + resolution: "regenerator-runtime@npm:0.14.1" + checksum: 5db3161abb311eef8c45bcf6565f4f378f785900ed3945acf740a9888c792f75b98ecb77f0775f3bf95502ff423529d23e94f41d80c8256e8fa05ed4b07cf471 languageName: node linkType: hard @@ -10899,9 +10913,9 @@ __metadata: languageName: node linkType: hard -"wasm-ast-types@npm:^0.25.0": - version: 0.25.0 - resolution: "wasm-ast-types@npm:0.25.0" +"wasm-ast-types@npm:^0.26.4": + version: 0.26.4 + resolution: "wasm-ast-types@npm:0.26.4" dependencies: "@babel/runtime": "npm:^7.18.9" "@babel/types": "npm:7.18.10" @@ -10909,7 +10923,7 @@ __metadata: ast-stringify: "npm:0.1.0" case: "npm:1.6.3" deepmerge: "npm:4.2.2" - checksum: b4bf95152c61281b9c1b1ca1edc8f69671217e1e7b0a1f5c1d1766ac34e172db3f4c40e9a0db2508a4b7988b0703ad987f9fafaab63104e256e30051e4cff90c + checksum: e4bf09ea97dbdc5c8aa8a6c4fb616add674a9993fd805a985188149e3f04d825c6ae9cabe1fee2d8bfb1cdcd95733cb582f1cfec6661e2292cef75dd565b6736 languageName: node linkType: hard @@ -11058,6 +11072,15 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.3.4": + version: 2.5.1 + resolution: "yaml@npm:2.5.1" + bin: + yaml: bin.mjs + checksum: 0eecb679db75ea6a989ad97715a9fa5d946972945aa6aa7d2175bca66c213b5564502ccb1cdd04b1bf816ee38b5c43e4e2fda3ff6f5e09da24dabb51ae92c57d + languageName: node + linkType: hard + "yargs-parser@npm:^20.2.3": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9" From 0f04d8e453e4aa15eba56939bdf283cfc4a2c6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20Elesb=C3=A3o?= Date: Wed, 23 Oct 2024 14:50:27 +0200 Subject: [PATCH 3/3] build: update container image to v9.0.0 --- docker-compose.yaml | 11 +++++------ scripts/docker-entrypoint.sh | 10 +++++----- scripts/faucet.sh | 2 +- scripts/start-local-node.sh | 6 +++--- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 27be11c..3d3b3a9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,12 +1,12 @@ services: node: - image: archwaynetwork/archwayd:v6.0.0 + image: ghcr.io/archway-network/archwayd-dev:v9.0.0 command: start --x-crisis-skip-assert-invariants entrypoint: /docker-entrypoint.sh ports: - - 1317:1317 # API - - 9090:9090 # gRPC - - 9091:9091 # gRPC-web + - 1317:1317 # API + - 9090:9090 # gRPC + - 9091:9091 # gRPC-web - 26656:26656 # p2p - 26657:26657 # RPC volumes: @@ -14,8 +14,7 @@ services: - ./scripts/contracts:/contracts:ro - data:/root/.archway healthcheck: - test: - curl --retry 5 --retry-delay 1 --retry-all-errors -sf 'http://localhost:26657/status' | + test: curl --retry 5 --retry-delay 1 --retry-all-errors -sf 'http://localhost:26657/status' | jq -e '.result.sync_info | (.latest_block_height > 0 and .catching_up == false)' interval: 5s timeout: 30s diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index 77b6b33..f839879 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -4,7 +4,7 @@ # It will initialize the node if it's not configured yet. # -set -eu +set -eux ARCHWAY_HOME="${ARCHWAY_HOME:-$HOME/.archway}" @@ -42,10 +42,10 @@ if [ ! -f "${GENESIS_FILE}" ]; then echo "Initializing the node ${MONIKER} on chain ${CHAIN_ID}..." archwayd init --chain-id "${CHAIN_ID}" "${MONIKER}" | jq . - archwayd config chain-id "${CHAIN_ID}" - archwayd config node "tcp://node:26657" - archwayd config keyring-backend test - archwayd config output json + archwayd config set client chain-id "${CHAIN_ID}" + archwayd config set client node "tcp://node:26657" + archwayd config set client keyring-backend test + archwayd config set client output json echo "Creating validator key..." echo "${VALIDATOR_MNEMONIC}" | archwayd keys add validator --recover diff --git a/scripts/faucet.sh b/scripts/faucet.sh index ec22222..225521c 100755 --- a/scripts/faucet.sh +++ b/scripts/faucet.sh @@ -18,7 +18,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" source "${SCRIPT_DIR}/_shared.sh" amount="${2:-10}$(printf "%018d" 0)" -denom="$(archwayd q staking params | jq -r '.bond_denom')" +denom="$(archwayd q staking params | jq -r '.params.bond_denom')" echo "Requesting ${amount}${denom} for ${ADDRESS}..." diff --git a/scripts/start-local-node.sh b/scripts/start-local-node.sh index aef7114..0ff6923 100755 --- a/scripts/start-local-node.sh +++ b/scripts/start-local-node.sh @@ -29,7 +29,7 @@ function store-contract() { if [[ -z "${code_id}" ]]; then tx_result="$(archwayd-tx --from validator wasm store /"${wasm}")" tx_hash="$(jq -r '.txhash' <<<"${tx_result}")" - code_id="$(jq -r '.logs[].events[] | select(.type == "store_code") | .attributes[] | select(.key == "code_id") | .value' <<<"${tx_result}")" + code_id="$(jq -r '.events[] | select(.type == "store_code") | .attributes[] | select(.key == "code_id") | .value' <<<"${tx_result}")" fi jq --null-input \ @@ -95,7 +95,7 @@ function instantiate-contract() { "${salt}" )" tx_hash="$(jq -r '.txhash' <<<"${tx_result}")" - tx_contract_address="$(jq -r '.logs[].events[] | select(.type == "instantiate") | .attributes[] | select(.key == "_contract_address") | .value' <<<"${tx_result}")" + tx_contract_address="$(jq -r '.events[] | select(.type == "instantiate") | .attributes[] | select(.key == "_contract_address") | .value' <<<"${tx_result}")" [[ "${contract_address}" == "${tx_contract_address}" ]] || error "contract address mismatch: expected ${contract_address}, got ${tx_contract_address}" fi @@ -206,7 +206,7 @@ done topic "Deploying voter contract" # Source: https://github.com/archway-network/archway/tree/main/contracts/go/voter -denom="$(archwayd q staking params | jq -r '.bond_denom')" +denom="$(archwayd q staking params | jq -r '.params.bond_denom')" dotenv-add DENOM "${denom}" action "storing"